diff --git a/.changeset/kind-files-fold.md b/.changeset/kind-files-fold.md new file mode 100644 index 000000000..c58749c48 --- /dev/null +++ b/.changeset/kind-files-fold.md @@ -0,0 +1,5 @@ +--- +"bits-ui": patch +--- + +fix: pagination prop reactivity diff --git a/.eslintrc.cjs b/.eslintrc.cjs index aed3929af..6c9a91153 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -51,7 +51,7 @@ module.exports = { "warn", { argsIgnorePattern: "^_", - varsIgnorePattern: "^\\$\\$(Props|Events|Slots|Generic)$" + varsIgnorePattern: "^\\$\\$(Props|Events|Slots|Generic|_[^$])*$" } ] } diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..0d95135cf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,50 @@ +name: "🐛 Bug report" +description: Report an issue with bits-ui +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: bug-description + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us how in the description. Thanks! + placeholder: Bug description + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction + description: Please provide a link to a repo or Stackblitz that can reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "needs reproduction" label. If no reproduction is provided within a reasonable time-frame, the issue will be closed. + placeholder: Reproduction + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + description: "Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text." + render: bash + - type: textarea + id: system-info + attributes: + label: System Info + description: Output of `npx envinfo --system --npmPackages svelte,bits-ui,@sveltejs/kit --binaries --browsers` + render: bash + placeholder: System, Binaries, Browsers + validations: + required: true + - type: dropdown + id: severity + attributes: + label: Severity + description: Select the severity of this issue + options: + - annoyance + - blocking an upgrade + - blocking all usage of bits-ui + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yml b/.github/ISSUE_TEMPLATE/documentation_change.yml new file mode 100644 index 000000000..391531008 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_change.yml @@ -0,0 +1,22 @@ +name: 📖 Report Docs Issue +description: Suggest an addition or modification to the documentation +labels: ["type: documentation"] +body: + - type: dropdown + attributes: + label: Change Type + description: What type of change are you proposing? + options: + - Addition + - Correction + - Removal + - Cleanup (formatting, typos, etc.) + validations: + required: true + + - type: textarea + attributes: + label: Proposed Changes + description: Describe the proposed changes and why they are necessary + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..c86d53efd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,26 @@ +# Borrowed from https://github.com/skeletonlabs/skeleton + +name: 🛠️ Request New Feature +description: Let us know what you would like to see added. +labels: ["type: feature"] +body: + - type: textarea + id: description + attributes: + label: Describe the feature in detail (code, mocks, or screenshots encouraged) + validations: + required: true + - type: dropdown + id: category + attributes: + label: What type of pull request would this be? + options: + - "New Feature" + - "Enhancement" + - "Guide" + - "Docs" + - "Other" + - type: textarea + id: references + attributes: + label: Provide relevant links or additional information. diff --git a/src/lib/bits/pagination/components/pagination.svelte b/src/lib/bits/pagination/components/pagination.svelte index c5e2eba49..ccb77c427 100644 --- a/src/lib/bits/pagination/components/pagination.svelte +++ b/src/lib/bits/pagination/components/pagination.svelte @@ -15,8 +15,9 @@ const { elements: { root }, - states: { pages, range }, - getAttrs + states: { pages, range, page: localPage }, + getAttrs, + updateOption } = setCtx({ count, perPage, @@ -32,10 +33,16 @@ } }); + $: page !== undefined && localPage.set(page); + const attrs = getAttrs("root"); $: builder = $root; $: Object.assign(builder, attrs); + + $: updateOption("count", count); + $: updateOption("perPage", perPage); + $: updateOption("siblingCount", siblingCount); {#if asChild}