@manakind/ui-core 0.25.0 → 0.25.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/dist/alert/alert.js.map +1 -1
- package/dist/alert/index.js.map +1 -1
- package/dist/avatar/avatar.js.map +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/badge/badge.js.map +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/button/button.js.map +1 -1
- package/dist/button/icon-button.js.map +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/calendar.js.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/card/card.js.map +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/centered-layout/centered-layout.js.map +1 -1
- package/dist/centered-layout/index.js.map +1 -1
- package/dist/checkbox/checkbox.js.map +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/cx.js.map +1 -1
- package/dist/date-input/date-input.js.map +1 -1
- package/dist/date-input/index.js.map +1 -1
- package/dist/dialog/dialog-close.js.map +1 -1
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/divider/divider.js.map +1 -1
- package/dist/divider/index.js.map +1 -1
- package/dist/empty-state/empty-state.js.map +1 -1
- package/dist/empty-state/index.js.map +1 -1
- package/dist/fallback-glyphs.js.map +1 -1
- package/dist/field/field.js.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/input.js.map +1 -1
- package/dist/field/textarea.js.map +1 -1
- package/dist/field/use-field-control.js.map +1 -1
- package/dist/form-layout/form-layout.js.map +1 -1
- package/dist/form-layout/index.js.map +1 -1
- package/dist/group-items.js.map +1 -1
- package/dist/icon/icon.js.map +1 -1
- package/dist/icon/index.js.map +1 -1
- package/dist/illustration/illustration.js.map +1 -1
- package/dist/illustration/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iso-date.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.js.map +1 -1
- package/dist/link/index.js.map +1 -1
- package/dist/link/link.js.map +1 -1
- package/dist/link-component.js.map +1 -1
- package/dist/menu/action-menu.js.map +1 -1
- package/dist/menu/index.js.map +1 -1
- package/dist/menu/menu.js.map +1 -1
- package/dist/page-layout/index.js.map +1 -1
- package/dist/page-layout/page-layout.js.map +1 -1
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/popover.js.map +1 -1
- package/dist/portal-container.js.map +1 -1
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/progress.js.map +1 -1
- package/dist/reorder-control/index.js.map +1 -1
- package/dist/reorder-control/reorder-control.js.map +1 -1
- package/dist/scroll-area/index.js.map +1 -1
- package/dist/scroll-area/scroll-area.js.map +1 -1
- package/dist/section/index.js.map +1 -1
- package/dist/section/section.js.map +1 -1
- package/dist/segment-group/index.js.map +1 -1
- package/dist/segment-group/segment-group.js.map +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/select.js.map +1 -1
- package/dist/show/index.js.map +1 -1
- package/dist/show/show.js.map +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/skeleton.js.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/slider.js.map +1 -1
- package/dist/spinner/index.js.map +1 -1
- package/dist/spinner/spinner.js.map +1 -1
- package/dist/split-layout/index.js.map +1 -1
- package/dist/split-layout/split-layout.js.map +1 -1
- package/dist/sticky/index.js.map +1 -1
- package/dist/sticky/sticky.js.map +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/switch.js.map +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/text.js.map +1 -1
- package/dist/visually-hidden/index.js.map +1 -1
- package/dist/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/wizard-layout/index.js.map +1 -1
- package/dist/wizard-layout/wizard-layout.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+E3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAI,GAAG,IAAI,EACX,GAAG,GAAG,OAAO,EACb,OAAO,GAAG,SAAS,EACnB,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACL;IAClB,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE7C;;;;;;;;;OASG;IACH,MAAM,iBAAiB,GAAG,CAAC,OAAiC,EAAE,EAAE;QAC9D,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI;YAAE,aAAa,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO;QACpD,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAmB,qBAAqB,CAAC,EAAE,CAAC;YAC9F,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC;QACxC,CAAC;IACH,CAAC,CAAC;IAEF;;;;OAIG;IACH,MAAM,YAAY,GAChB,KAAK;QACL,CAAC,SAAS,CAAC,C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EnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,wBAAwB,aAElC,KAAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,6BAA6B,YAC9D,IAAI,CAAC,KAAK,GACc,EAC3B,KAAC,eAAe,CAAC,eAAe,KAAG,KAR9B,IAAI,CAAC,KAAK,CASM,CACxB,CAAC;IAEF,OAAO,CACL,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,GAAG,KAAK,SAAS,IAAI,+BAA+B,EACpD,OAAO,KAAK,OAAO,IAAI,yBAAyB,EAChD,SAAS,IAAI,8BAA8B,EAC3C,SAAS,CACV,EACD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,WAAW,EAAC,YAAY,gBACZ,SAAS,aAEpB,YAAY,EACb,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GAAO,IACjD,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { SegmentGroup as ArkSegmentGroup } from '@ark-ui/react/segment-group';\nimport { type ReactNode, useRef } from 'react';\nimport './segment-group.css';\nimport { cx } from '../cx';\n\nexport type SegmentGroupSize = 'sm' | 'md';\n\nexport interface SegmentGroupItem {\n /** Stable value reported by `onValueChange` and compared with `value`. */\n value: string;\n /** Text shown on the segment. Keep it to a word or two; a longer one wraps inside its segment. */\n label: string;\n /** Individually disable this choice without removing it. */\n disabled?: boolean;\n}\n\n/**\n * A segment group has to have a name. A visible `label` is the one to reach\n * for; expressed as a union so an unnamed group is a compile error rather\n * than an axe finding, as `Checkbox` and `Switch` do.\n */\ntype SegmentGroupName =\n | {\n /** Visible label, rendered above the track and naming the group. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the choice is. Keep the visible words in it (\"Period\" →\n * \"Reporting period\"), so a voice user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when the surrounding heading or row already says what the choice is. */\n 'aria-label': string;\n };\n\nexport type SegmentGroupProps = SegmentGroupName & {\n /** The choices, in order. Exactly one is checked. */\n items: SegmentGroupItem[];\n /**\n * Controlled value. `null` is controlled with nothing checked, for a form\n * that starts without a choice; `undefined` leaves the component to own\n * its value from `defaultValue` onward, as `Select` does.\n */\n value?: string | null;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /**\n * Fired with the newly checked value. Choosing the checked segment again\n * does nothing, so a consumer that saves on change never writes twice.\n */\n onValueChange?: (value: string) => void;\n /** Segment height and type scale. `sm` suits a toolbar or a card header. */\n size?: SegmentGroupSize;\n /**\n * How the segments share the track. `equal` (default): every segment as\n * wide as the widest, and a word longer than its column breaks inside it.\n * `content`: each segment as wide as its own label, the spare width shared\n * out, so a group of labels of uneven length fits a narrow container\n * without breaking a word.\n */\n fit?: 'equal' | 'content';\n /**\n * `dense` tightens each segment's inline padding, for a group of many\n * short items (six t-shirt sizes) that has to fit a phone.\n */\n density?: 'default' | 'dense';\n /**\n * Whether the group takes the whole width of its row, the track with it:\n * a state or effort choice in a form, level with the fields above it.\n */\n fullWidth?: boolean;\n /** Disable every segment. The checked one keeps showing which is set. */\n disabled?: boolean;\n /** Name for native form participation through the hidden radio inputs. */\n name?: string;\n /** Extra class names appended after the `ds-segment-group` modifiers. */\n className?: string;\n};\n\n/**\n * One choice among a few, shown as a row of segments, built on Ark UI's\n * SegmentGroup: a radio group whose radios are drawn as one control.\n *\n * Ark owns the behaviour: hidden radio inputs carry the state, the arrow keys\n * move the choice, and the whole segment is its radio's label. This wrapper\n * contributes `ds-` classes, the `--ds-segment-group-*` bindings and a flat\n * `items` API in place of Ark's anatomy.\n *\n * ```tsx\n * <SegmentGroup\n * label=\"Period\"\n * items={[\n * { value: 'today', label: 'Today' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]}\n * value={period}\n * onValueChange={setPeriod}\n * />\n * ```\n *\n * Reach for it when the choices are few, short and all worth seeing at once:\n * a period, a size, a view. More than five, or labels that need a sentence,\n * want a `Select`. Panels that change with the choice are `Tabs`; a segment\n * group changes a value, not what is on the page.\n */\nexport function SegmentGroup({\n label,\n items,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n fit = 'equal',\n density = 'default',\n fullWidth = false,\n disabled,\n name,\n className,\n 'aria-label': ariaLabel,\n}: SegmentGroupProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n\n /*\n * Zag reports `null` only when the value is cleared through its API, which\n * this wrapper never calls; a user can only move the choice to a segment.\n *\n * Ark renders the hidden radios uncontrolled and syncs them only when its\n * own state changes, so a controlled parent that declines a choice would\n * leave the native radio checked while the segment shows the old one.\n * Restoring the parent's value after Ark has read the radios keeps the two\n * agreeing, as Checkbox and Switch do.\n */\n const handleValueChange = (details: { value: string | null }) => {\n if (details.value !== null) onValueChange?.(details.value);\n if (value === undefined || !rootRef.current) return;\n for (const input of rootRef.current.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n input.checked = input.value === value;\n }\n };\n\n /*\n * Zag always names the root by its label part's id, which would outrank an\n * `aria-label`. With both given, the visible label is plain text instead,\n * so that id resolves to nothing and the `aria-label` is what is announced.\n */\n const visibleLabel =\n label &&\n (ariaLabel ? (\n <span className=\"ds-segment-group__label\">{label}</span>\n ) : (\n <ArkSegmentGroup.Label className=\"ds-segment-group__label\">{label}</ArkSegmentGroup.Label>\n ));\n\n const renderItem = (item: SegmentGroupItem) => (\n <ArkSegmentGroup.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n className=\"ds-segment-group__item\"\n >\n <ArkSegmentGroup.ItemText className=\"ds-segment-group__item-text\">\n {item.label}\n </ArkSegmentGroup.ItemText>\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n\n return (\n <ArkSegmentGroup.Root\n ref={rootRef}\n className={cx(\n 'ds-segment-group',\n `ds-segment-group--${size}`,\n fit === 'content' && 'ds-segment-group--fit-content',\n density === 'dense' && 'ds-segment-group--dense',\n fullWidth && 'ds-segment-group--full-width',\n className,\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleValueChange}\n disabled={disabled}\n name={name}\n orientation=\"horizontal\"\n aria-label={ariaLabel}\n >\n {visibleLabel}\n <div className=\"ds-segment-group__track\">{items.map(renderItem)}</div>\n </ArkSegmentGroup.Root>\n );\n}\n"]}
|
package/dist/select/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/select/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/select/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { SelectItem, SelectProps, SelectSize } from './select';\nexport { Select } from './select';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAkB,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,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AsB,YACnD,KAAC,IAAI,IAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC5B,IACJ,GACF,EAEpB,KAAC,MAAM,IAAC,SAAS,EAAE,eAAe,YAChC,KAAC,SAAS,CAAC,UAAU,cACnB,KAAC,SAAS,CAAC,OAAO,IAAC,SAAS,EAAC,oBAAoB,YAC9C,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GACN,GACC,GAChB,EAET,KAAC,SAAS,CAAC,YAAY,KAAG,IACX,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { Portal } from '@ark-ui/react/portal';\nimport { Select as ArkSelect, createListCollection } from '@ark-ui/react/select';\nimport { type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { PortalContainerContext } from '../portal-container';\nimport './select.css';\nimport { cx } from '../cx';\nimport { Check, ChevronRight } from '../fallback-glyphs';\nimport { groupItems, type ItemGroup } from '../group-items';\n\nexport type SelectSize = 'sm' | 'md' | 'lg';\n\nexport interface SelectItem {\n /** Stable value submitted and compared. */\n value: string;\n /** Text shown in the list and in the trigger once chosen. */\n label: string;\n /**\n * Optional secondary line under the label in the list, shown muted, such as\n * the category a project is filed under. Part of the option's name. On a\n * highlighted row it takes the row's text colour, which the muted colour\n * was never measured against.\n */\n description?: string;\n /**\n * Decorative mark before the label, in the list and in the trigger once\n * chosen: a category's colour dot or its glyph. The label carries the\n * meaning, so mark it `aria-hidden` or decorative.\n */\n icon?: ReactNode;\n /**\n * The group the option is listed under, by its heading. Options sharing a\n * group are listed together under it, groups in the order they first\n * appear; options without one (or with an empty name) are listed before\n * any group. Same rule as `ComboboxItem.group`.\n */\n group?: string;\n /** Individually disable this option without removing it. */\n disabled?: boolean;\n}\n\nexport interface SelectProps {\n /** Options to choose from. */\n items: SelectItem[];\n /**\n * Visible label. Strongly preferred over `aria-label` — a visible label\n * helps everyone, not only screen reader users, and gives the control a\n * larger hit area.\n */\n label?: ReactNode;\n /** Text shown before anything is chosen. */\n placeholder?: string;\n /**\n * Controlled value.\n *\n * Three states, and the difference between the last two matters:\n * - a string — that option is selected;\n * - `null` — controlled, with nothing selected. The trigger shows the\n * `placeholder`. Use this to reset the field programmatically;\n * - `undefined` — **uncontrolled**. The component owns its own value, from\n * `defaultValue` onward.\n *\n * Passing `undefined` to clear a controlled Select would silently hand\n * ownership back to the component mid-life, which React warns about and\n * which leaves the old selection on screen. Pass `null` instead.\n *\n * A value with no matching entry in `items` — a category deleted since it\n * was stored — is treated as `null` rather than as a selection, so the\n * trigger and the submitted form value agree that nothing is chosen.\n */\n value?: string | null;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /**\n * Fired with the newly selected value, or `undefined` when the selection is\n * emptied.\n *\n * `undefined` is reachable by exactly one route, and it is not the obvious\n * one. Ark's `deselectable` behaviour — click the selected row to unselect\n * it — is deliberately **not** enabled: a filter that needs an empty state\n * should offer it as a real option (\"All categories\") rather than as a\n * second, invisible way to reach the same place.\n *\n * What does empty the value is a native **form reset**. Ark tracks the\n * enclosing form unconditionally and restores the initial value on reset,\n * which for a Select mounted without a `defaultValue` is nothing selected.\n * Handle `undefined` if this Select lives in a resettable form; a consumer\n * that mirrors the value into its own state and ignores the empty payload\n * will keep showing a selection the control no longer has.\n */\n onValueChange?: (value: string | undefined) => void;\n /** Control height and type scale. */\n size?: SelectSize;\n /** Disable the whole control. */\n disabled?: boolean;\n /**\n * Options are still being fetched.\n *\n * Renders the control inert with `aria-busy`, so it cannot be opened onto\n * an empty list. Prefer this over passing `items={[]}` while a query is in\n * flight — an empty dropdown reads as \"no options exist\", which is a\n * different and wrong message.\n */\n loading?: boolean;\n /** Text shown in place of the placeholder while `loading`. */\n loadingText?: string;\n /** Marks the field invalid for assistive tech and styling. */\n invalid?: boolean;\n /** Name for native form participation. */\n name?: string;\n /** Extra class names appended after `ds-select` modifiers. */\n className?: string;\n /**\n * Render an option's content. Defaults to its `label`.\n *\n * The escape hatch for rows that `icon` and `description` don't cover.\n * Whatever you return must still convey the option in text; do not return\n * colour or an icon alone. It replaces the label, icon and description in\n * the list, not in the trigger.\n */\n renderItem?: (item: SelectItem) => ReactNode;\n /**\n * Glyph for the trigger's open/close affordance.\n *\n * Must point RIGHT — the component rotates it down when closed and up when\n * open, so one glyph serves both states. Pass `ChevronRight`, not a\n * `ChevronDown`: the slot turns what it is given.\n *\n * Defaults to a plain built-in chevron so `@manakind/ui-core` installs and\n * renders on its own. Products override it with their own icon set.\n */\n indicator?: IconSource;\n /** Glyph marking the selected option. Same defaulting rule as {@link SelectProps.indicator}. */\n itemIndicator?: IconSource;\n /** Accessible name when no visible `label` is supplied. */\n 'aria-label'?: string;\n}\n\nfunction ItemContent({ item }: { item: SelectItem }) {\n return (\n <span className=\"ds-select__item-content\">\n {item.icon && <span className=\"ds-select__item-icon\">{item.icon}</span>}\n <span className=\"ds-select__item-text\">\n <span>{item.label}</span>\n {item.description && (\n <>\n {' '}\n <span className=\"ds-select__item-description\">{item.description}</span>\n </>\n )}\n </span>\n </span>\n );\n}\n\n// The trigger shows a chosen option's icon too. Without one it returns\n// nothing, so Ark falls back to the label or the placeholder.\nfunction chosenWithIcon(item: SelectItem | undefined): ReactNode {\n if (!item?.icon) return undefined;\n return (\n <span className=\"ds-select__item-content\">\n <span className=\"ds-select__item-icon\">{item.icon}</span>\n <span>{item.label}</span>\n </span>\n );\n}\n\n/**\n * Single-select dropdown, built on Ark UI.\n *\n * Ark owns the hard parts: listbox semantics, typeahead, keyboard\n * navigation, focus return on close, and dismiss behaviour. This wrapper\n * contributes `ds-` classes, the `--ds-select-*` bindings, and a flat\n * `items` API in place of Ark's lower-level collection anatomy.\n *\n * ```tsx\n * <Select\n * label=\"Category\"\n * placeholder=\"Filter by category\"\n * items={[{ value: 'all', label: 'All Categories' }]}\n * value={selected}\n * onValueChange={setSelected}\n * />\n * ```\n *\n * Give it a `label` or an `aria-label` — a select with neither is announced\n * as an unnamed combobox. Options can carry a leading `icon`, a muted\n * `description` line and a `group` heading; for multi-select, compose Ark's\n * anatomy directly in a product package rather than widening this API.\n *\n * The listbox renders in a portal, so it escapes ancestor `overflow: hidden`\n * rather than being clipped inside a card. It sits at `z-index: 60`, a step\n * above the products' overlay layer (50), so it paints above the page or\n * dialog it opens from. Inside a ui-core `Dialog` it portals into the\n * dialog's panel instead of `<body>`, so the modal does not hide it from\n * assistive tech.\n */\nexport function Select({\n items,\n label,\n placeholder,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n disabled,\n loading = false,\n loadingText = 'Loading…',\n invalid,\n name,\n className,\n renderItem,\n indicator = ChevronRight,\n itemIndicator = Check,\n 'aria-label': ariaLabel,\n}: SelectProps) {\n // The collection holds the options in drawn order, so arrows, typeahead and\n // the hidden native select all follow the list on screen.\n const groups = useMemo(() => groupItems(items), [items]);\n const collection = useMemo(\n () =>\n createListCollection({\n items: groups.flatMap((group) => group.items),\n itemToValue: (item) => item.value,\n itemToString: (item) => item.label,\n isItemDisabled: (item) => item.disabled ?? false,\n }),\n [groups],\n );\n\n /*\n * A controlled value that no longer matches an option resolves to empty, so\n * the trigger and the form agree about it.\n *\n * Left unresolved they disagree: the trigger already falls back to the\n * placeholder (Ark drives that off whether a value is *set*, not whether it\n * *resolves*), but the hidden native select ends up with no option marked\n * selected — and a single `<select>` in that state reports its **first**\n * option. Measured: with the value `deleted-category`, the field submits\n * `all`. Reading the placeholder and posting a real, different value is the\n * worse half of the mismatch, and it is silent.\n */\n const controlledValue = useMemo(() => {\n if (value === undefined) return undefined;\n if (value === null) return [];\n return items.some((item) => item.value === value) ? [value] : [];\n }, [value, items]);\n\n // Same resolution for the uncontrolled path: an unresolvable `defaultValue`\n // produces the identical trigger-says-placeholder / form-submits-`all` split.\n const initialValue = useMemo(() => {\n if (defaultValue === undefined) return undefined;\n return items.some((item) => item.value === defaultValue) ? [defaultValue] : [];\n }, [defaultValue, items]);\n\n const portalContainer = useContext(PortalContainerContext);\n\n const handleValueChange = useCallback(\n (details: { value: string[] }) => onValueChange?.(details.value[0]),\n [onValueChange],\n );\n\n const renderOption = (item: SelectItem) => (\n <ArkSelect.Item key={item.value} item={item} className=\"ds-select__item\">\n <ArkSelect.ItemText>\n {renderItem ? renderItem(item) : <ItemContent item={item} />}\n </ArkSelect.ItemText>\n <ArkSelect.ItemIndicator className=\"ds-select__item-indicator\">\n <Icon source={itemIndicator} size=\"sm\" decorative />\n </ArkSelect.ItemIndicator>\n </ArkSelect.Item>\n );\n\n const renderGroup = (group: ItemGroup<SelectItem>) =>\n group.label === undefined ? (\n group.items.map(renderOption)\n ) : (\n <ArkSelect.ItemGroup key={group.label} className=\"ds-select__group\">\n <ArkSelect.ItemGroupLabel className=\"ds-select__group-label\">\n {group.label}\n </ArkSelect.ItemGroupLabel>\n {group.items.map(renderOption)}\n </ArkSelect.ItemGroup>\n );\n\n return (\n <ArkSelect.Root\n collection={collection}\n className={cx('ds-select', `ds-select--${size}`, className)}\n value={controlledValue}\n defaultValue={initialValue}\n onValueChange={handleValueChange}\n disabled={disabled || loading}\n invalid={invalid}\n name={name}\n positioning={{ sameWidth: true }}\n >\n {label && <ArkSelect.Label className=\"ds-select__label\">{label}</ArkSelect.Label>}\n\n <ArkSelect.Control>\n <ArkSelect.Trigger\n className=\"ds-select__trigger\"\n aria-label={ariaLabel}\n aria-busy={loading || undefined}\n >\n <ArkSelect.Context<SelectItem>>\n {(select) => (\n <ArkSelect.ValueText\n placeholder={loading ? loadingText : placeholder}\n className=\"ds-select__value-text\"\n >\n {chosenWithIcon(select.selectedItems[0])}\n </ArkSelect.ValueText>\n )}\n </ArkSelect.Context>\n <ArkSelect.Indicator className=\"ds-select__indicator\">\n <Icon source={indicator} size=\"sm\" decorative />\n </ArkSelect.Indicator>\n </ArkSelect.Trigger>\n </ArkSelect.Control>\n\n <Portal container={portalContainer}>\n <ArkSelect.Positioner>\n <ArkSelect.Content className=\"ds-select__content\">\n {groups.map(renderGroup)}\n </ArkSelect.Content>\n </ArkSelect.Positioner>\n </Portal>\n\n <ArkSelect.HiddenSelect />\n </ArkSelect.Root>\n );\n}\n"]}
|
package/dist/show/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/show/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/show/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { ShowProps } from './show';\nexport { Show } from './show';\n"]}
|
package/dist/show/show.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/show/show.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAqB3B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACtF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CACX,SAAS,EACT,CAAC,OAAO,IAAI,kBAAkB,EAC9B,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/show/show.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAqB3B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACtF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CACX,SAAS,EACT,CAAC,OAAO,IAAI,kBAAkB,EAC9B,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './show.css';\nimport { cx } from '../cx';\nimport type { Breakpoint } from '../layout/layout';\n\n/**\n * Exactly one of `above` or `below`: an element shown at every width would\n * need no `Show`, and one hidden at every width would be `hidden`.\n */\ntype ShowRange =\n | {\n /** Show from this viewport step up; hidden on narrower viewports. */\n above: Breakpoint;\n below?: never;\n }\n | {\n above?: never;\n /** Show on viewports narrower than this step; hidden from it up. */\n below: Breakpoint;\n };\n\nexport type ShowProps = ComponentProps<typeof ark.div> & ShowRange;\n\n/**\n * Children that exist only on one side of a breakpoint.\n *\n * A full navigation above `md` and a menu button below it; a sidebar that\n * has no room on a phone. Both sides stay in the DOM and are hidden with\n * `display: none`, so the hidden side is out of the accessibility tree and\n * the tab order too. The breakpoints are the viewport tokens.\n *\n * Renders a wrapper `div` that takes no part in layout (`display: contents`),\n * so the children sit in their parent's grid or flex as if the wrapper were\n * not there. Pass `asChild` to put the behaviour on your own element instead\n * (`<Show above=\"md\" asChild><nav>…</nav></Show>`); the hiding rule outranks a\n * `display` the element's own layered stylesheet sets, but not one set\n * outside every cascade layer, so keep the wrapper for such an element.\n */\nexport function Show({ above, below, asChild, className, children, ...props }: ShowProps) {\n return (\n <ark.div\n asChild={asChild}\n className={cx(\n 'ds-show',\n !asChild && 'ds-show--wrapper',\n above && `ds-show--above-${above}`,\n below && `ds-show--below-${below}`,\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skeleton/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skeleton/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export type { SkeletonProps, SkeletonShape } from './skeleton';\nexport { Skeleton } from './skeleton';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../src/skeleton/skeleton.tsx"],"names":[],"mappings":";AACA,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,GAAG,OAAO,EACf,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACM;IACd,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5C,IAAI,MAAM,KAAK,SAAS;QAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAC/C,OAAO,CACL,6BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,KAAK,EAAE,EAAE,SAAS,CAAC,EAChE,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../src/skeleton/skeleton.tsx"],"names":[],"mappings":";AACA,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,GAAG,OAAO,EACf,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACM;IACd,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5C,IAAI,MAAM,KAAK,SAAS;QAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAC/C,OAAO,CACL,6BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,KAAK,EAAE,EAAE,SAAS,CAAC,EAChE,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps, CSSProperties } from 'react';\nimport './skeleton.css';\nimport { cx } from '../cx';\n\n/**\n * `block` is a rounded rectangle for a card or an image; `text` a line of\n * text, one line-height tall; `circle` an avatar.\n */\nexport type SkeletonShape = 'block' | 'text' | 'circle';\n\nexport interface SkeletonProps extends ComponentProps<'div'> {\n /** Defaults to `block`. */\n shape?: SkeletonShape;\n /** A CSS length, or a number of pixels. A `text` skeleton is as wide as its container unless told otherwise. */\n width?: number | string;\n /** A CSS length, or a number of pixels. `text` and `circle` have a height of their own. */\n height?: number | string;\n}\n\n/**\n * A placeholder for content still loading.\n *\n * The pulse, the fill and the corner radius are the component's; the size\n * and placement are the caller's, through `width`, `height` or the parent's\n * layout. Hidden from assistive technology: the region that is loading says\n * so with `aria-busy`, which announces once, rather than each placeholder\n * announcing nothing.\n */\nexport function Skeleton({\n shape = 'block',\n width,\n height,\n className,\n style,\n ...props\n}: SkeletonProps) {\n const size: CSSProperties = {};\n if (width !== undefined) size.width = width;\n if (height !== undefined) size.height = height;\n return (\n <div\n aria-hidden=\"true\"\n className={cx('ds-skeleton', `ds-skeleton--${shape}`, className)}\n style={{ ...size, ...style }}\n {...props}\n />\n );\n}\n"]}
|
package/dist/slider/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/slider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/slider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { SliderProps } from './slider';\nexport { Slider } from './slider';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../src/slider/slider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA2B3B;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,KAAK,EACL,KAAK,EACL,aAAa,EACb,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,GAAG,EACT,IAAI,GAAG,CAAC,EACR,WAAW,GAAG,MAAM,EACpB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,kBAAkB,EAAE,WAAW,GACnB;IACZ,OAAO,CACL,MAAC,SAAS,CAAC,IAAI,IACb,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EACrC,KAAK,EAAE,CAAC,KAAK,CAAC,EACd,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,aAA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I,GACrB,IACA,IACL,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { Slider as ArkSlider } from '@ark-ui/react/slider';\nimport type { ReactNode } from 'react';\nimport './slider.css';\nimport { cx } from '../cx';\n\nexport interface SliderProps {\n /** Visible name, also announced for the thumb. */\n label: ReactNode;\n /** Controlled value of this single-thumb slider. */\n value: number;\n /** Fired for pointer and keyboard changes, clamped to the range. */\n onValueChange: (value: number) => void;\n /** Lower bound. Defaults to zero. */\n min?: number;\n /** Upper bound. Defaults to one hundred. */\n max?: number;\n /** Increment, including fractional steps. Defaults to one. */\n step?: number;\n /** Human-readable value for the label and assistive technology. */\n formatValue?: (value: number) => string;\n /** Disable pointer and keyboard changes. */\n disabled?: boolean;\n /** Name of the hidden form input. */\n name?: string;\n /** Description or error elsewhere on the page. */\n 'aria-describedby'?: string;\n /** Extra classes on the slider's root. */\n className?: string;\n}\n\n/**\n * A single continuous setting, such as a source weight, built on Ark UI.\n * Ark owns pointer dragging, arrow/Home/End keys, range bounds and ARIA value\n * semantics. The visible label names the thumb; the hidden input participates\n * in forms. Use an Input when an exact number is easier to type than tune.\n */\nexport function Slider({\n label,\n value,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n formatValue = String,\n disabled,\n name,\n className,\n 'aria-describedby': describedBy,\n}: SliderProps) {\n return (\n <ArkSlider.Root\n className={cx('ds-slider', className)}\n value={[value]}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n onValueChange={({ value: next }) => onValueChange(next[0] ?? min)}\n getAriaValueText={({ value: current }) => formatValue(current)}\n >\n <div className=\"ds-slider__header\">\n <ArkSlider.Label className=\"ds-slider__label\">{label}</ArkSlider.Label>\n <ArkSlider.Context>\n {(slider) => (\n <span className=\"ds-slider__value\" aria-hidden=\"true\">\n {formatValue(slider.value[0] ?? min)}\n </span>\n )}\n </ArkSlider.Context>\n </div>\n <ArkSlider.Control className=\"ds-slider__control\">\n <ArkSlider.Track className=\"ds-slider__track\">\n <ArkSlider.Range className=\"ds-slider__range\" />\n </ArkSlider.Track>\n <ArkSlider.Thumb index={0} className=\"ds-slider__thumb\" aria-describedby={describedBy}>\n <ArkSlider.HiddenInput name={name} />\n </ArkSlider.Thumb>\n </ArkSlider.Control>\n </ArkSlider.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spinner/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spinner/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type { SpinnerProps, SpinnerSize } from './spinner';\nexport { Spinner } from './spinner';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/spinner/spinner.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAgBpE;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC/E,OAAO,CACL,cACE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,iBACrB,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EACvC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,eAAe,IAAI,EAAE,EAAE,SAAS,CAAC,KACzD,KAAK,YAER,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,cAAE,KAAK,GAAkB,CAAC,CAAC,CAAC,IAAI,GACpD,CACP,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/spinner/spinner.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAgBpE;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC/E,OAAO,CACL,cACE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,iBACrB,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EACvC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,eAAe,IAAI,EAAE,EAAE,SAAS,CAAC,KACzD,KAAK,YAER,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,cAAE,KAAK,GAAkB,CAAC,CAAC,CAAC,IAAI,GACpD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps } from 'react';\nimport './spinner.css';\nimport { cx } from '../cx';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\n\n/** The spinner's diameter: inside a control (sm), beside text (md), on its own in a region (lg). */\nexport type SpinnerSize = 'sm' | 'md' | 'lg';\n\nexport interface SpinnerProps extends ComponentProps<'div'> {\n /** Defaults to `md`. */\n size?: SpinnerSize;\n /**\n * What is loading, announced once as a status (\"Loading goals\"). Without\n * it the spinner is hidden from assistive technology, for a region that\n * already says it is busy (`aria-busy`) or a button that is `loading`.\n */\n label?: string;\n}\n\n/**\n * The turning ring that says something is on its way.\n *\n * For a route or region still loading with nothing to show yet; a region\n * that has a shape to promise uses `Skeleton` instead, and a button its own\n * `loading`. The ring takes the spinner colour from the contract and keeps\n * turning under `prefers-reduced-motion`, since a still ring would say the\n * wait is over.\n */\nexport function Spinner({ size = 'md', label, className, ...props }: SpinnerProps) {\n return (\n <div\n role={label ? 'status' : undefined}\n aria-hidden={label ? undefined : 'true'}\n className={cx('ds-spinner', `ds-spinner--${size}`, className)}\n {...props}\n >\n {label ? <VisuallyHidden>{label}</VisuallyHidden> : null}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export type { SplitAsideProps, SplitLayoutProps, SplitMainProps } from './split-layout';\nexport { SplitAside, SplitLayout, SplitMain } from './split-layout';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-layout.js","sourceRoot":"","sources":["../../src/split-layout/split-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAe3B;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,aAAa,GAAG,IAAI,EACpB,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,KAAK,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS;IACjB,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,iBAAiB,EACjB,6BAA6B,aAAa,EAAE,EAC5C,0BAA0B,UAAU,EAAE,EACtC,0BAA0B,aAAa,EAAE,EACzC,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,qFAAqF;AACrF,MA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AAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAAM,KAAK,YAClE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,8FAA8F;AAC9F,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACC,CACb,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './split-layout.css';\nimport { cx } from '../cx';\nimport type { Breakpoint, ContentWidth } from '../layout/layout';\n\nexport interface SplitLayoutProps extends ComponentProps<typeof ark.div> {\n /**\n * The viewport step from which the two regions sit side by side; below it\n * they stack, main first. Defaults to `lg`.\n */\n collapseBelow?: Exclude<Breakpoint, 'xl'>;\n /** The aside's width when side by side: a content width step. Defaults to `sm`. */\n asideWidth?: Exclude<ContentWidth, 'lg' | 'xl'>;\n /** Which side the aside takes when side by side. Defaults to `end`. */\n asidePosition?: 'start' | 'end';\n}\n\n/**\n * A main region with an aside: content and its filters, a detail and its\n * facts, a list and a summary.\n *\n * Side by side from `collapseBelow` up, with the aside at a fixed content\n * width and the main region taking the rest; stacked on a narrower viewport\n * with the main region first in reading order whatever side the aside\n * takes. Compose with {@link SplitMain} and {@link SplitAside}.\n */\nexport function SplitLayout({\n collapseBelow = 'lg',\n asideWidth = 'sm',\n asidePosition = 'end',\n className,\n children,\n ...props\n}: SplitLayoutProps) {\n return (\n <ark.div\n className={cx(\n 'ds-split-layout',\n `ds-split-layout--collapse-${collapseBelow}`,\n `ds-split-layout--aside-${asideWidth}`,\n `ds-split-layout--aside-${asidePosition}`,\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\nexport type SplitMainProps = ComponentProps<typeof ark.div>;\n\n/** The main region. Pass `asChild` to make it a landmark (`<main>`, `<section>`). */\nexport function SplitMain({ className, children, ...props }: SplitMainProps) {\n return (\n <ark.div className={cx('ds-split-layout__main', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n\nexport type SplitAsideProps = ComponentProps<typeof ark.aside>;\n\n/** The aside. Renders an `aside`; name it with `aria-label` when a page has more than one. */\nexport function SplitAside({ className, children, ...props }: SplitAsideProps) {\n return (\n <ark.aside className={cx('ds-split-layout__aside', className)} {...props}>\n {children}\n </ark.aside>\n );\n}\n"]}
|
package/dist/sticky/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sticky/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sticky/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { StickyEdge, StickyProps, StickySurface } from './sticky';\nexport { Sticky } from './sticky';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/sticky/sticky.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmC3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,KAAK,EACd,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,OAAO,GAAG,MAAM,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,WAAW,EACX,cAAc,IAAI,EAAE,EACpB,MAAM,IAAI,mBAAmB,EAC7B,IAAI,IAAI,mBAAmB,IAAI,EAAE,EACjC,MAAM,IAAI,mBAAmB,EAC7B,OAAO,KAAK,MAAM,IAAI,sBAAsB,OAAO,EAAE,EACrD,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/sticky/sticky.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmC3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,KAAK,EACd,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,OAAO,GAAG,MAAM,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,WAAW,EACX,cAAc,IAAI,EAAE,EACpB,MAAM,IAAI,mBAAmB,EAC7B,IAAI,IAAI,mBAAmB,IAAI,EAAE,EACjC,MAAM,IAAI,mBAAmB,EAC7B,OAAO,KAAK,MAAM,IAAI,sBAAsB,OAAO,EAAE,EACrD,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './sticky.css';\nimport { cx } from '../cx';\nimport type { Breakpoint } from '../layout/layout';\n\n/** The viewport edge a sticky element holds to while the page scrolls past it. */\nexport type StickyEdge = 'top' | 'bottom';\n\n/**\n * What a sticky element paints behind itself. `none` leaves the children\n * to draw their own surface (a card); `canvas` paints the page's canvas so\n * content scrolling under it is covered, with the bar's block inset;\n * `raised` is the chrome's surface with a hairline and shadow on the side\n * facing the page.\n */\nexport type StickySurface = 'none' | 'canvas' | 'raised';\n\nexport interface StickyProps extends ComponentProps<typeof ark.div> {\n /** The edge it holds to. Defaults to `top`. */\n edge?: StickyEdge;\n /**\n * Keep clear of the app's chrome: under the header at the top\n * (`--ds-sticky-offset-top`), above the viewport's edge at the bottom\n * (`--ds-sticky-offset-bottom`). Off by default, for the header itself.\n */\n offset?: boolean;\n /** Stick only from this viewport step up; stay in the flow on narrower viewports. */\n from?: Breakpoint;\n /**\n * Scroll inside its own box when taller than the room it holds, instead\n * of pushing past the viewport: a pinned aside longer than the screen.\n */\n scroll?: boolean;\n /** What it paints behind itself. Defaults to `none`. */\n surface?: StickySurface;\n}\n\n/**\n * An element that holds to an edge of the viewport while the page scrolls\n * past it: the app's header, a filter row under it, a bar of bulk actions\n * at the foot of a list, an aside pinned beside a long form.\n *\n * Sticky, never fixed, so it stays in the page's flow and column: a bottom\n * bar at the end of a page floats above the rows while they scroll and\n * settles into its own place when the page ends, with nothing to clear.\n * Sits on the `sticky` stacking layer, above the page's raised controls\n * and below every overlay. Renders a `div`; pass `asChild` to stick your\n * own element (`<Sticky asChild><header>…</header></Sticky>`).\n */\nexport function Sticky({\n edge = 'top',\n offset = false,\n from,\n scroll = false,\n surface = 'none',\n className,\n children,\n ...props\n}: StickyProps) {\n return (\n <ark.div\n className={cx(\n 'ds-sticky',\n `ds-sticky--${edge}`,\n offset && 'ds-sticky--offset',\n from && `ds-sticky--from-${from}`,\n scroll && 'ds-sticky--scroll',\n surface !== 'none' && `ds-sticky--surface-${surface}`,\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n"]}
|
package/dist/switch/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/switch/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/switch/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { SwitchLabelPlacement, SwitchProps, SwitchSize } from './switch';\nexport { Switch } from './switch';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/switch/switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAkB,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkE3B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,KAAK,EACL,cAAc,GAAG,KAAK,EACtB,OAAO,EACP,cAAc,EACd,eAAe,EACf,IAAI,GAAG,IAAI,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,kBAAkB,EAAE,eAAe,GACvB;IACZ;;;;;OAKG;IACH,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CACxB,SAAS,CAAC,CAAC,CAAC,CACV,eAAM,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAQ,CAClD,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,CAAC,KAAK,IAAC,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAmB,CACxE,CACF,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEhD,uEAAuE;IACvE,+CAA+C;IAC/C,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC;IACtB,MAAM,GAAG,GAAG,EAAE,WAAW,EAAE,GAAG,KAAK,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,QAAQ,E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AE,EAAE,SAAS,CAAC,EAC3D,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,mBAAmB,EACpC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,aAEX,cAAc,KAAK,OAAO,IAAI,SAAS,EACxC,KAAC,SAAS,CAAC,OAAO,IAAC,SAAS,EAAC,oBAAoB,YAC/C,KAAC,SAAS,CAAC,KAAK,IAAC,SAAS,EAAC,kBAAkB,GAAG,GAC9B,EACnB,cAAc,KAAK,KAAK,IAAI,SAAS,EACtC,KAAC,SAAS,CAAC,WAAW,IACpB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACD,SAAS,sBACH,eAAe,mBAClB,QAAQ,IAAI,SAAS,GACpC,IACa,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { Switch as ArkSwitch } from '@ark-ui/react/switch';\nimport { type ReactNode, useId, useRef } from 'react';\nimport './switch.css';\nimport { cx } from '../cx';\n\nexport type SwitchSize = 'sm' | 'md' | 'lg';\n\nexport type SwitchLabelPlacement = 'start' | 'end';\n\n/**\n * A switch has to have a name. A visible `label` is the one to reach for: the\n * whole label is the click target, so it also enlarges the hit area. Expressed\n * as a union so an unnamed switch is a compile error rather than an axe\n * finding, the way `IconProps` pairs label and decorative.\n */\ntype SwitchName =\n | {\n /** Visible label. The whole label is the click target. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the control is. Keep the visible words in it, so a voice\n * user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when no visible label fits, such as a table cell whose row already says what the switch is. */\n 'aria-label': string;\n };\n\nexport type SwitchProps = SwitchName & {\n /**\n * Which side of the control the label sits on. `end` (default) reads\n * \"control, then what it does\"; `start` puts the label first, for a\n * settings row. Only the order changes; the row's layout is the caller's.\n */\n labelPlacement?: SwitchLabelPlacement;\n /** Controlled checked state. Leave undefined to let the component own it. */\n checked?: boolean;\n /** Initial state when uncontrolled. */\n defaultChecked?: boolean;\n /** Fired with the new state whenever the user toggles the switch. */\n onCheckedChange?: (checked: boolean) => void;\n /** Control size and label type scale. */\n size?: SwitchSize;\n /** Disable the control. It keeps its state and stops responding. */\n disabled?: boolean;\n /**\n * Marks the control invalid for assistive tech and styling (`data-invalid`).\n * Pair it with a message the control points at through `aria-describedby`;\n * a red border alone is not an accessible error.\n */\n invalid?: boolean;\n /** Id of the element that describes the control, such as an error message. */\n 'aria-describedby'?: string;\n /** Show the state without letting the user change it. */\n readOnly?: boolean;\n /** Marks the hidden input required for native form validation. */\n required?: boolean;\n /** Name for native form participation. */\n name?: string;\n /** Value submitted under `name` while checked. Defaults to `on`. */\n value?: string;\n /** Extra class names appended after the `ds-switch` modifiers. */\n className?: string;\n};\n\n/**\n * On/off control for a setting that takes effect at once, built on Ark UI.\n *\n * Ark owns the behaviour: a hidden checkbox carries the checked state, the\n * root is the `<label>` that names it, and keyboard (Space) and pointer\n * toggling come for free. The input is given `role=\"switch\"` and\n * `aria-readonly` here, which Ark leaves off, so it is announced as a switch\n * rather than a checkbox, and a read-only one says so. This wrapper contributes `ds-`\n * classes, the `--ds-switch-*` bindings, and a flat prop API.\n *\n * ```tsx\n * <Switch label=\"Gap view\" checked={gapView} onCheckedChange={setGapView} />\n * ```\n *\n * A switch is for a setting that applies immediately. A choice that is only\n * saved on submit is a checkbox; a choice between several values is a select\n * or a segmented control.\n */\nexport function Switch({\n label,\n labelPlacement = 'end',\n checked,\n defaultChecked,\n onCheckedChange,\n size = 'md',\n disabled,\n invalid,\n readOnly,\n required,\n name,\n value,\n className,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n}: SwitchProps) {\n /*\n * Zag always names the hidden input by its label part's id, which would\n * outrank an `aria-label`. With both given, the visible label is plain\n * text instead, so that id resolves to nothing and the `aria-label` wins;\n * the root is still the `<label>`, so the text stays the click target.\n */\n const labelNode = label ? (\n ariaLabel ? (\n <span className=\"ds-switch__label\">{label}</span>\n ) : (\n <ArkSwitch.Label className=\"ds-switch__label\">{label}</ArkSwitch.Label>\n )\n ) : null;\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Own ids, as Checkbox: a switch names itself, and two switches in one\n // Field must not share the field's control id.\n const ownId = useId();\n const ids = { hiddenInput: `${ownId}:input`, label: `${ownId}:label` };\n\n /*\n * Ark renders the hidden input uncontrolled (`defaultChecked`) and syncs it\n * only when its own state changes. A controlled parent that declines a\n * toggle therefore leaves the native input flipped while the control shows\n * the old state, and assistive tech reads the input. Ark reports the toggle\n * after reading the input, so restoring the parent's value here is safe:\n * a parent that accepts re-renders, and Ark syncs the input again.\n */\n const handleCheckedChange = (details: { checked: boolean }) => {\n onCheckedChange?.(details.checked);\n if (checked !== undefined && inputRef.current) inputRef.current.checked = checked;\n };\n\n return (\n <ArkSwitch.Root\n ids={ids}\n className={cx('ds-switch', `ds-switch--${size}`, className)}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n >\n {labelPlacement === 'start' && labelNode}\n <ArkSwitch.Control className=\"ds-switch__control\">\n <ArkSwitch.Thumb className=\"ds-switch__thumb\" />\n </ArkSwitch.Control>\n {labelPlacement === 'end' && labelNode}\n <ArkSwitch.HiddenInput\n ref={inputRef}\n role=\"switch\"\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-readonly={readOnly || undefined}\n />\n </ArkSwitch.Root>\n );\n}\n"]}
|
package/dist/tabs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tabs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tabs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps } from './tabs';\nexport { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs';\n"]}
|
package/dist/tabs/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IAC/D,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,KAAM,KAAK,YACzD,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC;AAUD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiB;IACvF,OAAO,CACL,cAAK,SAAS,EAAC,gBAAgB,YAC7B,cAAK,SAAS,EAAC,mBAAmB,YAChC,KAAC,OAAO,CAAC,IAAI,IACX,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,MAAM,IAAI,uBAAuB,EAAE,SAAS,CAAC,KACxE,KAAK,YAER,QAAQ,GACI,GACX,GACF,CACP,CAAC;AACJ,CAAC;AAID;;;;GAIG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AAC,eAAe,EAAE,MAAM,IAAI,uBAAuB,EAAE,SAAS,CAAC,KACxE,KAAK,YAER,QAAQ,GACI,GACX,GACF,CACP,CAAC;AACJ,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,OAAO,CAAC,OAAO,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACO,CACnB,CAAC;AACJ,CAAC;AAID,qEAAqE;AACrE,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,OAAO,CAAC,OAAO,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACO,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { Tabs as ArkTabs } from '@ark-ui/react/tabs';\nimport type { ComponentProps } from 'react';\nimport './tabs.css';\nimport { cx } from '../cx';\n\nexport type TabsProps = ComponentProps<typeof ArkTabs.Root>;\n\n/**\n * Tabbed disclosure built on Ark UI.\n *\n * Ark supplies the behaviour that is easy to get wrong by hand: roving\n * tabindex, arrow-key navigation, `aria-controls`/`aria-labelledby` wiring\n * between triggers and panels, and activation mode. This wrapper contributes\n * only `ds-` class names and the `--ds-tabs-*` token bindings.\n *\n * Use as a compound component:\n *\n * ```tsx\n * <Tabs defaultValue=\"weekly\">\n * <TabsList aria-label=\"Goal timeframe\">\n * <TabsTrigger value=\"weekly\">Weekly</TabsTrigger>\n * <TabsTrigger value=\"quarterly\">Quarterly</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"weekly\">…</TabsContent>\n * <TabsContent value=\"quarterly\">…</TabsContent>\n * </Tabs>\n * ```\n *\n * Pass `activationMode=\"manual\"` when panel content is expensive — arrow keys\n * then move focus without switching panels until Enter or Space.\n */\nexport function Tabs({ className, children, ...props }: TabsProps) {\n return (\n <ArkTabs.Root className={cx('ds-tabs', className)} {...props}>\n {children}\n </ArkTabs.Root>\n );\n}\n\nexport interface TabsListProps extends ComponentProps<typeof ArkTabs.List> {\n /**\n * Distribute triggers evenly across the full width instead of sizing them\n * to their content. Matches the segmented-control look.\n */\n fitted?: boolean;\n}\n\n/**\n * Container for the tab triggers. Renders with `role=\"tablist\"`.\n *\n * Always give this an `aria-label` (or `aria-labelledby`) when the page has\n * more than one tablist — screen reader users otherwise get several\n * indistinguishable \"tab list\" landmarks.\n *\n * When the triggers need more room than the list has, the list scrolls\n * sideways inside its own box instead of widening the page. Focusing a\n * trigger, by Tab or by arrow key, brings it into view.\n *\n * The two elements around the list exist for the focus ring, which reaches\n * past the list's edge. The scroller is that much larger than the list, so\n * scrolling does not clip the ring; the frame keeps the scroller's extra size\n * from widening whatever the tabs sit in. `tabs.css` has the arithmetic.\n */\nexport function TabsList({ fitted = false, className, children, ...props }: TabsListProps) {\n return (\n <div className=\"ds-tabs__frame\">\n <div className=\"ds-tabs__scroller\">\n <ArkTabs.List\n className={cx('ds-tabs__list', fitted && 'ds-tabs__list--fitted', className)}\n {...props}\n >\n {children}\n </ArkTabs.List>\n </div>\n </div>\n );\n}\n\nexport type TabsTriggerProps = ComponentProps<typeof ArkTabs.Trigger>;\n\n/**\n * A single tab. `value` must match the `value` of its {@link TabsContent}.\n *\n * Disabled triggers are skipped by arrow-key navigation, which Ark handles.\n */\nexport function TabsTrigger({ className, children, ...props }: TabsTriggerProps) {\n return (\n <ArkTabs.Trigger className={cx('ds-tabs__trigger', className)} {...props}>\n {children}\n </ArkTabs.Trigger>\n );\n}\n\nexport type TabsContentProps = ComponentProps<typeof ArkTabs.Content>;\n\n/** Panel for one tab. `value` must match its {@link TabsTrigger}. */\nexport function TabsContent({ className, children, ...props }: TabsContentProps) {\n return (\n <ArkTabs.Content className={cx('ds-tabs__content', className)} {...props}>\n {children}\n </ArkTabs.Content>\n );\n}\n"]}
|
package/dist/text/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type {\n HeadingLevel,\n HeadingProps,\n TextAlign,\n TextProps,\n TextSize,\n TextStyleProps,\n TextTag,\n TextTone,\n TextWeight,\n} from './text';\nexport { Heading, Text } from './text';\n"]}
|
package/dist/text/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+D3B,SAAS,WAAW,CAClB,KAAa,EACb,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAkB,EAC/F,SAAkB;IAElB,OAAO,EAAE,CACP,SAAS,EACT,KAAK,EACL,IAAI,IAAI,iBAAiB,IAAI,EAAE,EAC/B,MAAM,IAAI,mBAAmB,MAAM,EAAE,EACrC,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,EAAE,EACrD,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,EACtC,OAAO,IAAI,kBAAkB,EAC7B,cAAc,IAAI,0BAA0B,EAC5C,aAAa,IA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nimport type { ComponentProps, CSSProperties } from 'react';\nimport './text.css';\nimport { cx } from '../cx';\n\n/** The type scale's steps, from the 14px floor up. */\nexport type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';\n\nexport type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';\n\n/**\n * What the text is for, which decides its colour. `default` and `muted` are\n * the two text roles; the four statuses are for a line of text that reports\n * one, such as a validation message or a result; `accent` is the strong\n * primary colour, for a short label the brand lends its colour to.\n */\nexport type TextTone = 'default' | 'muted' | 'success' | 'warning' | 'danger' | 'info' | 'accent';\n\nexport type TextAlign = 'start' | 'center' | 'end';\n\n/**\n * The elements `Text` renders: the ones whose attributes are a paragraph's.\n * Deliberately a union rather than `ElementType`: the implementation indexes\n * the Ark factory, which hands any key to `createElement` as a tag name, so\n * a component reference would be stringified and thrown. An element with\n * attributes of its own (`label` with `htmlFor`, `time` with `dateTime`, an\n * `output`) goes through `asChild`, which keeps that element's own props.\n * `code` and `kbd` take the monospace face.\n */\nexport type TextTag =\n | 'p'\n | 'span'\n | 'div'\n | 'strong'\n | 'em'\n | 'small'\n | 'li'\n | 'dt'\n | 'dd'\n | 'figcaption'\n | 'code'\n | 'kbd';\n\nexport interface TextStyleProps {\n /** Step of the type scale. Defaults to `md`, body text. */\n size?: TextSize;\n /** Font weight. Defaults to the element's own (`regular` for body text). */\n weight?: TextWeight;\n /** Colour by purpose. Defaults to `default`. */\n tone?: TextTone;\n /** Horizontal alignment. Defaults to the writing direction's start. */\n align?: TextAlign;\n /**\n * Clip the text with an ellipsis: `true` after one line, or a number of\n * lines. The text is clipped by its own box rather than kept from wrapping,\n * so a long word still breaks instead of pushing past the edge.\n */\n truncate?: boolean | number;\n /** Digits of equal width, so figures in a column or a count that ticks line up. */\n tabular?: boolean;\n /** Keep the line breaks the text was written with: a description, a reflection, a note. */\n preserveBreaks?: boolean;\n /** A line through the text: a milestone reached, a move no longer on the list. */\n strikethrough?: boolean;\n}\n\nfunction textClasses(\n block: string,\n { size, weight, tone, align, truncate, tabular, preserveBreaks, strikethrough }: TextStyleProps,\n className?: string,\n) {\n return cx(\n 'ds-text',\n block,\n size && `ds-text--size-${size}`,\n weight && `ds-text--weight-${weight}`,\n tone && tone !== 'default' && `ds-text--tone-${tone}`,\n align && `ds-text--align-${align}`,\n truncate ? 'ds-text--truncate' : false,\n tabular && 'ds-text--tabular',\n preserveBreaks && 'ds-text--preserve-breaks',\n strikethrough && 'ds-text--strikethrough',\n className,\n );\n}\n\nconst MONO_TAGS: ReadonlySet<TextTag> = new Set(['code', 'kbd']);\n\n/**\n * The line count as the private property `text.css` clamps to. Always written\n * when truncating, `1` for `true`: custom properties inherit, so a truncated\n * Text inside a three-line one would otherwise clamp to three.\n */\nfunction truncateStyle(truncate: boolean | number | undefined, style?: CSSProperties) {\n if (!truncate) return style;\n return { '--_text-lines': truncate === true ? 1 : truncate, ...style } as CSSProperties;\n}\n\nexport interface TextProps extends ComponentProps<typeof ark.p>, TextStyleProps {\n /** Element to render. Defaults to `p`. */\n as?: TextTag;\n /**\n * Small-caps label: uppercase, semibold, letter-spaced, for a short word\n * that names the value beside it (\"Target\", \"Rating\"). Reads the product's\n * label tracking; pair it with `size=\"xs\"` or `sm`.\n */\n caps?: boolean;\n}\n\n/**\n * A run of text on the type scale.\n *\n * Body copy, a description, a caption, a label: every piece of text a product\n * writes outside a component with its own text slot. Size, weight and colour\n * come from the `--ds-text-*` contract, so a product tunes its type once in\n * tokens rather than per element. Renders a `p`; pick another tag with `as`,\n * or pass `asChild` to style an element of your own.\n */\nexport function Text({\n as,\n size = 'md',\n weight,\n tone = 'default',\n align,\n truncate,\n tabular,\n preserveBreaks,\n strikethrough,\n caps = false,\n className,\n style,\n children,\n ...props\n}: TextProps) {\n // Every factory member has the same props apart from its element's ref\n // type; the cast settles the union on `p`, the default, which is why `as`\n // is a closed list of plain text elements rather than any tag.\n const Component = (as ? ark[as] : ark.p) as typeof ark.p;\n return (\n <Component\n className={textClasses(\n cx('ds-text--body', caps && 'ds-text--caps', as && MONO_TAGS.has(as) && 'ds-text--mono'),\n {\n size,\n weight: weight ?? (caps ? 'semibold' : undefined),\n tone,\n align,\n truncate,\n tabular,\n preserveBreaks,\n strikethrough,\n },\n className,\n )}\n style={truncateStyle(truncate, style)}\n {...props}\n >\n {children}\n </Component>\n );\n}\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The size each level takes when `size` is not given: a plain ramp down the scale. */\nconst HEADING_SIZES: Record<HeadingLevel, TextSize> = {\n 1: '4xl',\n 2: '3xl',\n 3: '2xl',\n 4: 'xl',\n 5: 'lg',\n 6: 'md',\n};\n\nexport interface HeadingProps extends ComponentProps<typeof ark.h2>, TextStyleProps {\n /**\n * The heading element to render, which is its place in the document\n * outline. Pick the level the outline needs, never the level whose default\n * size looks right; `size` changes the look on its own.\n */\n level: HeadingLevel;\n}\n\n/**\n * A heading on the type scale.\n *\n * The level is the outline; the size is the look, and defaults from the\n * level so a page's `h1` is `4xl` and a card's `h3` is `2xl` without a\n * decision. Headings take the heading weight and tight line height from the\n * contract. Pass `asChild` to style a heading element of your own, say one\n * a library renders.\n */\nexport function Heading({\n level,\n size,\n weight,\n tone = 'default',\n align,\n truncate,\n tabular,\n preserveBreaks,\n strikethrough,\n className,\n style,\n children,\n ...props\n}: HeadingProps) {\n const Component = ark[`h${level}`];\n return (\n <Component\n className={textClasses(\n 'ds-text--heading',\n {\n size: size ?? HEADING_SIZES[level],\n weight,\n tone,\n align,\n truncate,\n tabular,\n preserveBreaks,\n strikethrough,\n },\n className,\n )}\n style={truncateStyle(truncate, style)}\n {...props}\n >\n {children}\n </Component>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/visually-hidden/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/visually-hidden/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { VisuallyHiddenProps } from './visually-hidden';\nexport { VisuallyHidden } from './visually-hidden';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visually-hidden.js","sourceRoot":"","sources":["../../src/visually-hidden/visually-hidden.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB;IACnF,OAAO,CACL,KAAC,GAAG,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,SAAS,CAAC,KAAM,KAAK,YAChE,QAAQ,GACA,CACZ,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"visually-hidden.js","sourceRoot":"","sources":["../../src/visually-hidden/visually-hidden.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB;IACnF,OAAO,CACL,KAAC,GAAG,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,SAAS,CAAC,KAAM,KAAK,YAChE,QAAQ,GACA,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './visually-hidden.css';\nimport { cx } from '../cx';\n\nexport type VisuallyHiddenProps = ComponentProps<typeof ark.span>;\n\n/**\n * Text for assistive technology that takes no space on screen.\n *\n * The name of an icon-only control that already shows a tooltip, the\n * heading of a region that is obvious to the eye, the \"(opens in a new tab)\"\n * after a link. Prefer a visible label where one fits; this is for the cases\n * where sighted users already have the information another way. Renders a\n * `span`; pass `asChild` to hide your own element (a heading, a legend).\n */\nexport function VisuallyHidden({ className, children, ...props }: VisuallyHiddenProps) {\n return (\n <ark.span className={cx('ds-visually-hidden', className)} {...props}>\n {children}\n </ark.span>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wizard-layout/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wizard-layout/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export type {\n WizardContentProps,\n WizardFooterProps,\n WizardHeaderProps,\n WizardLayoutProps,\n} from './wizard-layout';\nexport { WizardContent, WizardFooter, WizardHeader, WizardLayout } from './wizard-layout';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard-layout.js","sourceRoot":"","sources":["../../src/wizard-layout/wizard-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAO7C;;;;;;;GAOG;AACH,MAAM,UAAU,YAA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AAC,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,EAC9C,GAAG,EAAE,UAAU,EACf,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,SAAS,GAChB,EACF,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,KAAK,YAC1B,KAAK,GACE,EACT,WAAW,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,IAClD,CACd,CAAC;AACJ,CAAC;AAID,uBAAuB;AACvB,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsB;IACjF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,KAAM,KAAK,YACtE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAqB;IAC/E,OAAO,CACL,KAAC,GAAG,CAAC,MAAM,IAAC,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAAM,KAAK,YACxE,QAAQ,GACE,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps, ReactNode } from 'react';\nimport './wizard-layout.css';\nimport { cx } from '../cx';\nimport type { ContentWidth } from '../layout/layout';\nimport { Progress } from '../progress/progress';\nimport { Heading, Text } from '../text/text';\n\nexport interface WizardLayoutProps extends ComponentProps<typeof ark.div> {\n /** Where the flow's content stops growing. Defaults to `lg`, a form's width. */\n size?: ContentWidth;\n}\n\n/**\n * The template a multi-step flow composes: an onboarding, a quarterly\n * review, a setup. A centred column holding a {@link WizardHeader} that says\n * where the user is, the step's {@link WizardContent}, and a\n * {@link WizardFooter} with the way back and forward.\n *\n * Renders a `div`; pass `asChild` to make the flow a landmark.\n */\nexport function WizardLayout({ size = 'lg', className, children, ...props }: WizardLayoutProps) {\n return (\n <ark.div className={cx('ds-wizard-layout', `ds-wizard-layout--${size}`, className)} {...props}>\n {children}\n </ark.div>\n );\n}\n\n/** No `asChild`: the header renders three parts, and Ark's `asChild` clones exactly one. */\nexport interface WizardHeaderProps\n extends Omit<ComponentProps<typeof ark.header>, 'title' | 'asChild'> {\n /** The step's heading, the page's `h1`. */\n title: ReactNode;\n /** What this step asks for. */\n description?: ReactNode;\n /** The current step, counting from one. */\n step: number;\n /** How many steps the flow has. */\n totalSteps: number;\n /**\n * The name of the progress bar and the text beside it. Defaults to\n * \"Step {step} of {totalSteps}\"; a product localises it here.\n */\n stepLabel?: string;\n}\n\n/**\n * Where the user is in the flow: a progress bar labelled with the step\n * count, then the step's title and what it asks for. The bar shows the step\n * clamped to the total: Zag throws on a value past `max`, and a finish screen\n * one past the last step is a product's call, not a crash.\n */\nexport function WizardHeader({\n title,\n description,\n step,\n totalSteps,\n stepLabel = `Step ${step} of ${totalSteps}`,\n className,\n ...props\n}: WizardHeaderProps) {\n return (\n <ark.header className={cx('ds-wizard-layout__header', className)} {...props}>\n <Progress\n value={Math.min(Math.max(step, 0), totalSteps)}\n max={totalSteps}\n size=\"sm\"\n label={stepLabel}\n />\n <Heading level={1} size=\"3xl\">\n {title}\n </Heading>\n {description ? <Text tone=\"muted\">{description}</Text> : null}\n </ark.header>\n );\n}\n\nexport type WizardContentProps = ComponentProps<typeof ark.div>;\n\n/** The step itself. */\nexport function WizardContent({ className, children, ...props }: WizardContentProps) {\n return (\n <ark.div className={cx('ds-wizard-layout__content', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n\nexport type WizardFooterProps = ComponentProps<typeof ark.footer>;\n\n/**\n * The flow's navigation: the way back at the start of the row, the way\n * forward at the end. With one child it sits at the end.\n */\nexport function WizardFooter({ className, children, ...props }: WizardFooterProps) {\n return (\n <ark.footer className={cx('ds-wizard-layout__footer', className)} {...props}>\n {children}\n </ark.footer>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manakind/ui-core",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
},
|
|
365
365
|
"devDependencies": {
|
|
366
366
|
"@manakind/ds-config": "*",
|
|
367
|
-
"@manakind/manuia-tokens": "0.24.
|
|
367
|
+
"@manakind/manuia-tokens": "0.24.1",
|
|
368
368
|
"@testing-library/jest-dom": "^6.9.1",
|
|
369
369
|
"@testing-library/react": "^16.3.2",
|
|
370
370
|
"@testing-library/user-event": "^14.6.1",
|