@citrusworx/juiceui 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -7
- package/dist/index.css +240 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +208 -2
- package/dist/js/juice.d.ts +2 -0
- package/dist/js/src/pagination/pagination-runtime.d.ts +79 -0
- package/dist/themes/aquaflux.css +93 -0
- package/dist/themes/citrusmint.css +87 -0
- package/dist/themes/kiwipress.css +93 -0
- package/dist/themes/retro-afterburn.css +1701 -0
- package/dist/themes/retro-arcade-glow.css +1701 -0
- package/dist/themes/retro-boardwalk.css +1553 -0
- package/dist/themes/retro-denim-dial.css +1553 -0
- package/dist/themes/retro-forest-radio.css +1553 -0
- package/dist/themes/retro-orchard-club.css +1553 -0
- package/dist/themes/retro-poolside-pop.css +1553 -0
- package/dist/themes/retro-signal-garden.css +1553 -0
- package/dist/themes/retro-sunset-motel.css +1553 -0
- package/dist/themes/retro-violet-parlor.css +1553 -0
- package/dist/themes/tide.css +92 -0
- package/package.json +92 -2
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ import "@citrusworx/juiceui/styles/themes/aquaflux";
|
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
55
|
<body theme="aquaflux">
|
|
56
|
-
<!-- or theme="kiwipress" | theme="citrusmint" | theme="tide" -->
|
|
56
|
+
<!-- or theme="kiwipress" | theme="citrusmint" | theme="tide" | theme="retro-afterburn" | theme="retro-arcade-glow" | theme="retro-boardwalk" | theme="retro-denim-dial" | theme="retro-forest-radio" | theme="retro-orchard-club" | theme="retro-poolside-pop" | theme="retro-signal-garden" | theme="retro-sunset-motel" | theme="retro-violet-parlor" -->
|
|
57
57
|
</body>
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -144,6 +144,10 @@ import {
|
|
|
144
144
|
initProgress,
|
|
145
145
|
startProgressRuntime,
|
|
146
146
|
stopProgressRuntime,
|
|
147
|
+
createPagination,
|
|
148
|
+
initPagination,
|
|
149
|
+
startPaginationRuntime,
|
|
150
|
+
stopPaginationRuntime,
|
|
147
151
|
createNavigation,
|
|
148
152
|
initNavigation,
|
|
149
153
|
startNavigationRuntime,
|
|
@@ -154,23 +158,23 @@ import {
|
|
|
154
158
|
|
|
155
159
|
The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
|
|
156
160
|
|
|
157
|
-
Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, menu, switch, slider, checkbox, radio, breadcrumb, and
|
|
161
|
+
Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, menu, switch, slider, checkbox, radio, breadcrumb, progress, and pagination runtimes in the browser. Valid `[accordion]`, `[tabs]`, `[modal-overlay]`, `[drawer-overlay]`, `[toast-region]`, `[popover-root]`, `[wizard-shell]`, `[tooltip-root]`, `[combobox]`, `[banner]`, `[menu-root]`, `[switch]`, `[slider]`, `[checkbox]`, `[radiogroup]`, `[breadcrumb]`, `[progress]`, and `[pagination]` markup work without app init. See [docs/juice/juice-accordion-runtime.md](../../docs/juice/juice-accordion-runtime.md), [docs/juice/juice-tabs-runtime.md](../../docs/juice/juice-tabs-runtime.md), [docs/juice/juice-modal-runtime.md](../../docs/juice/juice-modal-runtime.md), [docs/juice/juice-drawer-runtime.md](../../docs/juice/juice-drawer-runtime.md), [docs/juice/juice-toast-runtime.md](../../docs/juice/juice-toast-runtime.md), [docs/juice/juice-popover-runtime.md](../../docs/juice/juice-popover-runtime.md), [docs/juice/juice-wizard-runtime.md](../../docs/juice/juice-wizard-runtime.md), [docs/juice/juice-tooltip-runtime.md](../../docs/juice/juice-tooltip-runtime.md), [docs/juice/juice-combobox-runtime.md](../../docs/juice/juice-combobox-runtime.md), [docs/juice/juice-banner-runtime.md](../../docs/juice/juice-banner-runtime.md), [docs/juice/juice-menu-runtime.md](../../docs/juice/juice-menu-runtime.md), [docs/juice/juice-switch-runtime.md](../../docs/juice/juice-switch-runtime.md), [docs/juice/juice-slider-runtime.md](../../docs/juice/juice-slider-runtime.md), [docs/juice/juice-checkbox-runtime.md](../../docs/juice/juice-checkbox-runtime.md), [docs/juice/juice-radio-runtime.md](../../docs/juice/juice-radio-runtime.md), [docs/juice/juice-breadcrumb-runtime.md](../../docs/juice/juice-breadcrumb-runtime.md), [docs/juice/juice-progress-runtime.md](../../docs/juice/juice-progress-runtime.md), and [docs/juice/juice-pagination-runtime.md](../../docs/juice/juice-pagination-runtime.md). Banner is an inline alert / callout (`show` / `dismiss`, `[banner-close]`), not a toast stack. Menu is an APG menu button (`open` / `close` / `toggle` / `select`), not a popover and not a menubar. Switch is an APG switch (`toggle` / `check` / `uncheck` / `setChecked`), not a layered overlay. Slider is an APG slider (`setValue` / `getValue` / `increment` / `decrement`), not a layered overlay. Checkbox is an APG checkbox (`toggle` / `check` / `uncheck` / `setChecked`), not a layered overlay. Radio is an APG radio group (`select` / `getChecked`), not a layered overlay. Breadcrumb is a light trail (`sync` / `setCurrent`), not a router. Progress is an APG-inspired progressbar (`setValue` / `getValue` / `setIndeterminate`), not a slider. Pagination is a page set (`sync` / `setCurrent`): one current page, prev/next disabled at inferable ends, and Arrow/Home/End among enabled controls. Pagination is the nineteenth Emerging auto-enhance runtime and is unpublished versus 0.9.0. Checkbox and radio are two runtimes. Breadcrumb is a light trail. Progress is a progressbar. Pagination is a page set.
|
|
158
162
|
## Use the built files directly
|
|
159
163
|
|
|
160
164
|
If you are hosting Juice assets yourself, the main built files are:
|
|
161
165
|
|
|
162
166
|
- `dist/index.css` (core)
|
|
163
|
-
- `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`
|
|
167
|
+
- `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`, `dist/themes/retro-afterburn.css`, `dist/themes/retro-arcade-glow.css`, `dist/themes/retro-boardwalk.css`, `dist/themes/retro-denim-dial.css`, `dist/themes/retro-forest-radio.css`, `dist/themes/retro-orchard-club.css`, `dist/themes/retro-poolside-pop.css`, `dist/themes/retro-signal-garden.css`, `dist/themes/retro-sunset-motel.css`, `dist/themes/retro-violet-parlor.css`
|
|
164
168
|
- `dist/index.js`
|
|
165
169
|
|
|
166
170
|
Load core plus at least one theme CSS file when using `theme="..."` on the root element.
|
|
167
171
|
|
|
168
|
-
There is no first-party Juice CDN. Those `dist/` files are on npm, so jsDelivr and unpkg serve them (verified for `@citrusworx/juiceui@0.
|
|
172
|
+
There is no first-party Juice CDN. Those `dist/` files are on npm, so jsDelivr and unpkg serve them (verified for `@citrusworx/juiceui@0.9.0`):
|
|
169
173
|
|
|
170
174
|
```html
|
|
171
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.
|
|
172
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.
|
|
173
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.
|
|
175
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/index.css" />
|
|
176
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/themes/kiwipress.css" />
|
|
177
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/index.js"></script>
|
|
174
178
|
```
|
|
175
179
|
|
|
176
180
|
The JS module is optional. Pin a version. You can also copy the same files out of `node_modules/@citrusworx/juiceui/dist/` next to a plain HTML page.
|
|
@@ -229,6 +233,7 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
|
|
|
229
233
|
- radio chrome colors come from `--juice-radio-*` roles bound by the active theme. `[radio]` is an APG radio on a button host inside `[radiogroup]` (a native `<input type="radio" radio>` is allowed). `[radiogroup]` is layout only. The runtime auto-enhances exclusive selection (`select` / `getChecked`, roving tabindex, arrows plus Space/Enter/click). Orphans outside `[radiogroup]` are ignored. Authors supply the accessible name. It is not `[switch]`, not `[checkbox]`, and not a layered overlay: no focus trap and no Escape. See [docs/juice/juice-radio-runtime.md](../../docs/juice/juice-radio-runtime.md).
|
|
230
234
|
- breadcrumb chrome colors come from `--juice-breadcrumb-*` roles bound by the active theme. `[breadcrumb]` is an APG-inspired trail on `<nav>` or `<ol>`, with `[breadcrumb-item]` crumbs. Current page is `aria-current="page"` inside the trail. `surface` stays transparent unless crumbs sit on a bar. It is not site nav, `nav[type="breadcrumb"]`, tabs, a wizard step tracker, or pagination, and it is not a layered overlay. The light runtime auto-enhances `[breadcrumb]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Breadcrumb`, and a single `aria-current="page"` is filled on the last crumb when none is set. It does not remove `href`, trap focus, steal Escape, or listen to history. `<ol breadcrumb>` stays a list. See [docs/juice/juice-breadcrumb-runtime.md](../../docs/juice/juice-breadcrumb-runtime.md). No Sig Breadcrumb factory.
|
|
231
235
|
- progress chrome colors come from `--juice-progress-*` roles bound by the active theme. `[progress]` is an APG-inspired progressbar track on `<div progress>`, with `[progress-fill]` for the completed portion and optional `[progress-label]`. The runtime auto-enhances that markup (`setValue` / `getValue` / `setIndeterminate`, `role="progressbar"`, `aria-valuemin` / `aria-valuemax` / `aria-valuenow`, `--juice-progress-ratio`). `progress="indeterminate"` slides the fill and omits `aria-valuenow`. Authors supply the accessible name; `aria-valuetext` is kept when the author set it. It is not a slider, not a spinner, and not a native `<progress>` restyle. Authors do not style the HTML `<progress>` element alone. Inline status chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-progress-runtime.md](../../docs/juice/juice-progress-runtime.md). No Sig Progress factory.
|
|
236
|
+
- pagination chrome colors come from `--juice-pagination-*` roles bound by the active theme. `[pagination]` is an APG-inspired page set on `<nav pagination>` or `<ol pagination>`, with `[pagination-item]` cells, `[pagination-prev]` / `[pagination-next]`, and optional `[pagination-link]`, `[pagination-ellipsis]`, and `[pagination-status]`. Current page is `aria-current="page"` on the control. Disabled prev/next use `aria-disabled="true"`, native `disabled`, or `[disabled]`. The trail stays transparent; `surface` is the page control, not a bar. It is not site nav, `nav[type="pagination"]`, a breadcrumb, tabs, or a wizard step tracker, and it is not a layered overlay. The runtime auto-enhances `[pagination]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Pagination`, a single `aria-current="page"` is kept (author current wins; otherwise the first page control), and prev/next are disabled at ends when page controls and optional ellipsis make that inferable. Author-owned disabled is kept. Arrow / Home / End move focus among enabled controls. It does not remove `href`, trap focus, steal Escape, or activate links on Enter/Space. `<ol pagination>` stays a list. See [docs/juice/juice-pagination-runtime.md](../../docs/juice/juice-pagination-runtime.md). Pagination is the nineteenth Emerging auto-enhance runtime. Unpublished versus 0.9.0. No Sig Pagination factory.
|
|
232
237
|
|
|
233
238
|
```html
|
|
234
239
|
<div tabs name="settings">
|
package/dist/index.css
CHANGED
|
@@ -99610,6 +99610,246 @@ nav[type=actions] a:hover {
|
|
|
99610
99610
|
transition: none;
|
|
99611
99611
|
}
|
|
99612
99612
|
}
|
|
99613
|
+
[pagination],
|
|
99614
|
+
[theme] [pagination] {
|
|
99615
|
+
display: flex;
|
|
99616
|
+
flex-wrap: wrap;
|
|
99617
|
+
align-items: center;
|
|
99618
|
+
justify-content: center;
|
|
99619
|
+
box-sizing: border-box;
|
|
99620
|
+
width: 100%;
|
|
99621
|
+
margin: 0;
|
|
99622
|
+
padding: 0;
|
|
99623
|
+
gap: 0.35rem;
|
|
99624
|
+
list-style: none;
|
|
99625
|
+
background-color: transparent;
|
|
99626
|
+
background-image: none;
|
|
99627
|
+
border: none;
|
|
99628
|
+
border-radius: 0;
|
|
99629
|
+
box-shadow: none;
|
|
99630
|
+
-webkit-backdrop-filter: none;
|
|
99631
|
+
backdrop-filter: none;
|
|
99632
|
+
color: var(--juice-pagination-ink, var(--aqua-pagination-ink, var(--kw-pagination-ink, var(--cm-pagination-ink, var(--tide-pagination-ink, var(--jx-pagination-ink, hsl(0, 0%, 25%)))))));
|
|
99633
|
+
font: inherit;
|
|
99634
|
+
line-height: 1.3;
|
|
99635
|
+
}
|
|
99636
|
+
|
|
99637
|
+
[pagination] > ol,
|
|
99638
|
+
[pagination] > ul,
|
|
99639
|
+
[theme] [pagination] > ol,
|
|
99640
|
+
[theme] [pagination] > ul {
|
|
99641
|
+
display: flex;
|
|
99642
|
+
flex-wrap: wrap;
|
|
99643
|
+
align-items: center;
|
|
99644
|
+
justify-content: center;
|
|
99645
|
+
box-sizing: border-box;
|
|
99646
|
+
width: 100%;
|
|
99647
|
+
margin: 0;
|
|
99648
|
+
padding: 0;
|
|
99649
|
+
gap: 0.35rem;
|
|
99650
|
+
list-style: none;
|
|
99651
|
+
background-color: transparent;
|
|
99652
|
+
background-image: none;
|
|
99653
|
+
border: none;
|
|
99654
|
+
box-shadow: none;
|
|
99655
|
+
color: inherit;
|
|
99656
|
+
}
|
|
99657
|
+
|
|
99658
|
+
[pagination-item],
|
|
99659
|
+
[theme] [pagination-item] {
|
|
99660
|
+
display: inline-flex;
|
|
99661
|
+
align-items: center;
|
|
99662
|
+
margin: 0;
|
|
99663
|
+
padding: 0;
|
|
99664
|
+
list-style: none;
|
|
99665
|
+
background-color: transparent;
|
|
99666
|
+
background-image: none;
|
|
99667
|
+
border: none;
|
|
99668
|
+
box-shadow: none;
|
|
99669
|
+
color: inherit;
|
|
99670
|
+
}
|
|
99671
|
+
|
|
99672
|
+
[pagination] :is(a, button):not([pagination-ellipsis]):not([pagination-status]),
|
|
99673
|
+
[pagination-link],
|
|
99674
|
+
a[pagination-link],
|
|
99675
|
+
button[pagination-link],
|
|
99676
|
+
[pagination-prev]:is(a, button),
|
|
99677
|
+
[pagination-next]:is(a, button),
|
|
99678
|
+
[theme] [pagination] :is(a, button):not([pagination-ellipsis]):not([pagination-status]),
|
|
99679
|
+
[theme] [pagination-link],
|
|
99680
|
+
[theme] a[pagination-link],
|
|
99681
|
+
[theme] button[pagination-link],
|
|
99682
|
+
[theme] [pagination-prev]:is(a, button),
|
|
99683
|
+
[theme] [pagination-next]:is(a, button) {
|
|
99684
|
+
appearance: none;
|
|
99685
|
+
-webkit-appearance: none;
|
|
99686
|
+
display: inline-flex;
|
|
99687
|
+
align-items: center;
|
|
99688
|
+
justify-content: center;
|
|
99689
|
+
box-sizing: border-box;
|
|
99690
|
+
min-width: 2.25rem;
|
|
99691
|
+
min-height: 2.25rem;
|
|
99692
|
+
margin: 0;
|
|
99693
|
+
padding: 0.25rem 0.65rem;
|
|
99694
|
+
border: 1px solid var(--juice-pagination-border, var(--aqua-pagination-border, var(--kw-pagination-border, var(--cm-pagination-border, var(--tide-pagination-border, var(--jx-pagination-border, hsl(0, 0%, 85%)))))));
|
|
99695
|
+
border-radius: 0.375rem;
|
|
99696
|
+
background-color: var(--juice-pagination-surface, var(--aqua-pagination-surface, var(--kw-pagination-surface, var(--cm-pagination-surface, var(--tide-pagination-surface, var(--jx-pagination-surface, hsl(0, 0%, 100%)))))));
|
|
99697
|
+
background-image: none;
|
|
99698
|
+
box-shadow: none;
|
|
99699
|
+
transform: none;
|
|
99700
|
+
color: var(--juice-pagination-ink, var(--aqua-pagination-ink, var(--kw-pagination-ink, var(--cm-pagination-ink, var(--tide-pagination-ink, var(--jx-pagination-ink, hsl(0, 0%, 25%)))))));
|
|
99701
|
+
font: inherit;
|
|
99702
|
+
font-weight: 500;
|
|
99703
|
+
line-height: inherit;
|
|
99704
|
+
text-decoration: none;
|
|
99705
|
+
cursor: pointer;
|
|
99706
|
+
transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
|
|
99707
|
+
}
|
|
99708
|
+
|
|
99709
|
+
[pagination] :is(a, button):not([pagination-ellipsis]):not([pagination-status]):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99710
|
+
[pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99711
|
+
a[pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99712
|
+
button[pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99713
|
+
[pagination-prev]:is(a, button):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99714
|
+
[pagination-next]:is(a, button):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99715
|
+
[theme] [pagination] :is(a, button):not([pagination-ellipsis]):not([pagination-status]):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99716
|
+
[theme] [pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99717
|
+
[theme] a[pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99718
|
+
[theme] button[pagination-link]:hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99719
|
+
[theme] [pagination-prev]:is(a, button):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]),
|
|
99720
|
+
[theme] [pagination-next]:is(a, button):hover:not([aria-current=page]):not(:disabled):not([disabled]):not([aria-disabled=true]) {
|
|
99721
|
+
background-color: var(--juice-pagination-surface-hover, var(--aqua-pagination-surface-hover, var(--kw-pagination-surface-hover, var(--cm-pagination-surface-hover, var(--tide-pagination-surface-hover, var(--jx-pagination-surface-hover, hsl(0, 0%, 90%)))))));
|
|
99722
|
+
background-image: none;
|
|
99723
|
+
border-color: var(--juice-pagination-border, var(--aqua-pagination-border, var(--kw-pagination-border, var(--cm-pagination-border, var(--tide-pagination-border, var(--jx-pagination-border, hsl(0, 0%, 85%)))))));
|
|
99724
|
+
box-shadow: none;
|
|
99725
|
+
transform: none;
|
|
99726
|
+
color: var(--juice-pagination-ink-hover, var(--aqua-pagination-ink-hover, var(--kw-pagination-ink-hover, var(--cm-pagination-ink-hover, var(--tide-pagination-ink-hover, var(--jx-pagination-ink-hover, hsl(0, 0%, 15%)))))));
|
|
99727
|
+
text-decoration: none;
|
|
99728
|
+
}
|
|
99729
|
+
|
|
99730
|
+
[pagination] :is(a, button, [pagination-link])[aria-current=page],
|
|
99731
|
+
[pagination] [aria-current=page] :is(a, button, [pagination-link]),
|
|
99732
|
+
[pagination-link][aria-current=page],
|
|
99733
|
+
[theme] [pagination] :is(a, button, [pagination-link])[aria-current=page],
|
|
99734
|
+
[theme] [pagination] [aria-current=page] :is(a, button, [pagination-link]),
|
|
99735
|
+
[theme] [pagination-link][aria-current=page] {
|
|
99736
|
+
background-color: var(--juice-pagination-surface-current, var(--aqua-pagination-surface-current, var(--kw-pagination-surface-current, var(--cm-pagination-surface-current, var(--tide-pagination-surface-current, var(--jx-pagination-surface-current, hsl(0, 0%, 15%)))))));
|
|
99737
|
+
background-image: none;
|
|
99738
|
+
border-color: var(--juice-pagination-surface-current, var(--aqua-pagination-surface-current, var(--kw-pagination-surface-current, var(--cm-pagination-surface-current, var(--tide-pagination-surface-current, var(--jx-pagination-surface-current, hsl(0, 0%, 15%)))))));
|
|
99739
|
+
box-shadow: none;
|
|
99740
|
+
transform: none;
|
|
99741
|
+
color: var(--juice-pagination-ink-current, var(--aqua-pagination-ink-current, var(--kw-pagination-ink-current, var(--cm-pagination-ink-current, var(--tide-pagination-ink-current, var(--jx-pagination-ink-current, hsl(0, 0%, 100%)))))));
|
|
99742
|
+
font-weight: 600;
|
|
99743
|
+
text-decoration: none;
|
|
99744
|
+
cursor: default;
|
|
99745
|
+
}
|
|
99746
|
+
|
|
99747
|
+
[pagination] :is(a, button, [pagination-link])[aria-current=page]:hover,
|
|
99748
|
+
[pagination] [aria-current=page] :is(a, button, [pagination-link]):hover,
|
|
99749
|
+
[pagination-link][aria-current=page]:hover,
|
|
99750
|
+
[theme] [pagination] :is(a, button, [pagination-link])[aria-current=page]:hover,
|
|
99751
|
+
[theme] [pagination] [aria-current=page] :is(a, button, [pagination-link]):hover,
|
|
99752
|
+
[theme] [pagination-link][aria-current=page]:hover {
|
|
99753
|
+
background-color: var(--juice-pagination-surface-current, var(--aqua-pagination-surface-current, var(--kw-pagination-surface-current, var(--cm-pagination-surface-current, var(--tide-pagination-surface-current, var(--jx-pagination-surface-current, hsl(0, 0%, 15%)))))));
|
|
99754
|
+
background-image: none;
|
|
99755
|
+
border-color: var(--juice-pagination-surface-current, var(--aqua-pagination-surface-current, var(--kw-pagination-surface-current, var(--cm-pagination-surface-current, var(--tide-pagination-surface-current, var(--jx-pagination-surface-current, hsl(0, 0%, 15%)))))));
|
|
99756
|
+
box-shadow: none;
|
|
99757
|
+
transform: none;
|
|
99758
|
+
color: var(--juice-pagination-ink-current, var(--aqua-pagination-ink-current, var(--kw-pagination-ink-current, var(--cm-pagination-ink-current, var(--tide-pagination-ink-current, var(--jx-pagination-ink-current, hsl(0, 0%, 100%)))))));
|
|
99759
|
+
text-decoration: none;
|
|
99760
|
+
}
|
|
99761
|
+
|
|
99762
|
+
[pagination] :is(a, button, [pagination-link], [pagination-prev], [pagination-next]):is(:disabled, [disabled], [aria-disabled=true]),
|
|
99763
|
+
[pagination] [aria-disabled=true] :is(a, button, [pagination-link]),
|
|
99764
|
+
[pagination-link]:is(:disabled, [disabled], [aria-disabled=true]),
|
|
99765
|
+
[theme] [pagination] :is(a, button, [pagination-link], [pagination-prev], [pagination-next]):is(:disabled, [disabled], [aria-disabled=true]),
|
|
99766
|
+
[theme] [pagination] [aria-disabled=true] :is(a, button, [pagination-link]),
|
|
99767
|
+
[theme] [pagination-link]:is(:disabled, [disabled], [aria-disabled=true]) {
|
|
99768
|
+
background-color: var(--juice-pagination-surface, var(--aqua-pagination-surface, var(--kw-pagination-surface, var(--cm-pagination-surface, var(--tide-pagination-surface, var(--jx-pagination-surface, hsl(0, 0%, 100%)))))));
|
|
99769
|
+
background-image: none;
|
|
99770
|
+
border-color: var(--juice-pagination-border, var(--aqua-pagination-border, var(--kw-pagination-border, var(--cm-pagination-border, var(--tide-pagination-border, var(--jx-pagination-border, hsl(0, 0%, 85%)))))));
|
|
99771
|
+
box-shadow: none;
|
|
99772
|
+
transform: none;
|
|
99773
|
+
color: var(--juice-pagination-ink-disabled, var(--aqua-pagination-ink-disabled, var(--kw-pagination-ink-disabled, var(--cm-pagination-ink-disabled, var(--tide-pagination-ink-disabled, var(--jx-pagination-ink-disabled, hsl(0, 0%, 65%)))))));
|
|
99774
|
+
font-weight: 500;
|
|
99775
|
+
text-decoration: none;
|
|
99776
|
+
cursor: not-allowed;
|
|
99777
|
+
}
|
|
99778
|
+
|
|
99779
|
+
[pagination] :is(a, button, [pagination-link], [pagination-prev], [pagination-next]):is(:disabled, [disabled], [aria-disabled=true]):hover,
|
|
99780
|
+
[pagination] [aria-disabled=true] :is(a, button, [pagination-link]):hover,
|
|
99781
|
+
[pagination-link]:is(:disabled, [disabled], [aria-disabled=true]):hover,
|
|
99782
|
+
[theme] [pagination] :is(a, button, [pagination-link], [pagination-prev], [pagination-next]):is(:disabled, [disabled], [aria-disabled=true]):hover,
|
|
99783
|
+
[theme] [pagination] [aria-disabled=true] :is(a, button, [pagination-link]):hover,
|
|
99784
|
+
[theme] [pagination-link]:is(:disabled, [disabled], [aria-disabled=true]):hover {
|
|
99785
|
+
background-color: var(--juice-pagination-surface, var(--aqua-pagination-surface, var(--kw-pagination-surface, var(--cm-pagination-surface, var(--tide-pagination-surface, var(--jx-pagination-surface, hsl(0, 0%, 100%)))))));
|
|
99786
|
+
background-image: none;
|
|
99787
|
+
border-color: var(--juice-pagination-border, var(--aqua-pagination-border, var(--kw-pagination-border, var(--cm-pagination-border, var(--tide-pagination-border, var(--jx-pagination-border, hsl(0, 0%, 85%)))))));
|
|
99788
|
+
box-shadow: none;
|
|
99789
|
+
transform: none;
|
|
99790
|
+
color: var(--juice-pagination-ink-disabled, var(--aqua-pagination-ink-disabled, var(--kw-pagination-ink-disabled, var(--cm-pagination-ink-disabled, var(--tide-pagination-ink-disabled, var(--jx-pagination-ink-disabled, hsl(0, 0%, 65%)))))));
|
|
99791
|
+
text-decoration: none;
|
|
99792
|
+
}
|
|
99793
|
+
|
|
99794
|
+
[pagination] :is(a, button):focus-visible,
|
|
99795
|
+
[pagination-link]:focus-visible,
|
|
99796
|
+
a[pagination-link]:focus-visible,
|
|
99797
|
+
button[pagination-link]:focus-visible,
|
|
99798
|
+
[pagination-prev]:is(a, button):focus-visible,
|
|
99799
|
+
[pagination-next]:is(a, button):focus-visible,
|
|
99800
|
+
[theme] [pagination] :is(a, button):focus-visible,
|
|
99801
|
+
[theme] [pagination-link]:focus-visible,
|
|
99802
|
+
[theme] a[pagination-link]:focus-visible,
|
|
99803
|
+
[theme] button[pagination-link]:focus-visible,
|
|
99804
|
+
[theme] [pagination-prev]:is(a, button):focus-visible,
|
|
99805
|
+
[theme] [pagination-next]:is(a, button):focus-visible {
|
|
99806
|
+
outline: 2px solid var(--juice-pagination-focus-ring, var(--aqua-pagination-focus-ring, var(--kw-pagination-focus-ring, var(--cm-pagination-focus-ring, var(--tide-pagination-focus-ring, var(--jx-pagination-focus-ring, currentColor))))));
|
|
99807
|
+
outline-offset: 2px;
|
|
99808
|
+
}
|
|
99809
|
+
|
|
99810
|
+
[pagination-ellipsis],
|
|
99811
|
+
[theme] [pagination-ellipsis] {
|
|
99812
|
+
display: inline-flex;
|
|
99813
|
+
align-items: center;
|
|
99814
|
+
justify-content: center;
|
|
99815
|
+
min-width: 1.5rem;
|
|
99816
|
+
margin: 0;
|
|
99817
|
+
padding: 0 0.15rem;
|
|
99818
|
+
border: none;
|
|
99819
|
+
background-color: transparent;
|
|
99820
|
+
background-image: none;
|
|
99821
|
+
box-shadow: none;
|
|
99822
|
+
color: var(--juice-pagination-ellipsis, var(--aqua-pagination-ellipsis, var(--kw-pagination-ellipsis, var(--cm-pagination-ellipsis, var(--tide-pagination-ellipsis, var(--jx-pagination-ellipsis, hsl(0, 0%, 65%)))))));
|
|
99823
|
+
font: inherit;
|
|
99824
|
+
line-height: inherit;
|
|
99825
|
+
-webkit-user-select: none;
|
|
99826
|
+
user-select: none;
|
|
99827
|
+
pointer-events: none;
|
|
99828
|
+
}
|
|
99829
|
+
|
|
99830
|
+
[pagination-status],
|
|
99831
|
+
[theme] [pagination-status] {
|
|
99832
|
+
display: inline-flex;
|
|
99833
|
+
align-items: center;
|
|
99834
|
+
margin: 0;
|
|
99835
|
+
padding: 0;
|
|
99836
|
+
border: none;
|
|
99837
|
+
background-color: transparent;
|
|
99838
|
+
background-image: none;
|
|
99839
|
+
box-shadow: none;
|
|
99840
|
+
color: var(--juice-pagination-ink, var(--aqua-pagination-ink, var(--kw-pagination-ink, var(--cm-pagination-ink, var(--tide-pagination-ink, var(--jx-pagination-ink, hsl(0, 0%, 25%)))))));
|
|
99841
|
+
font: inherit;
|
|
99842
|
+
line-height: inherit;
|
|
99843
|
+
}
|
|
99844
|
+
|
|
99845
|
+
@media (prefers-reduced-motion: reduce) {
|
|
99846
|
+
[pagination] :is(a, button),
|
|
99847
|
+
[pagination-link],
|
|
99848
|
+
[theme] [pagination] :is(a, button),
|
|
99849
|
+
[theme] [pagination-link] {
|
|
99850
|
+
transition: none;
|
|
99851
|
+
}
|
|
99852
|
+
}
|
|
99613
99853
|
[progress],
|
|
99614
99854
|
[theme] [progress] {
|
|
99615
99855
|
display: grid;
|
package/dist/index.d.ts
CHANGED
|
@@ -35,4 +35,6 @@ export { createBreadcrumb, initBreadcrumb, startBreadcrumbRuntime, stopBreadcrum
|
|
|
35
35
|
export type { BreadcrumbController, BreadcrumbOptions } from "./js/src/breadcrumb/breadcrumb-runtime.js";
|
|
36
36
|
export { createProgress, initProgress, startProgressRuntime, stopProgressRuntime } from "./js/src/progress/progress-runtime.js";
|
|
37
37
|
export type { ProgressController, ProgressOptions } from "./js/src/progress/progress-runtime.js";
|
|
38
|
+
export { createPagination, initPagination, startPaginationRuntime, stopPaginationRuntime } from "./js/src/pagination/pagination-runtime.js";
|
|
39
|
+
export type { PaginationController, PaginationOptions } from "./js/src/pagination/pagination-runtime.js";
|
|
38
40
|
export { tokens } from "./tokens/index.js";
|
package/dist/index.js
CHANGED
|
@@ -3695,8 +3695,214 @@ typeof window < "u" && typeof document < "u" && (document.readyState === "loadin
|
|
|
3695
3695
|
fo = null, uo || mo();
|
|
3696
3696
|
}, document.addEventListener("DOMContentLoaded", fo)) : mo());
|
|
3697
3697
|
//#endregion
|
|
3698
|
-
//#region src/
|
|
3698
|
+
//#region src/js/src/pagination/pagination-runtime.ts
|
|
3699
3699
|
var go = {
|
|
3700
|
+
root: typeof document < "u" ? document : {},
|
|
3701
|
+
paginationSelector: "[pagination]",
|
|
3702
|
+
itemSelector: "[pagination-item]"
|
|
3703
|
+
}, _o = new Set([
|
|
3704
|
+
"OL",
|
|
3705
|
+
"UL",
|
|
3706
|
+
"MENU"
|
|
3707
|
+
]), vo = new Set(["ArrowRight", "ArrowDown"]), yo = new Set(["ArrowLeft", "ArrowUp"]), bo = "a, button, [pagination-link]", xo = (e) => Array.from(e), So = A(), Co = /* @__PURE__ */ new WeakSet(), wo = /* @__PURE__ */ new WeakSet(), To = (e) => {
|
|
3708
|
+
let t = e.getAttribute("aria-label");
|
|
3709
|
+
if (t !== null && t.trim() !== "") return !0;
|
|
3710
|
+
let n = e.getAttribute("aria-labelledby");
|
|
3711
|
+
if (n !== null && n.trim() !== "") return !0;
|
|
3712
|
+
let r = e.getAttribute("title");
|
|
3713
|
+
return r !== null && r.trim() !== "";
|
|
3714
|
+
}, Eo = (e) => {
|
|
3715
|
+
let t = e.getAttribute("role");
|
|
3716
|
+
return t ? t === "navigation" : e.tagName === "NAV";
|
|
3717
|
+
}, Do = (e) => e instanceof HTMLElement ? e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement ? !0 : e.isContentEditable : !1, Oo = (e) => e.getAttribute("aria-disabled") === "true" || e instanceof HTMLButtonElement && e.disabled || e instanceof HTMLInputElement && e.disabled ? !0 : e.hasAttribute("disabled"), ko = (e) => {
|
|
3718
|
+
let t = [e.textContent, e.getAttribute("aria-label")];
|
|
3719
|
+
for (let e of t) {
|
|
3720
|
+
let t = e?.trim() ?? "";
|
|
3721
|
+
if (/^\d+$/.test(t)) return Number(t);
|
|
3722
|
+
}
|
|
3723
|
+
return null;
|
|
3724
|
+
}, Ao = () => ({
|
|
3725
|
+
destroy: () => {},
|
|
3726
|
+
sync: () => {},
|
|
3727
|
+
setCurrent: () => {}
|
|
3728
|
+
}), jo = (e = {}) => {
|
|
3729
|
+
if (typeof window > "u" || typeof document > "u") return Ao();
|
|
3730
|
+
let t = {
|
|
3731
|
+
...go,
|
|
3732
|
+
...e
|
|
3733
|
+
}, n = t.root ?? document, r = n, i = [
|
|
3734
|
+
t.itemSelector,
|
|
3735
|
+
"[pagination-prev]",
|
|
3736
|
+
"[pagination-next]",
|
|
3737
|
+
"[pagination-ellipsis]",
|
|
3738
|
+
"[pagination-status]",
|
|
3739
|
+
"[pagination-link]",
|
|
3740
|
+
"a",
|
|
3741
|
+
"button"
|
|
3742
|
+
].join(", "), a = (e) => e?.matches(t.paginationSelector) ? n instanceof Document ? !0 : n instanceof Node ? n === e || n.contains(e) : !1 : !1, o = () => {
|
|
3743
|
+
let e = xo(n.querySelectorAll(t.paginationSelector)).filter(a);
|
|
3744
|
+
return n instanceof HTMLElement && a(n) ? [n, ...e] : e;
|
|
3745
|
+
}, s = (e, n) => n.closest(t.paginationSelector) === e, c = (e, t, n) => {
|
|
3746
|
+
if (t.matches(n)) return !0;
|
|
3747
|
+
let r = t.querySelector(n);
|
|
3748
|
+
return !!(r && s(e, r));
|
|
3749
|
+
}, l = (e, t) => c(e, t, "[pagination-ellipsis]") ? "ellipsis" : c(e, t, "[pagination-status]") ? "status" : c(e, t, "[pagination-prev]") ? "prev" : c(e, t, "[pagination-next]") ? "next" : "page", u = (e, t) => t.matches(bo) && !t.matches("[pagination-ellipsis], [pagination-status]") ? t : xo(t.querySelectorAll(bo)).find((t) => s(e, t) && !t.closest("[pagination-ellipsis], [pagination-status]")) ?? t, d = (e) => {
|
|
3750
|
+
let t = xo(e.querySelectorAll(i)).filter((t) => s(e, t)), n = [];
|
|
3751
|
+
return t.forEach((t) => {
|
|
3752
|
+
n.some((e) => e.element.contains(t)) || n.push({
|
|
3753
|
+
element: t,
|
|
3754
|
+
kind: l(e, t),
|
|
3755
|
+
target: u(e, t)
|
|
3756
|
+
});
|
|
3757
|
+
}), n;
|
|
3758
|
+
}, f = (e) => {
|
|
3759
|
+
let t = xo(e.querySelectorAll("[aria-current=\"page\"]")).filter((t) => s(e, t));
|
|
3760
|
+
return e.getAttribute("aria-current") === "page" ? [e, ...t] : t;
|
|
3761
|
+
}, p = (e) => {
|
|
3762
|
+
e.getAttribute("aria-current") !== "page" && e.setAttribute("aria-current", "page");
|
|
3763
|
+
}, m = (e, t) => {
|
|
3764
|
+
f(e).forEach((e) => {
|
|
3765
|
+
e !== t && e.removeAttribute("aria-current");
|
|
3766
|
+
});
|
|
3767
|
+
}, h = (e) => {
|
|
3768
|
+
let t = e.getAttribute("role"), n = _o.has(e.tagName);
|
|
3769
|
+
!t && !n && e.tagName !== "NAV" && e.setAttribute("role", "navigation"), Eo(e) && !To(e) && e.setAttribute("aria-label", "Pagination");
|
|
3770
|
+
}, g = (e) => Oo(e.target) || e.element !== e.target && Oo(e.element), _ = (e) => {
|
|
3771
|
+
let t = e.target;
|
|
3772
|
+
if (!Co.has(t)) {
|
|
3773
|
+
if (wo.has(t)) {
|
|
3774
|
+
g(e) || wo.delete(t);
|
|
3775
|
+
return;
|
|
3776
|
+
}
|
|
3777
|
+
g(e) && wo.add(t);
|
|
3778
|
+
}
|
|
3779
|
+
}, v = (e, t) => {
|
|
3780
|
+
if (!wo.has(e)) {
|
|
3781
|
+
if (t) {
|
|
3782
|
+
Co.add(e), e.getAttribute("aria-disabled") !== "true" && e.setAttribute("aria-disabled", "true"), e instanceof HTMLButtonElement && !e.disabled && (e.disabled = !0);
|
|
3783
|
+
return;
|
|
3784
|
+
}
|
|
3785
|
+
Co.has(e) && (Co.delete(e), e.getAttribute("aria-disabled") === "true" && e.removeAttribute("aria-disabled"), e instanceof HTMLButtonElement && e.disabled && (e.disabled = !1));
|
|
3786
|
+
}
|
|
3787
|
+
}, y = (e, t) => {
|
|
3788
|
+
let n = f(e);
|
|
3789
|
+
if (n.length > 0) {
|
|
3790
|
+
m(e, n[0]);
|
|
3791
|
+
return;
|
|
3792
|
+
}
|
|
3793
|
+
let r = t.find((e) => e.kind === "page");
|
|
3794
|
+
r && p(r.target);
|
|
3795
|
+
}, b = (e, t) => {
|
|
3796
|
+
let n = t.filter((e) => e.kind === "page"), r = f(e)[0] ?? null, i = r ? n.find((e) => e.element === r || e.target === r || e.element.contains(r)) ?? null : null, a = !1, o = !1;
|
|
3797
|
+
if (i) {
|
|
3798
|
+
let e = t.indexOf(i), r = t.some((t, n) => t.kind === "ellipsis" && n < e), s = t.some((t, n) => t.kind === "ellipsis" && n > e);
|
|
3799
|
+
a = i === n[0] && !r, o = i === n[n.length - 1] && !s, (ko(i.target) === 1 || ko(i.element) === 1) && (a = !0);
|
|
3800
|
+
}
|
|
3801
|
+
let s = !!i;
|
|
3802
|
+
t.forEach((e) => {
|
|
3803
|
+
if (e.kind !== "prev" && e.kind !== "next") return;
|
|
3804
|
+
_(e);
|
|
3805
|
+
let t = s && (e.kind === "prev" ? a : o);
|
|
3806
|
+
v(e.target, t);
|
|
3807
|
+
});
|
|
3808
|
+
}, x = (e) => {
|
|
3809
|
+
if (!a(e)) return;
|
|
3810
|
+
h(e);
|
|
3811
|
+
let t = d(e);
|
|
3812
|
+
y(e, t), b(e, t);
|
|
3813
|
+
}, S = () => {
|
|
3814
|
+
o().forEach((e) => {
|
|
3815
|
+
x(e);
|
|
3816
|
+
});
|
|
3817
|
+
}, C = (e) => {
|
|
3818
|
+
if (e) {
|
|
3819
|
+
if (a(e)) return e;
|
|
3820
|
+
let n = e.closest(t.paginationSelector);
|
|
3821
|
+
return n instanceof HTMLElement && a(n) ? n : null;
|
|
3822
|
+
}
|
|
3823
|
+
return o()[0] ?? null;
|
|
3824
|
+
}, w = (e, t) => {
|
|
3825
|
+
let n = e instanceof HTMLElement ? e : null, r = C(t ?? n);
|
|
3826
|
+
if (!r) return;
|
|
3827
|
+
let i = d(r).filter((e) => e.kind === "page"), a = typeof e == "number" ? Number.isInteger(e) ? i[e] ?? null : null : i.find((t) => t.element === e || t.target === e || t.element.contains(e)) ?? null;
|
|
3828
|
+
if (!a || !r.contains(a.element)) return;
|
|
3829
|
+
let o = n && n !== a.element && a.element.contains(n) && n.matches(bo) ? n : a.target;
|
|
3830
|
+
m(r, o), p(o), x(r);
|
|
3831
|
+
}, T = (e) => {
|
|
3832
|
+
let t = /* @__PURE__ */ new Set();
|
|
3833
|
+
return d(e).filter((e) => e.kind !== "page" && e.kind !== "prev" && e.kind !== "next" || t.has(e.target) ? !1 : (t.add(e.target), !0));
|
|
3834
|
+
}, E = (e) => {
|
|
3835
|
+
let t = e.closest(bo);
|
|
3836
|
+
return !(t instanceof HTMLElement) || t.matches("[pagination-ellipsis], [pagination-status]") || t.closest("[pagination-ellipsis], [pagination-status]") ? null : t;
|
|
3837
|
+
}, D = (e) => {
|
|
3838
|
+
let n = e.target;
|
|
3839
|
+
if (!(n instanceof Element)) return;
|
|
3840
|
+
let r = E(n);
|
|
3841
|
+
if (!r) return;
|
|
3842
|
+
let i = r.closest(t.paginationSelector);
|
|
3843
|
+
if (!(i instanceof HTMLElement) || !a(i)) return;
|
|
3844
|
+
let o = d(i).find((e) => e.target === r);
|
|
3845
|
+
(Oo(r) || o && g(o)) && So(e) && e.preventDefault();
|
|
3846
|
+
}, O = (e) => {
|
|
3847
|
+
if (!(e instanceof KeyboardEvent) || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.defaultPrevented) return;
|
|
3848
|
+
let n = e.target;
|
|
3849
|
+
if (!(n instanceof Element) || Do(n)) return;
|
|
3850
|
+
let r = E(n);
|
|
3851
|
+
if (!r) return;
|
|
3852
|
+
let i = r.closest(t.paginationSelector);
|
|
3853
|
+
if (!(i instanceof HTMLElement) || !a(i)) return;
|
|
3854
|
+
let o = T(i), s = o.findIndex((e) => e.target === r);
|
|
3855
|
+
if (s < 0) return;
|
|
3856
|
+
let c = (e) => !g(e), l;
|
|
3857
|
+
if (e.key === "Home") l = o.find(c);
|
|
3858
|
+
else if (e.key === "End") l = [...o].reverse().find(c);
|
|
3859
|
+
else if (vo.has(e.key)) l = o.slice(s + 1).find(c);
|
|
3860
|
+
else if (yo.has(e.key)) l = o.slice(0, s).reverse().find(c);
|
|
3861
|
+
else return;
|
|
3862
|
+
So(e) && (e.preventDefault(), l && l.target !== r && l.target.focus());
|
|
3863
|
+
}, k = !1, A = !1, j = 0, M = () => {
|
|
3864
|
+
k || A || (A = !0, j = requestAnimationFrame(() => {
|
|
3865
|
+
A = !1, k || S();
|
|
3866
|
+
}));
|
|
3867
|
+
}, N = typeof MutationObserver < "u" ? new MutationObserver(() => M()) : null;
|
|
3868
|
+
return r.addEventListener("click", D), r.addEventListener("keydown", O), N && n instanceof Node && N.observe(n, {
|
|
3869
|
+
childList: !0,
|
|
3870
|
+
subtree: !0,
|
|
3871
|
+
attributes: !0,
|
|
3872
|
+
attributeFilter: [
|
|
3873
|
+
"pagination",
|
|
3874
|
+
"pagination-item",
|
|
3875
|
+
"pagination-link",
|
|
3876
|
+
"pagination-prev",
|
|
3877
|
+
"pagination-next",
|
|
3878
|
+
"pagination-ellipsis",
|
|
3879
|
+
"pagination-status",
|
|
3880
|
+
"aria-current",
|
|
3881
|
+
"aria-label",
|
|
3882
|
+
"aria-labelledby",
|
|
3883
|
+
"aria-disabled",
|
|
3884
|
+
"disabled",
|
|
3885
|
+
"role",
|
|
3886
|
+
"title"
|
|
3887
|
+
]
|
|
3888
|
+
}), S(), {
|
|
3889
|
+
destroy: () => {
|
|
3890
|
+
k = !0, A &&= (cancelAnimationFrame(j), !1), N?.disconnect(), r.removeEventListener("click", D), r.removeEventListener("keydown", O);
|
|
3891
|
+
},
|
|
3892
|
+
sync: S,
|
|
3893
|
+
setCurrent: w
|
|
3894
|
+
};
|
|
3895
|
+
}, Mo = (e = {}) => jo(e), No = null, Po = !1, Fo = null, Io = () => {
|
|
3896
|
+
!Fo || typeof document > "u" || (document.removeEventListener("DOMContentLoaded", Fo), Fo = null);
|
|
3897
|
+
}, Lo = () => typeof window > "u" || typeof document > "u" ? null : (Po = !1, Io(), No ? (No.sync(), No) : (No = jo(), No)), Ro = () => {
|
|
3898
|
+
Po = !0, Io(), No?.destroy(), No = null;
|
|
3899
|
+
};
|
|
3900
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Fo = () => {
|
|
3901
|
+
Fo = null, Po || Lo();
|
|
3902
|
+
}, document.addEventListener("DOMContentLoaded", Fo)) : Lo());
|
|
3903
|
+
//#endregion
|
|
3904
|
+
//#region src/tokens/index.ts
|
|
3905
|
+
var zo = {
|
|
3700
3906
|
colors: {
|
|
3701
3907
|
families: [
|
|
3702
3908
|
"black",
|
|
@@ -3864,4 +4070,4 @@ var go = {
|
|
|
3864
4070
|
themes: {}
|
|
3865
4071
|
};
|
|
3866
4072
|
//#endregion
|
|
3867
|
-
export { v as Accordion, te as createAccordion, Ar as createBanner, Va as createBreadcrumb, oa as createCheckbox, fr as createCombobox, $e as createDrawer, Xr as createMenu, Le as createModal, T as createNavigation, qt as createPopover, so as createProgress, Ea as createRadio, Hi as createSlider, mi as createSwitch, ge as createTabs, bt as createToast, xn as createTooltip, Hn as createWizard, ne as initAccordion, jr as initBanner, Ha as initBreadcrumb, sa as initCheckbox, pr as initCombobox, et as initDrawer, Zr as initMenu, Re as initModal, E as initNavigation, Jt as initPopover, co as initProgress, Da as initRadio, Ui as initSlider, hi as initSwitch, _e as initTabs, xt as initToast, Sn as initTooltip, Un as initWizard, oe as startAccordionRuntime, Ir as startBannerRuntime, qa as startBreadcrumbRuntime, fa as startCheckboxRuntime, vr as startComboboxRuntime, at as startDrawerRuntime, ni as startMenuRuntime, Ue as startModalRuntime, O as startNavigationRuntime, $t as startPopoverRuntime, mo as startProgressRuntime, Ma as startRadioRuntime, Ji as startSliderRuntime, bi as startSwitchRuntime, Se as startTabsRuntime, Et as startToastRuntime, Dn as startTooltipRuntime, Jn as startWizardRuntime, se as stopAccordionRuntime, Lr as stopBannerRuntime, Ja as stopBreadcrumbRuntime, pa as stopCheckboxRuntime, yr as stopComboboxRuntime, ot as stopDrawerRuntime, ri as stopMenuRuntime, We as stopModalRuntime, k as stopNavigationRuntime, en as stopPopoverRuntime, ho as stopProgressRuntime, Na as stopRadioRuntime, Yi as stopSliderRuntime, xi as stopSwitchRuntime, Ce as stopTabsRuntime, Dt as stopToastRuntime, On as stopTooltipRuntime, Yn as stopWizardRuntime,
|
|
4073
|
+
export { v as Accordion, te as createAccordion, Ar as createBanner, Va as createBreadcrumb, oa as createCheckbox, fr as createCombobox, $e as createDrawer, Xr as createMenu, Le as createModal, T as createNavigation, jo as createPagination, qt as createPopover, so as createProgress, Ea as createRadio, Hi as createSlider, mi as createSwitch, ge as createTabs, bt as createToast, xn as createTooltip, Hn as createWizard, ne as initAccordion, jr as initBanner, Ha as initBreadcrumb, sa as initCheckbox, pr as initCombobox, et as initDrawer, Zr as initMenu, Re as initModal, E as initNavigation, Mo as initPagination, Jt as initPopover, co as initProgress, Da as initRadio, Ui as initSlider, hi as initSwitch, _e as initTabs, xt as initToast, Sn as initTooltip, Un as initWizard, oe as startAccordionRuntime, Ir as startBannerRuntime, qa as startBreadcrumbRuntime, fa as startCheckboxRuntime, vr as startComboboxRuntime, at as startDrawerRuntime, ni as startMenuRuntime, Ue as startModalRuntime, O as startNavigationRuntime, Lo as startPaginationRuntime, $t as startPopoverRuntime, mo as startProgressRuntime, Ma as startRadioRuntime, Ji as startSliderRuntime, bi as startSwitchRuntime, Se as startTabsRuntime, Et as startToastRuntime, Dn as startTooltipRuntime, Jn as startWizardRuntime, se as stopAccordionRuntime, Lr as stopBannerRuntime, Ja as stopBreadcrumbRuntime, pa as stopCheckboxRuntime, yr as stopComboboxRuntime, ot as stopDrawerRuntime, ri as stopMenuRuntime, We as stopModalRuntime, k as stopNavigationRuntime, Ro as stopPaginationRuntime, en as stopPopoverRuntime, ho as stopProgressRuntime, Na as stopRadioRuntime, Yi as stopSliderRuntime, xi as stopSwitchRuntime, Ce as stopTabsRuntime, Dt as stopToastRuntime, On as stopTooltipRuntime, Yn as stopWizardRuntime, zo as tokens };
|
package/dist/js/juice.d.ts
CHANGED
|
@@ -34,3 +34,5 @@ export { createBreadcrumb, initBreadcrumb, startBreadcrumbRuntime, stopBreadcrum
|
|
|
34
34
|
export type { BreadcrumbController, BreadcrumbOptions } from "./src/breadcrumb/breadcrumb-runtime.js";
|
|
35
35
|
export { createProgress, initProgress, startProgressRuntime, stopProgressRuntime } from "./src/progress/progress-runtime.js";
|
|
36
36
|
export type { ProgressController, ProgressOptions } from "./src/progress/progress-runtime.js";
|
|
37
|
+
export { createPagination, initPagination, startPaginationRuntime, stopPaginationRuntime } from "./src/pagination/pagination-runtime.js";
|
|
38
|
+
export type { PaginationController, PaginationOptions } from "./src/pagination/pagination-runtime.js";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first pagination runtime for Juice pagination chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [pagination] page-set root. Authors use <nav pagination> or
|
|
6
|
+
* <ol pagination>.
|
|
7
|
+
* [pagination-item] one cell. Layout only.
|
|
8
|
+
* [pagination-link] optional. Anchors and buttons inside the control
|
|
9
|
+
* are enough.
|
|
10
|
+
* [pagination-prev] / [pagination-next]
|
|
11
|
+
* previous and next controls. The attr may sit on
|
|
12
|
+
* the anchor or button, or on the item that wraps it.
|
|
13
|
+
* [pagination-ellipsis]
|
|
14
|
+
* optional gap marker. Not a page control.
|
|
15
|
+
* [pagination-status]
|
|
16
|
+
* optional "Page 2 of 12" text. Not a page control.
|
|
17
|
+
* Ends are not parsed from this text.
|
|
18
|
+
*
|
|
19
|
+
* This is chrome, not a router. It does not remove href, listen to
|
|
20
|
+
* history, trap focus, or handle Escape. It is not a layered overlay.
|
|
21
|
+
*
|
|
22
|
+
* Sync (markup-driven):
|
|
23
|
+
* 1. Make the root a navigation landmark only when that is safe.
|
|
24
|
+
* Same rules as breadcrumb:
|
|
25
|
+
* - <nav> is already a landmark. Do not add a redundant
|
|
26
|
+
* role="navigation".
|
|
27
|
+
* - An element with no role that is not a list (ol / ul / menu)
|
|
28
|
+
* gets role="navigation". role="navigation" on a list would
|
|
29
|
+
* drop the list semantics, so <ol pagination> is left alone.
|
|
30
|
+
* - An author role is never overwritten.
|
|
31
|
+
* - Ancestor <nav> elements are not relabeled.
|
|
32
|
+
* 2. Name that landmark only when it has no accessible name.
|
|
33
|
+
* When the root is a navigation landmark and aria-label,
|
|
34
|
+
* aria-labelledby, and title are all missing or blank, sync sets
|
|
35
|
+
* aria-label="Pagination". A non-empty author name is kept.
|
|
36
|
+
* Lists and other non-navigation roots are not given that label.
|
|
37
|
+
* 3. Keep exactly one aria-current="page" inside the root when the
|
|
38
|
+
* set has a page control.
|
|
39
|
+
* Page controls are owned cells and links that are not prev,
|
|
40
|
+
* next, ellipsis, or status. If the author already set
|
|
41
|
+
* aria-current="page", the first one in tree order stays and any
|
|
42
|
+
* others in this root are removed. If none is set, the first page
|
|
43
|
+
* control is marked (on its link when it has one). A set with no
|
|
44
|
+
* page control is left without a current page.
|
|
45
|
+
* 4. Sync prev/next disabled at the ends when that is inferable.
|
|
46
|
+
* Inference uses page controls plus optional ellipsis, not status
|
|
47
|
+
* text. Prev is disabled when the current page is the first page
|
|
48
|
+
* control and no ellipsis sits before it, or when that control's
|
|
49
|
+
* text is page 1. Next is disabled when the current page is the
|
|
50
|
+
* last page control and no ellipsis sits after it. Author-owned
|
|
51
|
+
* disabled (aria-disabled="true", native disabled, or [disabled]
|
|
52
|
+
* already present before this runtime wrote it) is never cleared.
|
|
53
|
+
* Runtime-owned disabled is aria-disabled="true", and disabled on
|
|
54
|
+
* buttons so they do not activate.
|
|
55
|
+
*
|
|
56
|
+
* Keyboard (conservative): ArrowLeft / ArrowUp and ArrowRight /
|
|
57
|
+
* ArrowDown move focus to the previous or next enabled control. Home /
|
|
58
|
+
* End move to the first or last enabled control. Disabled controls are
|
|
59
|
+
* skipped. Focus does not wrap. Enter and Space are left to the
|
|
60
|
+
* browser. A disabled link's click is cancelled so it does not navigate.
|
|
61
|
+
*
|
|
62
|
+
* setCurrent(item | index, pagination?) moves that single current. An
|
|
63
|
+
* index applies to page controls only (prev / next are not pages), on
|
|
64
|
+
* the given root, or the first root when omitted. It is not navigation.
|
|
65
|
+
*/
|
|
66
|
+
export type PaginationOptions = {
|
|
67
|
+
root?: ParentNode;
|
|
68
|
+
paginationSelector?: string;
|
|
69
|
+
itemSelector?: string;
|
|
70
|
+
};
|
|
71
|
+
export type PaginationController = {
|
|
72
|
+
destroy: () => void;
|
|
73
|
+
sync: () => void;
|
|
74
|
+
setCurrent: (itemOrIndex: HTMLElement | number, pagination?: HTMLElement | null) => void;
|
|
75
|
+
};
|
|
76
|
+
export declare const createPagination: (options?: PaginationOptions) => PaginationController;
|
|
77
|
+
export declare const initPagination: (options?: PaginationOptions) => PaginationController;
|
|
78
|
+
export declare const startPaginationRuntime: () => PaginationController | null;
|
|
79
|
+
export declare const stopPaginationRuntime: () => void;
|