@gunkin/uiify 0.0.13-alpha → 0.0.15-alpha
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 -0
- package/agents/components.md +79 -0
- package/agents/index.md +173 -0
- package/agents/reference/components/accordion.md +35 -0
- package/agents/reference/components/alert-modal.md +63 -0
- package/agents/reference/components/breadcrumb.md +72 -0
- package/agents/reference/components/button.md +40 -0
- package/agents/reference/components/candle-chart.md +107 -0
- package/agents/reference/components/carousel.md +274 -0
- package/agents/reference/components/checkbox.md +32 -0
- package/agents/reference/components/collapsible.md +26 -0
- package/agents/reference/components/color-picker.md +33 -0
- package/agents/reference/components/combobox.md +193 -0
- package/agents/reference/components/context-menu.md +129 -0
- package/agents/reference/components/drawer.md +215 -0
- package/agents/reference/components/dropdown-menu.md +178 -0
- package/agents/reference/components/field.md +76 -0
- package/agents/reference/components/file-upload.md +131 -0
- package/agents/reference/components/form.md +28 -0
- package/agents/reference/components/header.md +44 -0
- package/agents/reference/components/hover-card.md +54 -0
- package/agents/reference/components/input.md +29 -0
- package/agents/reference/components/line-chart.md +104 -0
- package/agents/reference/components/modal.md +106 -0
- package/agents/reference/components/number-field.md +60 -0
- package/agents/reference/components/otp-input.md +68 -0
- package/agents/reference/components/pagination.md +112 -0
- package/agents/reference/components/popup.md +111 -0
- package/agents/reference/components/radio-group.md +37 -0
- package/agents/reference/components/rating.md +43 -0
- package/agents/reference/components/segmented-control.md +51 -0
- package/agents/reference/components/select.md +60 -0
- package/agents/reference/components/skeleton.md +29 -0
- package/agents/reference/components/slider.md +71 -0
- package/agents/reference/components/spinner.md +34 -0
- package/agents/reference/components/switch.md +27 -0
- package/agents/reference/components/table.md +189 -0
- package/agents/reference/components/tabs.md +42 -0
- package/agents/reference/components/tags-input.md +123 -0
- package/agents/reference/components/textarea.md +31 -0
- package/agents/reference/components/toast.md +151 -0
- package/agents/reference/components/toggle-group.md +50 -0
- package/agents/reference/components/toggle.md +26 -0
- package/agents/reference/components/toolbar.md +69 -0
- package/agents/reference/components/tooltip.md +76 -0
- package/agents/reference/components/virtual-scroll.md +97 -0
- package/agents/reference/elements/choice.md +55 -0
- package/agents/reference/elements/details.md +45 -0
- package/agents/reference/elements/dialog.md +43 -0
- package/agents/reference/elements/invoker.md +28 -0
- package/agents/reference/elements/popover.md +53 -0
- package/dist/components/alert-modal/AlertModalParts.js +1 -1
- package/dist/components/alert-modal/AlertModalParts.js.map +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +5 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/types.d.ts +5 -2
- package/dist/components/button/types.d.ts.map +1 -1
- package/dist/components/carousel/CarouselMarkup.d.ts.map +1 -1
- package/dist/components/carousel/CarouselMarkup.js +8 -0
- package/dist/components/carousel/CarouselMarkup.js.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.d.ts.map +1 -1
- package/dist/components/internal/choice-family/ChoiceGroup.js +2 -3
- package/dist/components/internal/choice-family/ChoiceGroup.js.map +1 -1
- package/dist/components/internal/choice-family/types.d.ts +2 -2
- package/dist/components/internal/choice-family/types.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +11 -0
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/PaginationShell.d.ts.map +1 -1
- package/dist/components/pagination/PaginationShell.js +26 -1
- package/dist/components/pagination/PaginationShell.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.js +1 -0
- package/dist/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/components/segmented-control/client/SegmentedControlClient.d.ts.map +1 -1
- package/dist/components/segmented-control/client/SegmentedControlClient.js +1 -0
- package/dist/components/segmented-control/client/SegmentedControlClient.js.map +1 -1
- package/dist/components/toggle/Toggle.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.js +12 -1
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroup.d.ts +1 -1
- package/dist/components/toggle-group/ToggleGroup.d.ts.map +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +6 -0
- package/dist/components/toggle-group/ToggleGroup.js.map +1 -1
- package/dist/components/toggle-group/client/ToggleGroupClient.d.ts +1 -1
- package/dist/components/toggle-group/client/ToggleGroupClient.d.ts.map +1 -1
- package/dist/components/toggle-group/client/ToggleGroupClient.js +19 -4
- package/dist/components/toggle-group/client/ToggleGroupClient.js.map +1 -1
- package/dist/components/toggle-group/types.d.ts +3 -2
- package/dist/components/toggle-group/types.d.ts.map +1 -1
- package/dist/components/toolbar/ToolbarShell.d.ts.map +1 -1
- package/dist/components/toolbar/ToolbarShell.js +5 -1
- package/dist/components/toolbar/ToolbarShell.js.map +1 -1
- package/dist/components/toolbar/types.d.ts +2 -0
- package/dist/components/toolbar/types.d.ts.map +1 -1
- package/dist/core/render-native-invoker.d.ts +1 -1
- package/dist/core/render-native-invoker.d.ts.map +1 -1
- package/dist/core/render-native-invoker.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!-- Generated from the package source. Do not edit by hand. -->
|
|
2
|
+
# details
|
|
3
|
+
|
|
4
|
+
- Import: `@gunkin/uiify/elements/details`
|
|
5
|
+
- Native mechanism: details/summary
|
|
6
|
+
- Parts: `Details.Root`, `Details.Summary`, `Details.Content`
|
|
7
|
+
- Used by: accordion, collapsible, breadcrumb
|
|
8
|
+
- Types file: `dist/elements/details.d.ts`
|
|
9
|
+
|
|
10
|
+
## Exports
|
|
11
|
+
|
|
12
|
+
- Runtime: `Details`, `DetailsContent`, `DetailsRoot`, `DetailsSummary`
|
|
13
|
+
- Types: `DetailsContentOwnProps`, `DetailsContentProps`, `DetailsRootOwnProps`, `DetailsRootProps`, `DetailsSummaryOwnProps`, `DetailsSummaryProps`
|
|
14
|
+
|
|
15
|
+
## Props and shapes
|
|
16
|
+
|
|
17
|
+
### DetailsRootOwnProps
|
|
18
|
+
|
|
19
|
+
| Member | Type | Required | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `children` | `ReactNode` | no | |
|
|
22
|
+
| `defaultOpen` | `boolean` | no | Applies the native `open` attribute on first render. |
|
|
23
|
+
| `name` | `string` | no | Groups sibling `<details name>` into an exclusive, single-open set — the browser enforces it, no JS. Must be unique per group and stable across SSR. |
|
|
24
|
+
| `disabled` | `boolean` | no | |
|
|
25
|
+
|
|
26
|
+
### DetailsSummaryOwnProps
|
|
27
|
+
|
|
28
|
+
| Member | Type | Required | Description |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| `children` | `ReactNode` | no | |
|
|
31
|
+
| `disabled` | `boolean` | no | |
|
|
32
|
+
| `part` | `string` | no | `data-part` value on the rendered `<summary>`; omitted entirely when not given. |
|
|
33
|
+
|
|
34
|
+
### DetailsContentOwnProps
|
|
35
|
+
|
|
36
|
+
| Member | Type | Required | Description |
|
|
37
|
+
| --- | --- | --- | --- |
|
|
38
|
+
| `children` | `ReactNode` | no | |
|
|
39
|
+
| `part` | `string` | no | `data-part` value on the rendered element; omitted entirely when not given. |
|
|
40
|
+
|
|
41
|
+
## Other types
|
|
42
|
+
|
|
43
|
+
- `DetailsRootProps`: `DetailsRootOwnProps & Omit<ComponentPropsWithRef<"details">, keyof DetailsRootOwnProps | "open">` — `open` is not part of the contract — use `defaultOpen`; the browser owns state after that.
|
|
44
|
+
- `DetailsSummaryProps`: `DetailsSummaryOwnProps & Omit<ComponentPropsWithRef<"summary">, keyof DetailsSummaryOwnProps>`
|
|
45
|
+
- `DetailsContentProps<TAs>`: `RenderableProps<TAs, DetailsContentOwnProps, Record<string, never>, HTMLElement>`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated from the package source. Do not edit by hand. -->
|
|
2
|
+
# dialog
|
|
3
|
+
|
|
4
|
+
- Import: `@gunkin/uiify/elements/dialog`
|
|
5
|
+
- Native mechanism: dialog + command=show-modal
|
|
6
|
+
- Parts: `Dialog.Trigger`, `Dialog.Content`, `Dialog.Close`
|
|
7
|
+
- Used by: modal, alert-modal, drawer
|
|
8
|
+
- Types file: `dist/elements/dialog.d.ts`
|
|
9
|
+
|
|
10
|
+
## Exports
|
|
11
|
+
|
|
12
|
+
- Runtime: `Dialog`, `DialogClose`, `DialogContent`, `DialogTrigger`
|
|
13
|
+
- Types: `DialogCloseOwnProps`, `DialogCloseProps`, `DialogContentNameProps`, `DialogContentOwnProps`, `DialogContentProps`, `DialogTriggerOwnProps`, `DialogTriggerProps`
|
|
14
|
+
|
|
15
|
+
## Props and shapes
|
|
16
|
+
|
|
17
|
+
### DialogTriggerOwnProps
|
|
18
|
+
|
|
19
|
+
| Member | Type | Required | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `children` | `ReactNode` | no | |
|
|
22
|
+
| `target` | `string` | yes | `id` of the `Dialog.Content` this button opens; the browser resolves it at click time. |
|
|
23
|
+
|
|
24
|
+
### DialogCloseOwnProps
|
|
25
|
+
|
|
26
|
+
| Member | Type | Required | Description |
|
|
27
|
+
| --- | --- | --- | --- |
|
|
28
|
+
| `children` | `ReactNode` | no | |
|
|
29
|
+
| `target` | `string` | yes | `id` of the `Dialog.Content` this button closes. |
|
|
30
|
+
|
|
31
|
+
### DialogContentOwnProps
|
|
32
|
+
|
|
33
|
+
| Member | Type | Required | Description |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| `children` | `ReactNode` | no | |
|
|
36
|
+
| `id` | `string` | yes | Unique id supplied by the consumer; referenced by trigger and close `target`. |
|
|
37
|
+
|
|
38
|
+
## Other types
|
|
39
|
+
|
|
40
|
+
- `DialogTriggerProps<TAs>`: `NativeButtonProps<TAs, DialogTriggerOwnProps>`
|
|
41
|
+
- `DialogCloseProps<TAs>`: `NativeButtonProps<TAs, DialogCloseOwnProps>`
|
|
42
|
+
- `DialogContentNameProps`: `{ readonly "aria-labelledby": string; readonly "aria-label"?: never } | { readonly "aria-label": string; readonly "aria-labelledby"?: never }` — An unnamed `<dialog>` is an axe violation the browser has no fallback for, so the accessible name is a type error to omit — exactly one of `aria-labelledby` or `aria-label` is required.
|
|
43
|
+
- `DialogContentProps`: `DialogContentOwnProps & DialogContentNameProps & Omit<ComponentPropsWithRef<"dialog">, keyof DialogContentOwnProps | "open" | "popover" | "aria-label" | "aria-labelledby">` — A plain, initially closed `<dialog>`: `open` and `popover` are not part of the native contract, and the accessible name is required (see `DialogContentNameProps`).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Generated from the package source. Do not edit by hand. -->
|
|
2
|
+
# invoker
|
|
3
|
+
|
|
4
|
+
- Import: `@gunkin/uiify/elements/invoker`
|
|
5
|
+
- Native mechanism: command/commandfor attributes
|
|
6
|
+
- Parts: `Invoker`
|
|
7
|
+
- Used by: dialog
|
|
8
|
+
- Types file: `dist/elements/invoker.d.ts`
|
|
9
|
+
|
|
10
|
+
## Exports
|
|
11
|
+
|
|
12
|
+
- Runtime: `Invoker`
|
|
13
|
+
- Types: `InvokerOwnProps`, `InvokerProps`, `NativeCommand`
|
|
14
|
+
|
|
15
|
+
## Props and shapes
|
|
16
|
+
|
|
17
|
+
### InvokerOwnProps
|
|
18
|
+
|
|
19
|
+
| Member | Type | Required | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `children` | `ReactNode` | no | |
|
|
22
|
+
| `command` | `NativeCommand` | yes | The command to invoke on `commandfor` when this button is activated. |
|
|
23
|
+
| `commandfor` | `string` | yes | `id` of the element this button invokes a command on. |
|
|
24
|
+
|
|
25
|
+
## Other types
|
|
26
|
+
|
|
27
|
+
- `NativeCommand`: `` "show-modal" | "request-close" | "close" | "show-popover" | "hide-popover" | "toggle-popover" | `--${string}` `` — The commands defined by the HTML Invoker Commands API, plus a consumer `--*` custom command (template literal type). A custom command needs its own JS listener on `commandfor`'s target — this element documents that contract, it does not implement one.
|
|
28
|
+
- `InvokerProps<TAs>`: `NativeButtonProps<TAs, InvokerOwnProps>` — `as` defaults to `"button"`; intrinsic tags other than `"button"` are a type error — invoker commands only fire from a real button — and `type` is owned by the element (it is always `"button"`, never `"submit"`/`"reset"`).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!-- Generated from the package source. Do not edit by hand. -->
|
|
2
|
+
# popover
|
|
3
|
+
|
|
4
|
+
- Import: `@gunkin/uiify/elements/popover`
|
|
5
|
+
- Native mechanism: [popover] + popovertarget
|
|
6
|
+
- Parts: `Popover.Trigger`, `Popover.Surface`, `Popover.Close`
|
|
7
|
+
- Used by: popup
|
|
8
|
+
- Types file: `dist/elements/popover.d.ts`
|
|
9
|
+
|
|
10
|
+
## Exports
|
|
11
|
+
|
|
12
|
+
- Runtime: `Popover`, `PopoverClose`, `PopoverSurface`, `PopoverTrigger`
|
|
13
|
+
- Types: `AnchorAlign`, `AnchorSide`, `PopoverCloseOwnProps`, `PopoverCloseProps`, `PopoverSurfaceMode`, `PopoverSurfaceOwnProps`, `PopoverSurfaceProps`, `PopoverTriggerAction`, `PopoverTriggerOwnProps`, `PopoverTriggerProps`
|
|
14
|
+
|
|
15
|
+
## Values
|
|
16
|
+
|
|
17
|
+
- `PopoverSurfaceMode`: `"auto" | "manual"` — Cross-engine baseline; `hint` is not part of this element's contract.
|
|
18
|
+
- `AnchorSide`: `"top" | "right" | "bottom" | "left"`
|
|
19
|
+
- `AnchorAlign`: `"start" | "center" | "end"`
|
|
20
|
+
- `PopoverTriggerAction`: `"toggle" | "show" | "hide"` — What a trigger does to its target popover when activated.
|
|
21
|
+
|
|
22
|
+
## Props and shapes
|
|
23
|
+
|
|
24
|
+
### PopoverTriggerOwnProps
|
|
25
|
+
|
|
26
|
+
| Member | Type | Required | Description |
|
|
27
|
+
| --- | --- | --- | --- |
|
|
28
|
+
| `children` | `ReactNode` | no | |
|
|
29
|
+
| `action` | `PopoverTriggerAction` | no | Defaults to `"toggle"`. |
|
|
30
|
+
| `target` | `string` | yes | `id` of the `Popover.Surface` this button acts on. |
|
|
31
|
+
|
|
32
|
+
### PopoverCloseOwnProps
|
|
33
|
+
|
|
34
|
+
| Member | Type | Required | Description |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| `children` | `ReactNode` | no | |
|
|
37
|
+
| `target` | `string` | yes | `id` of the `Popover.Surface` this button hides. |
|
|
38
|
+
|
|
39
|
+
### PopoverSurfaceOwnProps
|
|
40
|
+
|
|
41
|
+
| Member | Type | Required | Description |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| `align` | `AnchorAlign` | no | |
|
|
44
|
+
| `children` | `ReactNode` | no | |
|
|
45
|
+
| `id` | `string` | yes | Unique id supplied by the consumer; referenced by trigger and close `target`. |
|
|
46
|
+
| `mode` | `PopoverSurfaceMode` | no | |
|
|
47
|
+
| `side` | `AnchorSide` | no | |
|
|
48
|
+
|
|
49
|
+
## Other types
|
|
50
|
+
|
|
51
|
+
- `PopoverTriggerProps<TAs>`: `NativeButtonProps<TAs, PopoverTriggerOwnProps>`
|
|
52
|
+
- `PopoverCloseProps<TAs>`: `NativeButtonProps<TAs, PopoverCloseOwnProps>`
|
|
53
|
+
- `PopoverSurfaceProps`: `PopoverSurfaceOwnProps & Omit<ComponentPropsWithRef<"div">, keyof PopoverSurfaceOwnProps | "popover">` — `popover`, `data-side`, `data-align` and `data-positioning` are owned by the element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/alert-modal/AlertModalParts.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { renderNativeInvoker } from \"@gunkin/uiify/core/render\";\nimport type {\n AlertModalActionProps,\n AlertModalCancelProps,\n AlertModalContentProps,\n AlertModalTriggerProps,\n} from \"./types.js\";\n\n/** Native alert modal invoker with alert-modal identity and trigger anatomy. */\nexport function AlertModalTrigger<TAs extends ElementType = \"button\">(\n props: AlertModalTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalTriggerProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"trigger\",\n \"show-modal\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true },\n );\n}\nAlertModalTrigger.displayName = \"AlertModalTrigger\";\n\n/** Native alert dialog content with alert-modal identity and content anatomy. */\nexport function AlertModalContent(props: AlertModalContentProps): ReactElement {\n const { children, ...dialogProps } = props;\n return (\n <dialog {...dialogProps} data-part=\"content\" data-uiify-alert-modal=\"\" role=\"alertdialog\">\n {children}\n </dialog>\n );\n}\nAlertModalContent.displayName = \"AlertModalContent\";\n\n/** Native alert modal action invoker. */\nexport function AlertModalAction<TAs extends ElementType = \"button\">(\n props: AlertModalActionProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalActionProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"action\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true, variant: \"destructive\" },\n );\n}\nAlertModalAction.displayName = \"AlertModalAction\";\n\n/** Native alert modal cancel invoker. */\nexport function AlertModalCancel<TAs extends ElementType = \"button\">(\n props: AlertModalCancelProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalCancelProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"cancel\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true, variant: \"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/alert-modal/AlertModalParts.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { renderNativeInvoker } from \"@gunkin/uiify/core/render\";\nimport type {\n AlertModalActionProps,\n AlertModalCancelProps,\n AlertModalContentProps,\n AlertModalTriggerProps,\n} from \"./types.js\";\n\n/** Native alert modal invoker with alert-modal identity and trigger anatomy. */\nexport function AlertModalTrigger<TAs extends ElementType = \"button\">(\n props: AlertModalTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalTriggerProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"trigger\",\n \"show-modal\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true },\n );\n}\nAlertModalTrigger.displayName = \"AlertModalTrigger\";\n\n/** Native alert dialog content with alert-modal identity and content anatomy. */\nexport function AlertModalContent(props: AlertModalContentProps): ReactElement {\n const { children, ...dialogProps } = props;\n return (\n <dialog {...dialogProps} data-part=\"content\" data-uiify-alert-modal=\"\" role=\"alertdialog\">\n {children}\n </dialog>\n );\n}\nAlertModalContent.displayName = \"AlertModalContent\";\n\n/** Native alert modal action invoker. */\nexport function AlertModalAction<TAs extends ElementType = \"button\">(\n props: AlertModalActionProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalActionProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"action\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true, variant: \"destructive\" },\n );\n}\nAlertModalAction.displayName = \"AlertModalAction\";\n\n/** Native alert modal cancel invoker. */\nexport function AlertModalCancel<TAs extends ElementType = \"button\">(\n props: AlertModalCancelProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as AlertModalCancelProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-alert-modal\",\n \"cancel\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true, variant: \"secondary\" },\n );\n}\nAlertModalCancel.displayName = \"AlertModalCancel\";\n"],"mappings":"AA8BI;AA7BJ,SAAS,2BAA2B;AAS7B,SAAS,kBACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,KAAK;AAAA,EACjB;AACF;AACA,kBAAkB,cAAc;AAGzB,SAAS,kBAAkB,OAA6C;AAC7E,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,SACE,oBAAC,YAAQ,GAAG,aAAa,aAAU,WAAU,0BAAuB,IAAG,MAAK,eACzE,UACH;AAEJ;AACA,kBAAkB,cAAc;AAGzB,SAAS,iBACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,MAAM,SAAS,cAAc;AAAA,EACzC;AACF;AACA,iBAAiB,cAAc;AAGxB,SAAS,iBACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,MAAM,SAAS,YAAY;AAAA,EACvC;AACF;AACA,iBAAiB,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAM9C,wBAAgB,MAAM,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACvD,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GACtB,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAM9C,wBAAgB,MAAM,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EACvD,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GACtB,YAAY,GAAG,IAAI,CA8CrB"}
|
|
@@ -7,12 +7,14 @@ function Button(props) {
|
|
|
7
7
|
as,
|
|
8
8
|
render,
|
|
9
9
|
disabled = false,
|
|
10
|
+
selected,
|
|
10
11
|
size,
|
|
11
12
|
type,
|
|
12
13
|
variant,
|
|
13
14
|
...consumerProps
|
|
14
15
|
} = props;
|
|
15
16
|
const nativeButton = isNativeButton(as);
|
|
17
|
+
const ownsAria = "aria-pressed" in consumerProps || "aria-current" in consumerProps || "aria-selected" in consumerProps;
|
|
16
18
|
return useRenderElement({
|
|
17
19
|
as,
|
|
18
20
|
defaultTag: "button",
|
|
@@ -21,6 +23,8 @@ function Button(props) {
|
|
|
21
23
|
"data-uiify-button": "",
|
|
22
24
|
...size !== void 0 ? { "data-size": size } : {},
|
|
23
25
|
...variant !== void 0 ? { "data-variant": variant } : {},
|
|
26
|
+
...selected ? { "data-selected": "" } : {},
|
|
27
|
+
...selected !== void 0 && nativeButton && !ownsAria ? { "aria-pressed": selected } : {},
|
|
24
28
|
...nativeButton ? { type: type ?? "button", ...disabled ? { disabled: true } : {} } : disabled ? {
|
|
25
29
|
"aria-disabled": true,
|
|
26
30
|
tabIndex: -1,
|
|
@@ -31,7 +35,7 @@ function Button(props) {
|
|
|
31
35
|
...disabled ? { "data-disabled": "" } : {}
|
|
32
36
|
},
|
|
33
37
|
render,
|
|
34
|
-
state: { disabled }
|
|
38
|
+
state: { disabled, selected: selected ?? false }
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
41
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { ButtonProps } from \"./types.js\";\n\nfunction isNativeButton(as: ElementType | undefined): boolean {\n return as === undefined || as === \"button\";\n}\n\nexport function Button<TAs extends ElementType = \"button\">(\n props: ButtonProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n disabled = false,\n size,\n type,\n variant,\n ...consumerProps\n } = props as ButtonProps<\"button\">;\n\n const nativeButton = isNativeButton(as);\n\n return useRenderElement({\n as,\n defaultTag: \"button\",\n props: {\n ...consumerProps,\n \"data-uiify-button\": \"\",\n ...(size !== undefined ? { \"data-size\": size } : {}),\n ...(variant !== undefined ? { \"data-variant\": variant } : {}),\n ...(nativeButton\n ? { type: type ?? \"button\", ...(disabled ? { disabled: true } : {}) }\n : disabled\n ? {\n \"aria-disabled\": true,\n tabIndex: -1,\n onClick: (event: { preventDefault: () => void }) => {\n event.preventDefault();\n },\n }\n : {}),\n ...(disabled ? { \"data-disabled\": \"\" } : {}),\n },\n render,\n state: { disabled },\n });\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAGjC,SAAS,eAAe,IAAsC;AAC5D,SAAO,OAAO,UAAa,OAAO;AACpC;AAEO,SAAS,OACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,eAAe,eAAe,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { ButtonProps } from \"./types.js\";\n\nfunction isNativeButton(as: ElementType | undefined): boolean {\n return as === undefined || as === \"button\";\n}\n\nexport function Button<TAs extends ElementType = \"button\">(\n props: ButtonProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n disabled = false,\n selected,\n size,\n type,\n variant,\n ...consumerProps\n } = props as ButtonProps<\"button\">;\n\n const nativeButton = isNativeButton(as);\n // A toggle button reports its state through aria-pressed; anything that already names the\n // relation itself (current page, selected tab) keeps its own attribute.\n const ownsAria =\n \"aria-pressed\" in consumerProps ||\n \"aria-current\" in consumerProps ||\n \"aria-selected\" in consumerProps;\n\n return useRenderElement({\n as,\n defaultTag: \"button\",\n props: {\n ...consumerProps,\n \"data-uiify-button\": \"\",\n ...(size !== undefined ? { \"data-size\": size } : {}),\n ...(variant !== undefined ? { \"data-variant\": variant } : {}),\n ...(selected ? { \"data-selected\": \"\" } : {}),\n ...(selected !== undefined && nativeButton && !ownsAria ? { \"aria-pressed\": selected } : {}),\n ...(nativeButton\n ? { type: type ?? \"button\", ...(disabled ? { disabled: true } : {}) }\n : disabled\n ? {\n \"aria-disabled\": true,\n tabIndex: -1,\n onClick: (event: { preventDefault: () => void }) => {\n event.preventDefault();\n },\n }\n : {}),\n ...(disabled ? { \"data-disabled\": \"\" } : {}),\n },\n render,\n state: { disabled, selected: selected ?? false },\n });\n}\n"],"mappings":"AACA,SAAS,wBAAwB;AAGjC,SAAS,eAAe,IAAsC;AAC5D,SAAO,OAAO,UAAa,OAAO;AACpC;AAEO,SAAS,OACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,eAAe,eAAe,EAAE;AAGtC,QAAM,WACJ,kBAAkB,iBAClB,kBAAkB,iBAClB,mBAAmB;AAErB,SAAO,iBAAiB;AAAA,IACtB;AAAA,IACA,YAAY;AAAA,IACZ,OAAO;AAAA,MACL,GAAG;AAAA,MACH,qBAAqB;AAAA,MACrB,GAAI,SAAS,SAAY,EAAE,aAAa,KAAK,IAAI,CAAC;AAAA,MAClD,GAAI,YAAY,SAAY,EAAE,gBAAgB,QAAQ,IAAI,CAAC;AAAA,MAC3D,GAAI,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;AAAA,MAC1C,GAAI,aAAa,UAAa,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,SAAS,IAAI,CAAC;AAAA,MAC1F,GAAI,eACA,EAAE,MAAM,QAAQ,UAAU,GAAI,WAAW,EAAE,UAAU,KAAK,IAAI,CAAC,EAAG,IAClE,WACE;AAAA,QACE,iBAAiB;AAAA,QACjB,UAAU;AAAA,QACV,SAAS,CAAC,UAA0C;AAClD,gBAAM,eAAe;AAAA,QACvB;AAAA,MACF,IACA,CAAC;AAAA,MACP,GAAI,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,OAAO,EAAE,UAAU,UAAU,YAAY,MAAM;AAAA,EACjD,CAAC;AACH;","names":[]}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { ElementType } from "react";
|
|
2
2
|
import type { RenderableProps } from "@gunkin/uiify/core/render";
|
|
3
|
-
export type ButtonVariant = "
|
|
4
|
-
export type ButtonSize = "sm" | "md" | "lg";
|
|
3
|
+
export type ButtonVariant = "secondary" | "outline" | "ghost" | "destructive" | "link";
|
|
4
|
+
export type ButtonSize = "sm" | "md" | "lg" | "icon-sm" | "icon" | "icon-lg";
|
|
5
5
|
export interface ButtonOwnProps {
|
|
6
6
|
readonly disabled?: boolean;
|
|
7
|
+
/** Marks the button as the chosen one of a set, or a toggle that is on. */
|
|
8
|
+
readonly selected?: boolean;
|
|
7
9
|
readonly type?: "button" | "submit" | "reset";
|
|
8
10
|
readonly size?: ButtonSize;
|
|
9
11
|
readonly variant?: ButtonVariant;
|
|
10
12
|
}
|
|
11
13
|
export interface ButtonState {
|
|
12
14
|
readonly disabled: boolean;
|
|
15
|
+
readonly selected: boolean;
|
|
13
16
|
}
|
|
14
17
|
export type ButtonProps<TAs extends ElementType = "button"> = RenderableProps<TAs, ButtonOwnProps, ButtonState, HTMLElement>;
|
|
15
18
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC;AACvF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,WAAW,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,IAAI,eAAe,CAC3E,GAAG,EACH,cAAc,EACd,WAAW,EACX,WAAW,CACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselMarkup.d.ts","sourceRoot":"","sources":["../../../src/components/carousel/CarouselMarkup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EAAE,OAAO,EACb,OAAO,EACP,YAAY,GACb,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"CarouselMarkup.d.ts","sourceRoot":"","sources":["../../../src/components/carousel/CarouselMarkup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EAAE,OAAO,EACb,OAAO,EACP,YAAY,GACb,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CA+I3C;yBAnJe,cAAc"}
|
|
@@ -37,6 +37,8 @@ function CarouselMarkup({
|
|
|
37
37
|
type: "button",
|
|
38
38
|
"data-part": "controls",
|
|
39
39
|
"data-carousel-action": "rotation",
|
|
40
|
+
"data-uiify-button": "",
|
|
41
|
+
"data-variant": "outline",
|
|
40
42
|
hidden: !enhanced,
|
|
41
43
|
children: presentation.autoplay.requested ? labels.stop : labels.start
|
|
42
44
|
}
|
|
@@ -77,6 +79,9 @@ function CarouselMarkup({
|
|
|
77
79
|
"aria-label": labels.previous,
|
|
78
80
|
"data-part": "controls",
|
|
79
81
|
"data-carousel-action": "previous",
|
|
82
|
+
"data-size": "icon",
|
|
83
|
+
"data-uiify-button": "",
|
|
84
|
+
"data-variant": "outline",
|
|
80
85
|
hidden: !enhanced,
|
|
81
86
|
disabled: enhanced ? presentation.snapshot.atStart : void 0,
|
|
82
87
|
children: base.icons?.previous
|
|
@@ -105,6 +110,9 @@ function CarouselMarkup({
|
|
|
105
110
|
"aria-label": labels.next,
|
|
106
111
|
"data-part": "controls",
|
|
107
112
|
"data-carousel-action": "next",
|
|
113
|
+
"data-size": "icon",
|
|
114
|
+
"data-uiify-button": "",
|
|
115
|
+
"data-variant": "outline",
|
|
108
116
|
hidden: !enhanced,
|
|
109
117
|
disabled: enhanced ? presentation.snapshot.atEnd : void 0,
|
|
110
118
|
children: base.icons?.next
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/carousel/CarouselMarkup.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { carouselFragment, carouselSlideId, normalizeCarouselProps } from \"./carousel-markup.js\";\nimport type { CarouselMarkupProps } from \"./types.js\";\n\nexport function CarouselMarkup({\n base: rawBase,\n rootRef,\n presentation,\n}: CarouselMarkupProps): ReactElement | null {\n const base = normalizeCarouselProps(rawBase);\n const { items, labels } = base;\n const hasControls = items.length > 1;\n\n if (items.length === 0) return null;\n\n const enhanced = presentation?.snapshot.ready === true;\n // Pagination claims a current slide as soon as the client has mounted, even before\n // the controller reports `ready` — SSR/pre-hydration markup still claims nothing.\n const showActiveDot = enhanced || presentation?.mounted === true;\n const activeIndex = presentation?.snapshot.index;\n const announcedIndex = presentation?.snapshot.settledIndex;\n const fade = enhanced && presentation.mode === \"fade\";\n const presentedIndex = fade ? (presentation.snapshot.requestedIndex ?? activeIndex) : activeIndex;\n const dotIndices =\n enhanced && !presentation.preserveFallbackFocus\n ? presentation.snapshot.pages.map((page) => page.index)\n : items.map((_, index) => index);\n\n return (\n <section\n ref={rootRef}\n id={base.id}\n aria-label={base[\"aria-label\"]}\n aria-roledescription=\"carousel\"\n data-uiify-carousel=\"\"\n data-axis={base.axis}\n {...(presentation ? { \"data-mode\": presentation.mode } : {})}\n {...(enhanced ? { \"data-enhanced\": \"\" } : {})}\n {...(base.dir ? { dir: base.dir } : {})}\n {...(base.className ? { className: base.className } : {})}\n {...(base.style ? { style: base.style } : {})}\n >\n {presentation && hasControls && presentation.autoplay ? (\n <button\n type=\"button\"\n data-part=\"controls\"\n data-carousel-action=\"rotation\"\n hidden={!enhanced}\n >\n {presentation.autoplay.requested ? labels.stop : labels.start}\n </button>\n ) : null}\n\n <div\n id={`${base.id}--viewport`}\n tabIndex={0}\n role=\"group\"\n aria-label={base[\"aria-label\"]}\n data-part=\"viewport\"\n >\n {items.map((item, index) => {\n const slideId = carouselSlideId(base.id, item.id);\n return (\n <div\n key={item.id}\n id={slideId}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${item.label}, ${index + 1} ${labels.of} ${items.length}`}\n className={item.className}\n data-part=\"slide\"\n data-carousel-index={index}\n {...(enhanced\n ? { \"data-state\": index === presentedIndex ? \"active\" : \"inactive\" }\n : {})}\n {...(fade && index !== presentedIndex ? { inert: true, \"aria-hidden\": true } : {})}\n >\n <div data-part=\"slide-content\">{item.children}</div>\n </div>\n );\n })}\n </div>\n\n {presentation && hasControls && base.navigation ? (\n <button\n type=\"button\"\n aria-label={labels.previous}\n data-part=\"controls\"\n data-carousel-action=\"previous\"\n hidden={!enhanced}\n disabled={enhanced ? presentation.snapshot.atStart : undefined}\n >\n {base.icons?.previous}\n </button>\n ) : null}\n\n {base.pagination && hasControls ? (\n <nav aria-label={labels.navigation} data-part=\"dots\">\n {dotIndices.map((itemIndex) => {\n const item = items[itemIndex];\n if (!item) return null;\n return (\n <a\n key={item.id}\n href={carouselFragment(carouselSlideId(base.id, item.id))}\n aria-label={`${labels.goTo} ${item.label}`}\n aria-current={showActiveDot && itemIndex === activeIndex ? \"true\" : undefined}\n data-part=\"dot\"\n data-carousel-index={itemIndex}\n >\n {itemIndex + 1}\n </a>\n );\n })}\n </nav>\n ) : null}\n\n {presentation && hasControls && base.navigation ? (\n <button\n type=\"button\"\n aria-label={labels.next}\n data-part=\"controls\"\n data-carousel-action=\"next\"\n hidden={!enhanced}\n disabled={enhanced ? presentation.snapshot.atEnd : undefined}\n >\n {base.icons?.next}\n </button>\n ) : null}\n\n {presentation ? (\n <div\n aria-live={presentation.autoplay?.playing ? \"off\" : \"polite\"}\n aria-atomic=\"true\"\n data-part=\"status\"\n >\n {enhanced && announcedIndex !== undefined\n ? `${items[announcedIndex]?.label ?? \"\"}, ${announcedIndex + 1} ${labels.of} ${items.length}`\n : null}\n </div>\n ) : null}\n </section>\n );\n}\nCarouselMarkup.displayName = \"CarouselMarkup\";\n"],"mappings":"AA6BI,SAcI,KAdJ;AA5BJ,SAAS,kBAAkB,iBAAiB,8BAA8B;AAGnE,SAAS,eAAe;AAAA,EAC7B,MAAM;AAAA,EACN;AAAA,EACA;AACF,GAA6C;AAC3C,QAAM,OAAO,uBAAuB,OAAO;AAC3C,QAAM,EAAE,OAAO,OAAO,IAAI;AAC1B,QAAM,cAAc,MAAM,SAAS;AAEnC,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,QAAM,WAAW,cAAc,SAAS,UAAU;AAGlD,QAAM,gBAAgB,YAAY,cAAc,YAAY;AAC5D,QAAM,cAAc,cAAc,SAAS;AAC3C,QAAM,iBAAiB,cAAc,SAAS;AAC9C,QAAM,OAAO,YAAY,aAAa,SAAS;AAC/C,QAAM,iBAAiB,OAAQ,aAAa,SAAS,kBAAkB,cAAe;AACtF,QAAM,aACJ,YAAY,CAAC,aAAa,wBACtB,aAAa,SAAS,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,IACpD,MAAM,IAAI,CAAC,GAAG,UAAU,KAAK;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,IAAI,KAAK;AAAA,MACT,cAAY,KAAK,YAAY;AAAA,MAC7B,wBAAqB;AAAA,MACrB,uBAAoB;AAAA,MACpB,aAAW,KAAK;AAAA,MACf,GAAI,eAAe,EAAE,aAAa,aAAa,KAAK,IAAI,CAAC;AAAA,MACzD,GAAI,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;AAAA,MAC1C,GAAI,KAAK,MAAM,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC;AAAA,MACpC,GAAI,KAAK,YAAY,EAAE,WAAW,KAAK,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CAAC;AAAA,YACT,UAAU,WAAW,aAAa,SAAS,UAAU;AAAA,YAEpD,eAAK,OAAO;AAAA;AAAA,QACf,IACE;AAAA,QAEH,KAAK,cAAc,cAClB,oBAAC,SAAI,cAAY,OAAO,YAAY,aAAU,QAC3C,qBAAW,IAAI,CAAC,cAAc;AAC7B,gBAAM,OAAO,MAAM,SAAS;AAC5B,cAAI,CAAC,KAAM,QAAO;AAClB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM,iBAAiB,gBAAgB,KAAK,IAAI,KAAK,EAAE,CAAC;AAAA,cACxD,cAAY,GAAG,OAAO,IAAI,IAAI,KAAK,KAAK;AAAA,cACxC,gBAAc,iBAAiB,cAAc,cAAc,SAAS;AAAA,cACpE,aAAU;AAAA,cACV,uBAAqB;AAAA,cAEpB,sBAAY;AAAA;AAAA,YAPR,KAAK;AAAA,UAQZ;AAAA,QAEJ,CAAC,GACH,IACE;AAAA,QAEH,gBAAgB,eAAe,KAAK,aACnC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAY,OAAO;AAAA,YACnB,aAAU;AAAA,YACV,wBAAqB;AAAA,YACrB,QAAQ,CAAC;AAAA,YACT,UAAU,WAAW,aAAa,SAAS,QAAQ;AAAA,YAElD,eAAK,OAAO;AAAA;AAAA,QACf,IACE;AAAA,QAEH,eACC;AAAA,UAAC;AAAA;AAAA,YACC,aAAW,aAAa,UAAU,UAAU,QAAQ;AAAA,YACpD,eAAY;AAAA,YACZ,aAAU;AAAA,YAET,sBAAY,mBAAmB,SAC5B,GAAG,MAAM,cAAc,GAAG,SAAS,EAAE,KAAK,iBAAiB,CAAC,IAAI,OAAO,EAAE,IAAI,MAAM,MAAM,KACzF;AAAA;AAAA,QACN,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AACA,eAAe,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/carousel/CarouselMarkup.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { carouselFragment, carouselSlideId, normalizeCarouselProps } from \"./carousel-markup.js\";\nimport type { CarouselMarkupProps } from \"./types.js\";\n\nexport function CarouselMarkup({\n base: rawBase,\n rootRef,\n presentation,\n}: CarouselMarkupProps): ReactElement | null {\n const base = normalizeCarouselProps(rawBase);\n const { items, labels } = base;\n const hasControls = items.length > 1;\n\n if (items.length === 0) return null;\n\n const enhanced = presentation?.snapshot.ready === true;\n // Pagination claims a current slide as soon as the client has mounted, even before\n // the controller reports `ready` — SSR/pre-hydration markup still claims nothing.\n const showActiveDot = enhanced || presentation?.mounted === true;\n const activeIndex = presentation?.snapshot.index;\n const announcedIndex = presentation?.snapshot.settledIndex;\n const fade = enhanced && presentation.mode === \"fade\";\n const presentedIndex = fade ? (presentation.snapshot.requestedIndex ?? activeIndex) : activeIndex;\n const dotIndices =\n enhanced && !presentation.preserveFallbackFocus\n ? presentation.snapshot.pages.map((page) => page.index)\n : items.map((_, index) => index);\n\n return (\n <section\n ref={rootRef}\n id={base.id}\n aria-label={base[\"aria-label\"]}\n aria-roledescription=\"carousel\"\n data-uiify-carousel=\"\"\n data-axis={base.axis}\n {...(presentation ? { \"data-mode\": presentation.mode } : {})}\n {...(enhanced ? { \"data-enhanced\": \"\" } : {})}\n {...(base.dir ? { dir: base.dir } : {})}\n {...(base.className ? { className: base.className } : {})}\n {...(base.style ? { style: base.style } : {})}\n >\n {presentation && hasControls && presentation.autoplay ? (\n <button\n type=\"button\"\n data-part=\"controls\"\n data-carousel-action=\"rotation\"\n data-uiify-button=\"\"\n data-variant=\"outline\"\n hidden={!enhanced}\n >\n {presentation.autoplay.requested ? labels.stop : labels.start}\n </button>\n ) : null}\n\n <div\n id={`${base.id}--viewport`}\n tabIndex={0}\n role=\"group\"\n aria-label={base[\"aria-label\"]}\n data-part=\"viewport\"\n >\n {items.map((item, index) => {\n const slideId = carouselSlideId(base.id, item.id);\n return (\n <div\n key={item.id}\n id={slideId}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${item.label}, ${index + 1} ${labels.of} ${items.length}`}\n className={item.className}\n data-part=\"slide\"\n data-carousel-index={index}\n {...(enhanced\n ? { \"data-state\": index === presentedIndex ? \"active\" : \"inactive\" }\n : {})}\n {...(fade && index !== presentedIndex ? { inert: true, \"aria-hidden\": true } : {})}\n >\n <div data-part=\"slide-content\">{item.children}</div>\n </div>\n );\n })}\n </div>\n\n {presentation && hasControls && base.navigation ? (\n <button\n type=\"button\"\n aria-label={labels.previous}\n data-part=\"controls\"\n data-carousel-action=\"previous\"\n data-size=\"icon\"\n data-uiify-button=\"\"\n data-variant=\"outline\"\n hidden={!enhanced}\n disabled={enhanced ? presentation.snapshot.atStart : undefined}\n >\n {base.icons?.previous}\n </button>\n ) : null}\n\n {base.pagination && hasControls ? (\n <nav aria-label={labels.navigation} data-part=\"dots\">\n {dotIndices.map((itemIndex) => {\n const item = items[itemIndex];\n if (!item) return null;\n return (\n <a\n key={item.id}\n href={carouselFragment(carouselSlideId(base.id, item.id))}\n aria-label={`${labels.goTo} ${item.label}`}\n aria-current={showActiveDot && itemIndex === activeIndex ? \"true\" : undefined}\n data-part=\"dot\"\n data-carousel-index={itemIndex}\n >\n {itemIndex + 1}\n </a>\n );\n })}\n </nav>\n ) : null}\n\n {presentation && hasControls && base.navigation ? (\n <button\n type=\"button\"\n aria-label={labels.next}\n data-part=\"controls\"\n data-carousel-action=\"next\"\n data-size=\"icon\"\n data-uiify-button=\"\"\n data-variant=\"outline\"\n hidden={!enhanced}\n disabled={enhanced ? presentation.snapshot.atEnd : undefined}\n >\n {base.icons?.next}\n </button>\n ) : null}\n\n {presentation ? (\n <div\n aria-live={presentation.autoplay?.playing ? \"off\" : \"polite\"}\n aria-atomic=\"true\"\n data-part=\"status\"\n >\n {enhanced && announcedIndex !== undefined\n ? `${items[announcedIndex]?.label ?? \"\"}, ${announcedIndex + 1} ${labels.of} ${items.length}`\n : null}\n </div>\n ) : null}\n </section>\n );\n}\nCarouselMarkup.displayName = \"CarouselMark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f,IACE;AAAA,QAEH,KAAK,cAAc,cAClB,oBAAC,SAAI,cAAY,OAAO,YAAY,aAAU,QAC3C,qBAAW,IAAI,CAAC,cAAc;AAC7B,gBAAM,OAAO,MAAM,SAAS;AAC5B,cAAI,CAAC,KAAM,QAAO;AAClB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM,iBAAiB,gBAAgB,KAAK,IAAI,KAAK,EAAE,CAAC;AAAA,cACxD,cAAY,GAAG,OAAO,IAAI,IAAI,KAAK,KAAK;AAAA,cACxC,gBAAc,iBAAiB,cAAc,cAAc,SAAS;AAAA,cACpE,aAAU;AAAA,cACV,uBAAqB;AAAA,cAEpB,sBAAY;AAAA;AAAA,YAPR,KAAK;AAAA,UAQZ;AAAA,QAEJ,CAAC,GACH,IACE;AAAA,QAEH,gBAAgB,eAAe,KAAK,aACnC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAY,OAAO;AAAA,YACnB,aAAU;AAAA,YACV,wBAAqB;AAAA,YACrB,aAAU;AAAA,YACV,qBAAkB;AAAA,YAClB,gBAAa;AAAA,YACb,QAAQ,CAAC;AAAA,YACT,UAAU,WAAW,aAAa,SAAS,QAAQ;AAAA,YAElD,eAAK,OAAO;AAAA;AAAA,QACf,IACE;AAAA,QAEH,eACC;AAAA,UAAC;AAAA;AAAA,YACC,aAAW,aAAa,UAAU,UAAU,QAAQ;AAAA,YACpD,eAAY;AAAA,YACZ,aAAU;AAAA,YAET,sBAAY,mBAAmB,SAC5B,GAAG,MAAM,cAAc,GAAG,SAAS,EAAE,KAAK,iBAAiB,CAAC,IAAI,OAAO,EAAE,IAAI,MAAM,MAAM,KACzF;AAAA;AAAA,QACN,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AACA,eAAe,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/choice-family/ChoiceGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,UAAU,EAClD,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAC7B,YAAY,
|
|
1
|
+
{"version":3,"file":"ChoiceGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/choice-family/ChoiceGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,UAAU,EAClD,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAC7B,YAAY,CA6Dd;yBA/De,WAAW"}
|
|
@@ -19,7 +19,7 @@ function ChoiceGroup(props) {
|
|
|
19
19
|
itemPart = "item",
|
|
20
20
|
labelPart = false,
|
|
21
21
|
rootAttributes,
|
|
22
|
-
|
|
22
|
+
labelAttributes,
|
|
23
23
|
itemInputClassName,
|
|
24
24
|
onItemChange,
|
|
25
25
|
renderPanel,
|
|
@@ -42,7 +42,6 @@ function ChoiceGroup(props) {
|
|
|
42
42
|
return /* @__PURE__ */ createElement(
|
|
43
43
|
ElementChoiceItem,
|
|
44
44
|
{
|
|
45
|
-
...itemWrapperAttributes?.(item),
|
|
46
45
|
...panel === void 0 ? {} : { panel },
|
|
47
46
|
...isControlled ? { checked: isChecked(item) } : { defaultChecked: isChecked(item) },
|
|
48
47
|
disabled: item.disabled ?? false,
|
|
@@ -56,7 +55,7 @@ function ChoiceGroup(props) {
|
|
|
56
55
|
kind,
|
|
57
56
|
label: renderLabel ? renderLabel(item) : item.label,
|
|
58
57
|
labelPart: false,
|
|
59
|
-
labelProps: { "data-part": labelPart ? "trigger" : "label" },
|
|
58
|
+
labelProps: { ...labelAttributes, "data-part": labelPart ? "trigger" : "label" },
|
|
60
59
|
name: groupName,
|
|
61
60
|
...onItemChange ? { onValueChange: () => onItemChange(item) } : {},
|
|
62
61
|
panelProps: { "data-part": "panel" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/internal/choice-family/ChoiceGroup.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport {\n ChoiceGroup as ElementChoiceGroup,\n ChoiceItem as ElementChoiceItem,\n} from \"../../../elements/choice/index.js\";\nimport { getChoiceGroupName } from \"./ids.js\";\nimport type { ChoiceGroupProps, ChoiceItem } from \"./types.js\";\n\n/**\n * Built on `@gunkin/uiify/elements/choice`: this component\n * stays the ergonomic, items-array API six components share, now implemented as a thin map\n * from `items` onto `Choice.Item` with canonical `data-part` anatomy.\n */\nexport function ChoiceGroup<TItem extends ChoiceItem>(\n props: ChoiceGroupProps<TItem>,\n): ReactElement {\n const {\n id,\n items,\n namespace,\n kind,\n isChecked,\n isControlled = false,\n name,\n orientation,\n className,\n itemPart = \"item\",\n labelPart = false,\n rootAttributes,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/internal/choice-family/ChoiceGroup.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport {\n ChoiceGroup as ElementChoiceGroup,\n ChoiceItem as ElementChoiceItem,\n} from \"../../../elements/choice/index.js\";\nimport { getChoiceGroupName } from \"./ids.js\";\nimport type { ChoiceGroupProps, ChoiceItem } from \"./types.js\";\n\n/**\n * Built on `@gunkin/uiify/elements/choice`: this component\n * stays the ergonomic, items-array API six components share, now implemented as a thin map\n * from `items` onto `Choice.Item` with canonical `data-part` anatomy.\n */\nexport function ChoiceGroup<TItem extends ChoiceItem>(\n props: ChoiceGroupProps<TItem>,\n): ReactElement {\n const {\n id,\n items,\n namespace,\n kind,\n isChecked,\n isControlled = false,\n name,\n orientation,\n className,\n itemPart = \"item\",\n labelPart = false,\n rootAttributes,\n labelAttributes,\n itemInputClassName,\n onItemChange,\n renderPanel,\n renderLabel,\n append,\n } = props;\n const groupName = name ?? getChoiceGroupName(id, kind);\n\n return (\n <ElementChoiceGroup\n {...{ [`data-uiify-${namespace}`]: \"\" }}\n {...rootAttributes}\n className={className}\n id={id}\n kind={kind}\n orientation={orientation}\n >\n {items.map((item) => {\n const panel = renderPanel ? renderPanel(item) : undefined;\n return (\n <ElementChoiceItem\n {...(panel === undefined ? {} : { panel })}\n {...(isControlled ? { checked: isChecked(item) } : { defaultChecked: isChecked(item) })}\n disabled={item.disabled ?? false}\n groupId={id}\n inputProps={{\n className: itemInputClassName?.(item),\n \"data-part\": \"control\",\n ...(kind === \"single\" ? { \"data-uiify-radio\": \"\" } : {}),\n }}\n key={item.value}\n kind={kind}\n label={renderLabel ? renderLabel(item) : item.label}\n labelPart={false}\n labelProps={{ ...labelAttributes, \"data-part\": labelPart ? \"trigger\" : \"label\" }}\n name={groupName}\n {...(onItemChange ? { onValueChange: () => onItemChange(item) } : {})}\n panelProps={{ \"data-part\": \"panel\" }}\n part={itemPart}\n value={item.value}\n />\n );\n })}\n {append ? <div data-part=\"append\">{append}</div> : null}\n </ElementChoiceGroup>\n );\n}\nChoiceGroup.displayName = \"ChoiceGroup\";\n"],"mappings":"AAuCI,SAkCY,KAlCZ;AAWM;AAjDV;AAAA,EACE,eAAe;AAAA,EACf,cAAc;AAAA,OACT;AACP,SAAS,0BAA0B;AAQ5B,SAAS,YACd,OACc;AACd,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,YAAY,QAAQ,mBAAmB,IAAI,IAAI;AAErD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG,EAAE,CAAC,cAAc,SAAS,EAAE,GAAG,GAAG;AAAA,MACrC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA,cAAM,IAAI,CAAC,SAAS;AACnB,gBAAM,QAAQ,cAAc,YAAY,IAAI,IAAI;AAChD,iBACE;AAAA,YAAC;AAAA;AAAA,cACE,GAAI,UAAU,SAAY,CAAC,IAAI,EAAE,MAAM;AAAA,cACvC,GAAI,eAAe,EAAE,SAAS,UAAU,IAAI,EAAE,IAAI,EAAE,gBAAgB,UAAU,IAAI,EAAE;AAAA,cACrF,UAAU,KAAK,YAAY;AAAA,cAC3B,SAAS;AAAA,cACT,YAAY;AAAA,gBACV,WAAW,qBAAqB,IAAI;AAAA,gBACpC,aAAa;AAAA,gBACb,GAAI,SAAS,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;AAAA,cACxD;AAAA,cACA,KAAK,KAAK;AAAA,cACV;AAAA,cACA,OAAO,cAAc,YAAY,IAAI,IAAI,KAAK;AAAA,cAC9C,WAAW;AAAA,cACX,YAAY,EAAE,GAAG,iBAAiB,aAAa,YAAY,YAAY,QAAQ;AAAA,cAC/E,MAAM;AAAA,cACL,GAAI,eAAe,EAAE,eAAe,MAAM,aAAa,IAAI,EAAE,IAAI,CAAC;AAAA,cACnE,YAAY,EAAE,aAAa,QAAQ;AAAA,cACnC,MAAM;AAAA,cACN,OAAO,KAAK;AAAA;AAAA,UACd;AAAA,QAEJ,CAAC;AAAA,QACA,SAAS,oBAAC,SAAI,aAAU,UAAU,kBAAO,IAAS;AAAA;AAAA;AAAA,EACrD;AAEJ;AACA,YAAY,cAAc;","names":[]}
|
|
@@ -28,8 +28,8 @@ export interface ChoiceGroupProps<TItem extends ChoiceItem = ChoiceItem> {
|
|
|
28
28
|
readonly labelPart?: boolean;
|
|
29
29
|
/** Extra attributes spread onto the root, e.g. `data-full-width`, `aria-label`. */
|
|
30
30
|
readonly rootAttributes?: Record<string, string | undefined>;
|
|
31
|
-
/** Extra attributes
|
|
32
|
-
readonly
|
|
31
|
+
/** Extra attributes for each item's label, e.g. the Button skin markers. */
|
|
32
|
+
readonly labelAttributes?: Record<string, string>;
|
|
33
33
|
/** Per-item `className` hook for the input, e.g. RadioGroup's `item.className`. */
|
|
34
34
|
readonly itemInputClassName?: (item: TItem) => string | undefined;
|
|
35
35
|
/** Fires on the input's native `change` event, e.g. a client wrapper syncing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/choice-family/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D;+EAC+E;AAC/E,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,gBAAgB,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;IAC7C,QAAQ,CAAC,YAAY,CAA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wBAAgB,cAAc,IAAI,YAAY,GAAG,IAAI,CAUpD;yBAVe,cAAc;;;AAa9B,wBAAgB,cAAc,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC/D,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAC9B,YAAY,GAAG,IAAI,CAiCrB;AAkFD,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC"}
|
|
@@ -107,7 +107,10 @@ function PaginationLink(props) {
|
|
|
107
107
|
"aria-current": selected ? "page" : void 0,
|
|
108
108
|
"aria-label": `Page ${page}`,
|
|
109
109
|
"data-selected": selected ? "" : void 0,
|
|
110
|
+
"data-size": "icon",
|
|
110
111
|
"data-type": "page",
|
|
112
|
+
"data-uiify-button": "",
|
|
113
|
+
"data-variant": "ghost",
|
|
111
114
|
disabled: disabled || void 0,
|
|
112
115
|
onClick: composeEventHandlers(onClick, () => setPage(page)),
|
|
113
116
|
type: "button",
|
|
@@ -124,6 +127,8 @@ function PaginationPrevious({ disabled }) {
|
|
|
124
127
|
{
|
|
125
128
|
"aria-label": "Previous page",
|
|
126
129
|
"data-type": "previous",
|
|
130
|
+
"data-uiify-button": "",
|
|
131
|
+
"data-variant": "ghost",
|
|
127
132
|
disabled,
|
|
128
133
|
onClick: () => setPage(page - 1),
|
|
129
134
|
type: "button",
|
|
@@ -139,6 +144,8 @@ function PaginationNext({ disabled }) {
|
|
|
139
144
|
{
|
|
140
145
|
"aria-label": "Next page",
|
|
141
146
|
"data-type": "next",
|
|
147
|
+
"data-uiify-button": "",
|
|
148
|
+
"data-variant": "ghost",
|
|
142
149
|
disabled,
|
|
143
150
|
onClick: () => setPage(page + 1),
|
|
144
151
|
type: "button",
|
|
@@ -154,6 +161,8 @@ function PaginationFirst({ disabled }) {
|
|
|
154
161
|
{
|
|
155
162
|
"aria-label": "First page",
|
|
156
163
|
"data-type": "first",
|
|
164
|
+
"data-uiify-button": "",
|
|
165
|
+
"data-variant": "ghost",
|
|
157
166
|
disabled,
|
|
158
167
|
onClick: () => setPage(1),
|
|
159
168
|
type: "button",
|
|
@@ -169,6 +178,8 @@ function PaginationLast({ disabled }) {
|
|
|
169
178
|
{
|
|
170
179
|
"aria-label": "Last page",
|
|
171
180
|
"data-type": "last",
|
|
181
|
+
"data-uiify-button": "",
|
|
182
|
+
"data-variant": "ghost",
|
|
172
183
|
disabled,
|
|
173
184
|
onClick: () => setPage(count),
|
|
174
185
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport type { ElementType, MouseEvent, ReactElement } from \"react\";\nimport { createPartContext } from \"@gunkin/uiify/core\";\nimport { composeEventHandlers } from \"@gunkin/uiify/core/compose-event-handlers\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport {\n PaginationEllipsis as PaginationEllipsisElement,\n PaginationItemPart,\n PaginationList as PaginationListElement,\n} from \"./PaginationShell.js\";\nimport { usePagination } from \"./use-pagination.js\";\nimport type {\n PaginationContextValue,\n PaginationItem,\n PaginationLinkProps,\n PaginationRootProps,\n} from \"./types.js\";\n\nexport type { PaginationItem } from \"./types.js\";\n\nexport { PaginationEllipsis, PaginationItemPart } from \"./PaginationShell.js\";\n\nconst [PaginationProvider, usePaginationContext] =\n createPartContext<PaginationContextValue>(\"Pagination\");\n\nexport function PaginationRoot<TAs extends ElementType = \"nav\">(\n props: PaginationRootProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n \"aria-label\": ariaLabel = \"Pagination\",\n boundaryCount,\n count,\n defaultPage,\n disabled,\n onPageChange,\n page,\n showFirstLast,\n siblingCount,\n children,\n ...consumerProps\n } = props as PaginationRootProps<\"nav\">;\n\n const {\n items,\n page: currentPage,\n setPage,\n } = usePagination({\n count,\n ...(boundaryCount !== undefined ? { boundaryCount } : {}),\n ...(defaultPage !== undefined ? { defaultPage } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(onPageChange !== undefined ? { onPageChange } : {}),\n ...(page !== undefined ? { page } : {}),\n ...(showFirstLast !== undefined ? { showFirstLast } : {}),\n ...(siblingCount !== undefined ? { siblingCount } : {}),\n });\n\n const contextValue = useMemo(\n () => ({ count, items, page: currentPage, setPage }),\n [count, currentPage, items, setPage],\n );\n\n const element = useRenderElement({\n as,\n defaultTag: \"nav\",\n props: {\n ...consumerProps,\n \"aria-label\": ariaLabel,\n children: children ?? (\n <ol>\n <PaginationListItems />\n </ol>\n ),\n \"data-uiify-pagination\": \"\",\n },\n render,\n state: { page: currentPage },\n });\n\n return <PaginationProvider value={contextValue}>{element}</PaginationProvider>;\n}\nPaginationRoot.displayName = \"PaginationRoot\";\n\nfunction PaginationListItems(): ReactElement {\n const { items } = usePaginationContext(\"List\");\n return (\n <>\n {items.map((item, index) => (\n <PaginationItemRenderer item={item} key={`${item.type}-${item.page ?? index}`} />\n ))}\n </>\n );\n}\nPaginationListItems.displayName = \"PaginationListItems\";\n\nfunction PaginationItemRenderer({ item }: { readonly item: PaginationItem }): ReactElement {\n switch (item.type) {\n case \"ellipsis\":\n return <PaginationEllipsisElement />;\n case \"previous\":\n return <PaginationPrevious disabled={item.disabled} />;\n case \"next\":\n return <PaginationNext disabled={item.disabled} />;\n case \"first\":\n return <PaginationFirst disabled={item.disabled} />;\n case \"last\":\n return <PaginationLast disabled={item.disabled} />;\n default:\n return (\n <PaginationItemPart>\n <PaginationLink disabled={item.disabled} page={item.page ?? 1} selected={item.selected} />\n </PaginationItemPart>\n );\n }\n}\nPaginationItemRenderer.displayName = \"PaginationItemRenderer\";\n\nexport function PaginationList(): ReactElement | null {\n const { items } = usePaginationContext(\"List\");\n\n return (\n <PaginationListElement>\n {items.map((item, index) => (\n <PaginationItemRenderer item={item} key={`${item.type}-${item.page ?? index}`} />\n ))}\n </PaginationListElement>\n );\n}\nPaginationList.displayName = \"PaginationList\";\n\nexport function PaginationLink<TAs extends ElementType = \"button\">(\n props: PaginationLinkProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n disabled = false,\n page,\n selected = false,\n ...consumerProps\n } = props as PaginationLinkProps<\"button\">;\n const { setPage } = usePaginationContext(\"Link\");\n const onClick = (consumerProps as { onClick?: (event: MouseEvent<HTMLButtonElement>) => void })\n .onClick;\n\n return useRenderElement({\n as,\n defaultTag: \"button\",\n props: {\n ...consumerProps,\n \"aria-current\": selected ? \"page\" : undefined,\n \"aria-label\": `Page ${page}`,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-type\": \"page\",\n disabled: disabled || undefined,\n onClick: composeEventHandlers(onClick, () => setPage(page)),\n type: \"button\",\n children: page,\n },\n render,\n state: { selected },\n });\n}\n\nfunction PaginationPrevious({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { page, setPage } = usePaginationContext(\"Previous\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Previous page\"\n data-type=\"previous\"\n disabled={disabled}\n onClick={() => setPage(page - 1)}\n type=\"button\"\n >\n Previous\n </button>\n </PaginationItemPart>\n );\n}\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nfunction PaginationNext({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { page, setPage } = usePaginationContext(\"Next\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Next page\"\n data-type=\"next\"\n disabled={disabled}\n onClick={() => setPage(page + 1)}\n type=\"button\"\n >\n Next\n </button>\n </PaginationItemPart>\n );\n}\nPaginationNext.displayName = \"PaginationNext\";\n\nfunction PaginationFirst({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { setPage } = usePaginationContext(\"First\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"First page\"\n data-type=\"first\"\n disabled={disabled}\n onClick={() => setPage(1)}\n type=\"button\"\n >\n First\n </button>\n </PaginationItemPart>\n );\n}\nPaginationFirst.displayName = \"PaginationFirst\";\n\nfunction PaginationLast({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { count, setPage } = usePaginationContext(\"Last\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Last page\"\n data-type=\"last\"\n disabled={disabled}\n onClick={() => setPage(count)}\n type=\"button\"\n >\n Last\n </button>\n </PaginationItemPart>\n );\n}\nPaginationLast.displayName = \"PaginationLast\";\n\nexport const Pagination = {\n Ellipsis: PaginationEllipsisElement,\n Item: PaginationItemPart,\n Link: PaginationLink,\n List: PaginationList,\n Root: PaginationRoot,\n};\n"],"mappings":";AA0EU,SAgBN,UAhBM;AAxEV,SAAS,eAAe;AAExB,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC;AAAA,EACE,sBAAsB;AAAA,EACtB;AAAA,EACA,kBAAkB;AAAA,OACb;AACP,SAAS,qBAAqB;AAU9B,SAAS,oBAAoB,sBAAAA,2BAA0B;AAEvD,MAAM,CAAC,oBAAoB,oBAAoB,IAC7C,kBAA0C,YAAY;AAEjD,SAAS,eACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,cAAc,YAAY;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,IACN;AAAA,EACF,IAAI,cAAc;AAAA,IAChB;AAAA,IACA,GAAI,kBAAkB,SAAY,EAAE,cAAc,IAAI,CAAC;AAAA,IACvD,GAAI,gBAAgB,SAAY,EAAE,YAAY,IAAI,CAAC;AAAA,IACnD,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,iBAAiB,SAAY,EAAE,aAAa,IAAI,CAAC;AAAA,IACrD,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC;AAAA,IACrC,GAAI,kBAAkB,SAAY,EAAE,cAAc,IAAI,CAAC;AAAA,IACvD,GAAI,iBAAiB,SAAY,EAAE,aAAa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ACC;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,aAAU;AAAA,MACV;AAAA,MACA,SAAS,MAAM,QAAQ,OAAO,CAAC;AAAA,MAC/B,MAAK;AAAA,MACN;AAAA;AAAA,EAED,GACF;AAEJ;AACA,eAAe,cAAc;AAE7B,SAAS,gBAAgB,EAAE,SAAS,GAAiD;AACnF,QAAM,EAAE,QAAQ,IAAI,qBAAqB,OAAO;AAChD,SACE,oBAAC,sBACC;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,aAAU;AAAA,MACV;AAAA,MACA,SAAS,MAAM,QAAQ,CAAC;AAAA,MACxB,MAAK;AAAA,MACN;AAAA;AAAA,EAED,GACF;AAEJ;AACA,gBAAgB,cAAc;AAE9B,SAAS,eAAe,EAAE,SAAS,GAAiD;AAClF,QAAM,EAAE,OAAO,QAAQ,IAAI,qBAAqB,MAAM;AACtD,SACE,oBAAC,sBACC;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,aAAU;AAAA,MACV;AAAA,MACA,SAAS,MAAM,QAAQ,KAAK;AAAA,MAC5B,MAAK;AAAA,MACN;AAAA;AAAA,EAED,GACF;AAEJ;AACA,eAAe,cAAc;AAEtB,MAAM,aAAa;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;","names":["PaginationItemPart"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport type { ElementType, MouseEvent, ReactElement } from \"react\";\nimport { createPartContext } from \"@gunkin/uiify/core\";\nimport { composeEventHandlers } from \"@gunkin/uiify/core/compose-event-handlers\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport {\n PaginationEllipsis as PaginationEllipsisElement,\n PaginationItemPart,\n PaginationList as PaginationListElement,\n} from \"./PaginationShell.js\";\nimport { usePagination } from \"./use-pagination.js\";\nimport type {\n PaginationContextValue,\n PaginationItem,\n PaginationLinkProps,\n PaginationRootProps,\n} from \"./types.js\";\n\nexport type { PaginationItem } from \"./types.js\";\n\nexport { PaginationEllipsis, PaginationItemPart } from \"./PaginationShell.js\";\n\nconst [PaginationProvider, usePaginationContext] =\n createPartContext<PaginationContextValue>(\"Pagination\");\n\nexport function PaginationRoot<TAs extends ElementType = \"nav\">(\n props: PaginationRootProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n \"aria-label\": ariaLabel = \"Pagination\",\n boundaryCount,\n count,\n defaultPage,\n disabled,\n onPageChange,\n page,\n showFirstLast,\n siblingCount,\n children,\n ...consumerProps\n } = props as PaginationRootProps<\"nav\">;\n\n const {\n items,\n page: currentPage,\n setPage,\n } = usePagination({\n count,\n ...(boundaryCount !== undefined ? { boundaryCount } : {}),\n ...(defaultPage !== undefined ? { defaultPage } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(onPageChange !== undefined ? { onPageChange } : {}),\n ...(page !== undefined ? { page } : {}),\n ...(showFirstLast !== undefined ? { showFirstLast } : {}),\n ...(siblingCount !== undefined ? { siblingCount } : {}),\n });\n\n const contextValue = useMemo(\n () => ({ count, items, page: currentPage, setPage }),\n [count, currentPage, items, setPage],\n );\n\n const element = useRenderElement({\n as,\n defaultTag: \"nav\",\n props: {\n ...consumerProps,\n \"aria-label\": ariaLabel,\n children: children ?? (\n <ol>\n <PaginationListItems />\n </ol>\n ),\n \"data-uiify-pagination\": \"\",\n },\n render,\n state: { page: currentPage },\n });\n\n return <PaginationProvider value={contextValue}>{element}</PaginationProvider>;\n}\nPaginationRoot.displayName = \"PaginationRoot\";\n\nfunction PaginationListItems(): ReactElement {\n const { items } = usePaginationContext(\"List\");\n return (\n <>\n {items.map((item, index) => (\n <PaginationItemRenderer item={item} key={`${item.type}-${item.page ?? index}`} />\n ))}\n </>\n );\n}\nPaginationListItems.displayName = \"PaginationListItems\";\n\nfunction PaginationItemRenderer({ item }: { readonly item: PaginationItem }): ReactElement {\n switch (item.type) {\n case \"ellipsis\":\n return <PaginationEllipsisElement />;\n case \"previous\":\n return <PaginationPrevious disabled={item.disabled} />;\n case \"next\":\n return <PaginationNext disabled={item.disabled} />;\n case \"first\":\n return <PaginationFirst disabled={item.disabled} />;\n case \"last\":\n return <PaginationLast disabled={item.disabled} />;\n default:\n return (\n <PaginationItemPart>\n <PaginationLink disabled={item.disabled} page={item.page ?? 1} selected={item.selected} />\n </PaginationItemPart>\n );\n }\n}\nPaginationItemRenderer.displayName = \"PaginationItemRenderer\";\n\nexport function PaginationList(): ReactElement | null {\n const { items } = usePaginationContext(\"List\");\n\n return (\n <PaginationListElement>\n {items.map((item, index) => (\n <PaginationItemRenderer item={item} key={`${item.type}-${item.page ?? index}`} />\n ))}\n </PaginationListElement>\n );\n}\nPaginationList.displayName = \"PaginationList\";\n\nexport function PaginationLink<TAs extends ElementType = \"button\">(\n props: PaginationLinkProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n disabled = false,\n page,\n selected = false,\n ...consumerProps\n } = props as PaginationLinkProps<\"button\">;\n const { setPage } = usePaginationContext(\"Link\");\n const onClick = (consumerProps as { onClick?: (event: MouseEvent<HTMLButtonElement>) => void })\n .onClick;\n\n return useRenderElement({\n as,\n defaultTag: \"button\",\n props: {\n ...consumerProps,\n \"aria-current\": selected ? \"page\" : undefined,\n \"aria-label\": `Page ${page}`,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-size\": \"icon\",\n \"data-type\": \"page\",\n \"data-uiify-button\": \"\",\n \"data-variant\": \"ghost\",\n disabled: disabled || undefined,\n onClick: composeEventHandlers(onClick, () => setPage(page)),\n type: \"button\",\n children: page,\n },\n render,\n state: { selected },\n });\n}\n\nfunction PaginationPrevious({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { page, setPage } = usePaginationContext(\"Previous\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Previous page\"\n data-type=\"previous\"\n data-uiify-button=\"\"\n data-variant=\"ghost\"\n disabled={disabled}\n onClick={() => setPage(page - 1)}\n type=\"button\"\n >\n Previous\n </button>\n </PaginationItemPart>\n );\n}\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nfunction PaginationNext({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { page, setPage } = usePaginationContext(\"Next\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Next page\"\n data-type=\"next\"\n data-uiify-button=\"\"\n data-variant=\"ghost\"\n disabled={disabled}\n onClick={() => setPage(page + 1)}\n type=\"button\"\n >\n Next\n </button>\n </PaginationItemPart>\n );\n}\nPaginationNext.displayName = \"PaginationNext\";\n\nfunction PaginationFirst({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { setPage } = usePaginationContext(\"First\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"First page\"\n data-type=\"first\"\n data-uiify-button=\"\"\n data-variant=\"ghost\"\n disabled={disabled}\n onClick={() => setPage(1)}\n type=\"button\"\n >\n First\n </button>\n </PaginationItemPart>\n );\n}\nPaginationFirst.displayName = \"PaginationFirst\";\n\nfunction PaginationLast({ disabled }: { readonly disabled: boolean }): ReactElement {\n const { count, setPage } = usePaginationContext(\"Last\");\n return (\n <PaginationItemPart>\n <button\n aria-label=\"Last page\"\n data-type=\"last\"\n data-uiify-button=\"\"\n data-variant=\"ghost\"\n disabled={disabled}\n onClick={() => setPage(count)}\n type=\"button\"\n >\n Last\n </button>\n </PaginationItemPart>\n );\n}\nPaginationLast.displayName = \"PaginationLast\";\n\nexport const Pagination = {\n Ellipsis: PaginationEllipsisElement,\n Item: PaginationItemPart,\n Link: PaginationLink,\n List: PaginationList,\n Root: PaginationRoot,\n};\n"],"mappings":";AA0EU,SAgBN,UAhBM;AAxEV,SAAS,eAAe;AAExB,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC;AAAA,EACE,sBAAsB;AAAA,EACtB;AAAA,EACA,kBAAkB;AAAA,OACb;AACP,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;AAAA;AAAA,MACC,cAAW;AAAA,MACX,aAAU;AAAA,MACV,qBAAkB;AAAA,MAClB,gBAAa;AAAA,MACb;AAAA,MACA,SAAS,MAAM,QAAQ,CAAC;AAAA,MACxB,MAAK;AAAA,MACN;AAAA;AAAA,EAED,GACF;AAEJ;AACA,gBAAgB,cAAc;AAE9B,SAAS,eAAe,EAAE,SAAS,GAAiD;AAClF,QAAM,EAAE,OAAO,QAAQ,IAAI,qBAAqB,MAAM;AACtD,SACE,oBAAC,sBACC;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,aAAU;AAAA,MACV,qBAAkB;AAAA,MAClB,gBAAa;AAAA,MACb;AAAA,MACA,SAAS,MAAM,QAAQ,KAAK;AAAA,MAC5B,MAAK;AAAA,MACN;AAAA;AAAA,EAED,GACF;AAEJ;AACA,eAAe,cAAc;AAEtB,MAAM,aAAa;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;","names":["PaginationItemPart"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationShell.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/PaginationShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,KAAK,EAEV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,wBAAgB,cAAc,CAAC,GAAG,SAAS,WAAW,GAAG,KAAK,EAC5D,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAC9B,YAAY,GAAG,IAAI,CAoDrB;yBAtDe,cAAc;;;AAkI9B,wBAAgB,cAAc,CAAC,GAAG,SAAS,WAAW,GAAG,IAAI,EAC3D,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D,wBAAgB,kBAAkB,CAAC,GAAG,SAAS,WAAW,GAAG,MAAM,EACjE,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC,GAClC,YAAY,GAAG,IAAI,CAgBrB;yBAlBe,kBAAkB;;;AAqBlC,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC"}
|
|
@@ -159,8 +159,12 @@ function PaginationLink(props) {
|
|
|
159
159
|
"aria-current": selected ? "page" : void 0,
|
|
160
160
|
"aria-label": `Page ${page}`,
|
|
161
161
|
"aria-disabled": disabled ? true : void 0,
|
|
162
|
+
"data-disabled": disabled ? "" : void 0,
|
|
162
163
|
"data-selected": selected ? "" : void 0,
|
|
164
|
+
"data-size": "icon",
|
|
163
165
|
"data-type": "page",
|
|
166
|
+
"data-uiify-button": "",
|
|
167
|
+
"data-variant": "ghost",
|
|
164
168
|
href,
|
|
165
169
|
children: page
|
|
166
170
|
},
|
|
@@ -177,7 +181,28 @@ function PaginationNavControl({
|
|
|
177
181
|
}) {
|
|
178
182
|
const href = !disabled && getPageHref ? getPageHref(page) : void 0;
|
|
179
183
|
const labelText = type === "previous" ? "Previous" : type === "next" ? "Next" : type === "first" ? "First" : "Last";
|
|
180
|
-
return /* @__PURE__ */ jsx(PaginationItemPart, { children: href ? /* @__PURE__ */ jsx(
|
|
184
|
+
return /* @__PURE__ */ jsx(PaginationItemPart, { children: href ? /* @__PURE__ */ jsx(
|
|
185
|
+
"a",
|
|
186
|
+
{
|
|
187
|
+
"aria-label": label,
|
|
188
|
+
"data-type": type,
|
|
189
|
+
"data-uiify-button": "",
|
|
190
|
+
"data-variant": "ghost",
|
|
191
|
+
href,
|
|
192
|
+
children: labelText
|
|
193
|
+
}
|
|
194
|
+
) : /* @__PURE__ */ jsx(
|
|
195
|
+
"span",
|
|
196
|
+
{
|
|
197
|
+
"aria-disabled": disabled ? true : void 0,
|
|
198
|
+
"aria-label": label,
|
|
199
|
+
"data-disabled": disabled ? "" : void 0,
|
|
200
|
+
"data-type": type,
|
|
201
|
+
"data-uiify-button": "",
|
|
202
|
+
"data-variant": "ghost",
|
|
203
|
+
children: labelText
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
181
206
|
}
|
|
182
207
|
PaginationNavControl.displayName = "PaginationNavControl";
|
|
183
208
|
function PaginationEllipsis(props) {
|