@manakind/ui-core 0.24.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/README.md +2 -0
- 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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- 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.d.ts +3 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.css +63 -0
- package/dist/slider/slider.css.d.ts +2 -0
- package/dist/slider/slider.d.ts +34 -0
- package/dist/slider/slider.d.ts.map +1 -0
- package/dist/slider/slider.js +14 -0
- package/dist/slider/slider.js.map +1 -0
- 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 +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/dialog/dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAIL,WAAW,EACX,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAyF3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,IAAI,GAAG,QAAQ,EACf,eAAe,EACf,aAAa,EACb,UAAU,GAAG,OAAO,EACpB,SAAS,GAAG,KAAK,EACjB,IAAI,GAAG,IAAI,EACX,SAAS,GACG;IACZ,MAAM,WAAW,GAAG,IAAI,KAAK,Q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,EAC/C,OAAO,IAAI,cAAK,SAAS,EAAC,oBAAoB,YAAE,OAAO,GAAO,IAC/B,GAChB,GACC,IAChB,IACM,CAClB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,EAAE,QAAQ,EAA2B;IACvD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,QAA+B,EAAE,EAAE;QAC9D,MAAM,OAAO,GAAG,QAAQ,EAAE,iBAAiB,CAAC;QAC5C,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO;YAAE,OAAO;QAClC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CACvC,aAAa,CAAC,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,CAC7D,CAAC;QACF,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3B,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,cAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,iBAAiB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,YACjF,cAAK,SAAS,EAAC,yBAAyB,YAAE,QAAQ,GAAO,GACrD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { Dialog as ArkDialog } from '@ark-ui/react/dialog';\nimport { Portal } from '@ark-ui/react/portal';\nimport {\n type ReactElement,\n type ReactNode,\n type RefObject,\n useCallback,\n useRef,\n useState,\n} from 'react';\nimport { IconButton } from '../button/icon-button';\nimport type { IconSource } from '../icon/icon';\nimport { PortalContainerContext } from '../portal-container';\nimport './dialog.css';\nimport { cx } from '../cx';\nimport { Cross } from '../fallback-glyphs';\n\nexport type DialogRole = 'dialog' | 'alertdialog';\n\n/** How wide the panel may grow: a message or short form, or a form with fields side by side. */\nexport type DialogSize = 'md' | 'lg';\n\nexport interface DialogProps {\n /**\n * The dialog's name: rendered as its `<h2>` heading and announced when it\n * opens (`aria-labelledby`). Write it as a short statement or question —\n * \"Remove “Site foreman”?\".\n */\n title: ReactNode;\n /**\n * One or two sentences under the title, announced with it\n * (`aria-describedby`). For a confirmation, say what the action does and\n * what it leaves alone.\n */\n description?: ReactNode;\n /** Body content. Scrolls inside the panel when it outgrows the viewport. */\n children?: ReactNode;\n /**\n * The footer's buttons, end-aligned, in reading order: the dismissive one\n * first, the committing one last. They wrap onto a second line on a narrow\n * screen. Wrap a dismissive button in `DialogClose` to make it close.\n */\n actions?: ReactNode;\n /**\n * The one element that opens the dialog, such as a `Button`. Focus returns\n * to it when the dialog closes, unless `finalFocusRef` names another\n * element. Leave it out to open the dialog with `open` from elsewhere.\n */\n trigger?: ReactElement;\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n /** Initial open state when uncontrolled. */\n defaultOpen?: boolean;\n /**\n * Fired with the requested state whenever the dialog asks to open (its\n * trigger) or close (a `DialogClose`, the close button, Escape, or for\n * `role=\"dialog\"` a click outside). A controlled dialog stays as it is\n * until `open` changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * `dialog` (default) shows a close button and closes on Escape and on a\n * click outside. `alertdialog` is for confirmations: no close button, and a\n * click outside does nothing, so the explicit cancel action is the way\n * out. Escape still cancels.\n */\n role?: DialogRole;\n /**\n * Where focus lands when the dialog opens. Defaults to the first focusable\n * element: the close button of a `dialog`, the first action of an\n * `alertdialog` with no focusable body. Point an alertdialog at its least\n * destructive action.\n */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /**\n * Where focus lands when the dialog closes, in place of the trigger. Use it\n * when the confirmed action removes the trigger, such as a row's Remove\n * button: focus would return to an element that is about to unmount and\n * fall to the page body. Point it at something that stays, such as the\n * list's heading, which needs `tabIndex={-1}` to take focus.\n *\n * The ref is read as the dialog closes, however it closes. Fill it in the\n * committing action, so Cancel and Escape still return focus to the\n * trigger, which is still there. While the ref holds no element, focus\n * returns to the trigger as usual.\n */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Accessible name of the close button. Translate it with the rest of the UI. */\n closeLabel?: string;\n /**\n * Glyph for the close button. Defaults to a plain built-in cross so\n * `@manakind/ui-core` renders on its own; products pass their own icon set,\n * as they do for Select's indicators.\n */\n closeIcon?: IconSource;\n /**\n * How wide the panel may grow: `md` (the default) for a message or a short\n * form, `lg` for a form with fields side by side.\n */\n size?: DialogSize;\n /** Extra class names appended to the panel's `ds-dialog`. */\n className?: string;\n}\n\n/**\n * A modal dialog: a raised panel over a dimmed page, built on Ark UI.\n *\n * Ark owns the behaviour: the focus trap, focus returning to the trigger\n * (or to `finalFocusRef`), Escape, the page's scroll lock, `aria-modal`, and the title and\n * description wiring. This wrapper adds the `ds-` classes, the\n * `--ds-dialog-*` bindings, and a slot API in place of Ark's anatomy.\n *\n * ```tsx\n * <Dialog\n * role=\"alertdialog\"\n * title=\"Remove “Site foreman”?\"\n * description=\"2 people and 1 Landfall lose this type; nothing else is deleted.\"\n * trigger={<Button variant=\"secondary\">Remove</Button>}\n * initialFocusRef={cancelRef}\n * actions={\n * <>\n * <DialogClose>\n * <Button ref={cancelRef} variant=\"secondary\">Cancel</Button>\n * </DialogClose>\n * <Button variant=\"danger\" onClick={remove}>Remove</Button>\n * </>\n * }\n * />\n * ```\n *\n * The committing action is the consumer's own button. To close after it\n * runs, control the dialog with `open` and set it false in the handler, or\n * wrap the button in `DialogClose` when closing at once is right.\n *\n * The backdrop and panel portal into `<body>` at `z-index: 50`, the layer\n * the product apps use for their own overlays. A Select or Menu inside the\n * dialog portals into its panel (see `PortalContainerContext`) and opens at\n * 60, above it. Nothing is mounted while the dialog is closed.\n */\nexport function Dialog({\n title,\n description,\n children,\n actions,\n trigger,\n open,\n defaultOpen,\n onOpenChange,\n role = 'dialog',\n initialFocusRef,\n finalFocusRef,\n closeLabel = 'Close',\n closeIcon = Cross,\n size = 'md',\n className,\n}: DialogProps) {\n const dismissible = role === 'dialog';\n const panelRef = useRef<HTMLDivElement>(null);\n const handleOpenChange = (details: { open: boolean }) => onOpenChange?.(details.open);\n // Zag types this as returning `HTMLElement | null`, but its focus trap\n // reads undefined as \"the first focusable element\" and, given null, fails\n // to start at all, leaving the page reachable by Tab.\n const initialFocusEl = (() => initialFocusRef?.current ?? undefined) as () => HTMLElement | null;\n const finalFocusEl = () => finalFocusRef?.current ?? null;\n\n return (\n <ArkDialog.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n role={role}\n closeOnInteractOutside={dismissible}\n initialFocusEl={initialFocusEl}\n finalFocusEl={finalFocusEl}\n lazyMount\n unmountOnExit\n >\n {trigger && <ArkDialog.Trigger asChild>{trigger}</ArkDialog.Trigger>}\n <Portal>\n <ArkDialog.Backdrop className=\"ds-dialog__backdrop\" />\n <ArkDialog.Positioner className=\"ds-dialog__positioner\">\n <ArkDialog.Content\n ref={panelRef}\n className={cx('ds-dialog', size === 'lg' && 'ds-dialog--lg', className)}\n >\n <PortalContainerContext.Provider value={panelRef}>\n <div className=\"ds-dialog__header\">\n <div className=\"ds-dialog__heading\">\n <ArkDialog.Title className=\"ds-dialog__title\">{title}</ArkDialog.Title>\n {description && (\n <ArkDialog.Description className=\"ds-dialog__description\">\n {description}\n </ArkDialog.Description>\n )}\n </div>\n {dismissible && (\n <ArkDialog.CloseTrigger asChild>\n <IconButton\n icon={closeIcon}\n aria-label={closeLabel}\n variant=\"tertiary\"\n size=\"sm\"\n className=\"ds-dialog__close\"\n />\n </ArkDialog.CloseTrigger>\n )}\n </div>\n {children && <DialogBody>{children}</DialogBody>}\n {actions && <div className=\"ds-dialog__actions\">{actions}</div>}\n </PortalContainerContext.Provider>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </Portal>\n </ArkDialog.Root>\n );\n}\n\n/**\n * The scrolling body. While its content overflows it joins the tab order, so\n * a keyboard user can focus it and scroll; a body with nothing to scroll\n * stays out of the way.\n *\n * Two boxes are observed because either can change the answer: the outer one\n * resizes with the viewport, the inner one with the content.\n */\nfunction DialogBody({ children }: { children: ReactNode }) {\n const [scrollable, setScrollable] = useState(false);\n const observe = useCallback((scroller: HTMLDivElement | null) => {\n const content = scroller?.firstElementChild;\n if (!scroller || !content) return;\n const observer = new ResizeObserver(() =>\n setScrollable(scroller.scrollHeight > scroller.clientHeight),\n );\n observer.observe(scroller);\n observer.observe(content);\n return () => observer.disconnect();\n }, []);\n\n return (\n <div ref={observe} className=\"ds-dialog__body\" tabIndex={scrollable ? 0 : undefined}>\n <div className=\"ds-dialog__body-content\">{children}</div>\n </div>\n );\n}\n"]}
|
package/dist/dialog/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dialog/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dialog/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export type { DialogProps, DialogRole, DialogSize } from './dialog';\nexport { Dialog } from './dialog';\nexport type { DialogCloseProps } from './dialog-close';\nexport { DialogClose } from './dialog-close';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../src/divider/divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,GAAG,KAAK,EACK;IACb,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,sBACrB,UAAU,IAAI,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,iBACzE,UAAU,IAAI,SAAS,EACpC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,eAAe,WAAW,EAAE,EAAE,SAAS,CAAC,KAChE,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../src/divider/divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,KAAK,EAClB,SAAS,EACT,GAAG,KAAK,EACK;IACb,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,sBACrB,UAAU,IAAI,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,iBACzE,UAAU,IAAI,SAAS,EACpC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,eAAe,WAAW,EAAE,EAAE,SAAS,CAAC,KAChE,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './divider.css';\nimport { cx } from '../cx';\n\nexport type DividerOrientation = 'horizontal' | 'vertical';\n\nexport interface DividerProps extends ComponentProps<typeof ark.div> {\n /**\n * `horizontal` (the default) rules across its container; `vertical` rules\n * between the children of a row and stretches to the row's height.\n */\n orientation?: DividerOrientation;\n /**\n * Hide the rule from assistive technology. A divider that only tidies the\n * eye, between two buttons say, is decorative; one that separates the\n * sections of a document is not and announces as a separator.\n */\n decorative?: boolean;\n}\n\n/**\n * A hairline between two things.\n *\n * Renders a `div` with `role=\"separator\"`, since an `hr` cannot be vertical.\n * The colour is `--ds-divider-color`; the thickness is one pixel in either\n * orientation.\n */\nexport function Divider({\n orientation = 'horizontal',\n decorative = false,\n className,\n ...props\n}: DividerProps) {\n return (\n <ark.div\n role={decorative ? 'none' : 'separator'}\n aria-orientation={decorative || orientation === 'horizontal' ? undefined : orientation}\n aria-hidden={decorative || undefined}\n className={cx('ds-divider', `ds-divider--${orientation}`, className)}\n {...props}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/divider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/divider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type { DividerOrientation, DividerProps } from './divider';\nexport { Divider } from './divider';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.js","sourceRoot":"","sources":["../../src/empty-state/empty-state.tsx"],"names":[],"mappings":";AACA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAgBrD;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,E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,CAAC,CAAC,YAAG,SAAS,EAAC,6BAA6B,YAAE,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,EACjF,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,IACxE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport './empty-state.css';\nimport { cx } from '../cx';\nimport { Icon, type IconSource } from '../icon/icon';\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** The one line that says what is missing: \"No goals yet\". */\n title: ReactNode;\n /** What to do about it, or why it is empty. Muted, under the title. */\n description?: ReactNode;\n /**\n * A glyph above the title, decorative: the title says the same thing. An\n * `IconSource`, since `ui-core` ships no icons of its own.\n */\n icon?: IconSource;\n /** The way out, typically one button, rendered under the text. */\n children?: ReactNode;\n}\n\n/**\n * The centred column a region shows when it has nothing to list.\n *\n * A title, an optional description and an optional action, centred in a\n * block of inset so the emptiness reads as intended rather than as a failed\n * render. Styled by the `--ds-empty-state-*` keys; the type comes from the\n * text contract.\n */\nexport function EmptyState({\n title,\n description,\n icon,\n className,\n children,\n ...props\n}: EmptyStateProps) {\n return (\n <div className={cx('ds-empty-state', className)} {...props}>\n {icon ? <Icon source={icon} size=\"lg\" tone=\"muted\" decorative /> : null}\n <p className=\"ds-empty-state__title\">{title}</p>\n {description ? <p className=\"ds-empty-state__description\">{description}</p> : null}\n {children ? <div className=\"ds-empty-state__actions\">{children}</div> : null}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/empty-state/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/empty-state/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export type { EmptyStateProps } from './empty-state';\nexport { EmptyState } from './empty-state';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback-glyphs.js","sourceRoot":"","sources":["../src/fallback-glyphs.tsx"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CACjD,6BAAiB,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,KAAK,KAAK,YAC/D,eACE,CAAC,EAAC,cAAc,EAChB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAChD,6BAAiB,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,KAAK,KAAK,YAC/D,eACE,CAAC,EAAC,eAAe,EACjB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1C,6BAAiB,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,KAAK,KAAK,YAC/D,eACE,CAAC,EAAC,kBAAkB,EACpB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAA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AK,YAC/D,eACE,CAAC,EAAC,gDAAgD,EAClD,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AACF,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import type { IconSource } from './icon/icon';\n\n/*\n * Fallback glyphs for the components whose icon slots default to something\n * (Select's indicators, Menu's check, Dialog's close button), inlined on\n * purpose and kept in one place. The package root exports them as\n * `Fallback*`, so a product composition with the same default reuses these\n * rather than copying the path data.\n *\n * ui-core is public and MIT; the Lineicons Pro icon package is private and\n * carries proprietary payloads, so a public package must not reference it —\n * `check:tarballs` enforces that. A default that ships inside ui-core's own\n * runtime therefore cannot be a licensed icon.\n *\n * These exist only so the package works standalone. Products override them\n * via `indicator` / `itemIndicator`, which is how the Humanity Plus apps\n * render Lineicons here.\n *\n * Note: that audit is a plain string scan over the built output, and tsc\n * keeps comments, so naming the private package here — even in prose —\n * would fail CI. Describe it, do not spell it.\n */\nexport const ChevronRight: IconSource = (props) => (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n d=\"m6 4 4 4-4 4\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\nChevronRight.displayName = 'FallbackChevronRight';\n\nexport const ChevronLeft: IconSource = (props) => (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n d=\"M10 4 6 8l4 4\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\nChevronLeft.displayName = 'FallbackChevronLeft';\n\nexport const Check: IconSource = (props) => (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n d=\"m3.5 8.5 3 3 6-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\nCheck.displayName = 'FallbackCheck';\n\nexport const Cross: IconSource = (props) => (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n d=\"m4 4 8 8m0-8-8 8\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\nCross.displayName = 'FallbackCross';\n\nexport const Pin: IconSource = (props) => (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n d=\"M6 2.5h4M7 2.5v3.75L4.5 9h7L9 6.25V2.5M8 9v4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\nPin.displayName = 'FallbackPin';\n"]}
|
package/dist/field/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAkB,OAAO,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAuC3B;;;;;GAKG;AACH,SAAS,UAAU,CAAC,EAAE,QAAQ,EAA2B;IACvD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,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AAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1E,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACtC,MAAC,QAAQ,CAAC,IAAI,IACZ,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,IAAI,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,aAEpC,KAAC,UAAU,cAAE,KAAK,GAAc,EAC/B,OAAO,IAAI,KAAC,QAAQ,CAAC,UAAU,IAAC,SAAS,EAAC,gBAAgB,YAAE,IAAI,GAAuB,EACvF,QAAQ,IAAI,KAAC,QAAQ,CAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,YAAE,KAAK,GAAsB,EAC1F,QAAQ,IACK,GACW,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["import { Field as ArkField, useFieldContext } from '@ark-ui/react/field';\nimport { type ReactNode, useMemo } from 'react';\nimport { FieldPartsContext } from './use-field-control';\nimport './field.css';\nimport { cx } from '../cx';\n\nexport type FieldProps = {\n /** Visible label. The field's control is named by it, so it is required. */\n label: ReactNode;\n /**\n * The control: an `Input`, a `Textarea`, or any Ark field part. It picks up\n * the label, the hint, the error and the states from the field.\n */\n children: ReactNode;\n /** Help the user reads before typing. Sits between the label and the control, muted. */\n hint?: ReactNode;\n /**\n * What is wrong with the value. Shown above the control in the danger\n * colour, and its presence marks the field invalid: the control gets\n * `aria-invalid` and points at the message through `aria-describedby`.\n * `false`, `''` and `undefined` all mean no error, so a form library's\n * `errors.title?.message` goes straight in.\n */\n error?: ReactNode;\n /**\n * Marks the field invalid without a message, for a summary shown elsewhere.\n * Defaults to whether `error` has content. An explicit `false` wins over\n * `error`, and the message is then not shown: the control is only\n * described by an error while it is invalid.\n */\n invalid?: boolean;\n /** Marks the control required and shows the indicator after the label. */\n required?: boolean;\n /** Disables the control and dims it, the label and the hint. */\n disabled?: boolean;\n /** Shows the value without letting the user change it. */\n readOnly?: boolean;\n /** Id for the control. Generated when omitted; the label's `for` follows it. */\n id?: string;\n /** Extra class names appended after `ds-field`. */\n className?: string;\n};\n\n/**\n * A `<label for>` activates only a labelable element. A control a product\n * composes itself (a rich-text editor, see `useFieldControl`) is a `div`,\n * so a click on its label would do nothing. This gives such a control the\n * focus the label promises; a native control keeps the browser's behaviour.\n */\nfunction FieldLabel({ children }: { children: ReactNode }) {\n const field = useFieldContext();\n const focusCustomControl = () => {\n const control = document.getElementById(field.ids.control);\n if (control instanceof HTMLElement && !('labels' in control)) control.focus();\n };\n return (\n <ArkField.Label className=\"ds-field__label\" onClick={focusCustomControl}>\n {children}\n <ArkField.RequiredIndicator className=\"ds-field__indicator\" />\n </ArkField.Label>\n );\n}\n\n/**\n * A labelled form control with optional hint and error, built on Ark UI.\n *\n * Ark owns most of the wiring: the label's `for`, `aria-invalid`, `required`,\n * `disabled` and `readOnly`. The control's `aria-describedby` is composed\n * here from what the field renders, the error first and then the hint, so it\n * does not depend on which attribute a given Ark version uses for the error.\n * This wrapper decides what renders and contributes the `ds-field` classes\n * and the `--ds-field-*` bindings. The control is whatever you put inside:\n * an `Input`, a `Textarea`, or a future Ark field part.\n *\n * The hint and the error render before the control, not after it. A screen\n * reader then meets them on the way down and lands on the control to act,\n * and a sighted user keeps seeing them when a listbox, a date picker or a\n * password manager opens under the focused control and covers what sits there.\n *\n * ```tsx\n * <Field label=\"Title\" hint=\"Short and specific.\" error={errors.title?.message}>\n * <Input {...register('title')} />\n * </Field>\n * ```\n */\nexport function Field({\n label,\n children,\n hint,\n error,\n invalid,\n required,\n disabled,\n readOnly,\n id,\n className,\n}: FieldProps) {\n const hasHint = Boolean(hint);\n const hasError = Boolean(error);\n const parts = useMemo(() => ({ hasHint, hasError }), [hasHint, hasError]);\n return (\n <FieldPartsContext.Provider value={parts}>\n <ArkField.Root\n id={id}\n invalid={invalid ?? hasError}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n className={cx('ds-field', className)}\n >\n <FieldLabel>{label}</FieldLabel>\n {hasHint && <ArkField.HelperText className=\"ds-field__hint\">{hint}</ArkField.HelperText>}\n {hasError && <ArkField.ErrorText className=\"ds-field__message\">{error}</ArkField.ErrorText>}\n {children}\n </ArkField.Root>\n </FieldPartsContext.Provider>\n );\n}\n"]}
|
package/dist/field/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/field/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/field/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export type { FieldProps } from './field';\nexport { Field } from './field';\nexport type { InputProps, InputSize } from './input';\nexport { Input } from './input';\nexport type { TextareaProps } from './textarea';\nexport { Textarea } from './textarea';\nexport type { FieldControl } from './use-field-control';\nexport { useFieldControl } from './use-field-control';\n"]}
|
package/dist/field/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/field/input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAc3D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IAC7E,OAAO,CACL,KAAC,QAAQ,CAAC,KAAK,IACb,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,aAAa,IAAI,EAAE,EAAE,SAAS,CAAC,kBAC3C,OAAO,IAAI,SAAS,kBACpB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAClC,oBAAoB,CAAC,KAAK,CAAC,GAC/B,CACH,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/field/input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAc3D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IAC7E,OAAO,CACL,KAAC,QAAQ,CAAC,KAAK,IACb,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,aAAa,IAAI,EAAE,EAAE,SAAS,CAAC,kBAC3C,OAAO,IAAI,SAAS,kBACpB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAClC,oBAAoB,CAAC,KAAK,CAAC,GAC/B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { Field as ArkField } from '@ark-ui/react/field';\nimport type { ComponentProps } from 'react';\nimport './field.css';\nimport { cx } from '../cx';\nimport { useFieldControlProps } from './use-field-control';\n\nexport type InputSize = 'sm' | 'md' | 'lg';\n\nexport type InputProps = Omit<ComponentProps<'input'>, 'size'> & {\n /** Control height and type scale. Matches `Select` and `Button`. */\n size?: InputSize;\n /**\n * Marks the control invalid on its own, outside a `Field`. Inside one, the\n * field's `error` or `invalid` does this and the prop is not needed.\n */\n invalid?: boolean;\n};\n\n/**\n * Single-line text control, built on Ark UI's field input.\n *\n * Inside a `Field` it takes the label, the hint, the error and the states\n * from the field, which also owns its `id`; an `aria-describedby` of its own\n * is added to the field's. On its own it is a plain `<input>` with the\n * `ds-input` look, so it still needs a name: a visible label elsewhere or\n * `aria-label`.\n *\n * ```tsx\n * <Field label=\"Title\">\n * <Input placeholder=\"e.g. Run a marathon\" />\n * </Field>\n * ```\n */\nexport function Input({ size = 'md', invalid, className, ...props }: InputProps) {\n return (\n <ArkField.Input\n className={cx('ds-input', `ds-input--${size}`, className)}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? '' : undefined}\n {...useFieldControlProps(props)}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/field/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAW3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,IAAI,EACX,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,GAAG,KAAK,EACM;IACd,OAAO,CACL,KAAC,QAAQ,CAAC,QAAQ,IAChB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,aAAa,IAAI,EAAE,EAAE,SAAS,CAAC,kBAC1D,OAAO,IAAI,SAAS,kBACpB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EACtC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,KACN,oBAAoB,CAAC,KAAK,CAAC,GAC/B,CACH,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/field/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAW3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,IAAI,EACX,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,GAAG,KAAK,EACM;IACd,OAAO,CACL,KAAC,QAAQ,CAAC,QAAQ,IAChB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,aAAa,IAAI,EAAE,EAAE,SAAS,CAAC,kBAC1D,OAAO,IAAI,SAAS,kBACpB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EACtC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,KACN,oBAAoB,CAAC,KAAK,CAAC,GAC/B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { Field as ArkField } from '@ark-ui/react/field';\nimport type { ComponentProps } from 'react';\nimport './field.css';\nimport { cx } from '../cx';\nimport type { InputSize } from './input';\nimport { useFieldControlProps } from './use-field-control';\n\nexport type TextareaProps = ComponentProps<'textarea'> & {\n /** Type scale and padding. Matches `Input`. */\n size?: InputSize;\n /** Marks the control invalid on its own, outside a `Field`. */\n invalid?: boolean;\n /** Grows with its content instead of scrolling, and takes away the resize handle. */\n autoresize?: boolean;\n};\n\n/**\n * Multi-line text control, built on Ark UI's field textarea.\n *\n * Same contract as `Input`: inside a `Field` it is named and described by the\n * field; on its own it needs `aria-label`. Three rows by default, resizable\n * vertically; `autoresize` grows it with the text instead and drops the handle.\n *\n * ```tsx\n * <Field label=\"Description\">\n * <Textarea rows={4} placeholder=\"Describe your goal…\" />\n * </Field>\n * ```\n */\nexport function Textarea({\n size = 'md',\n invalid,\n autoresize = false,\n rows = 3,\n className,\n ...props\n}: TextareaProps) {\n return (\n <ArkField.Textarea\n className={cx('ds-input', 'ds-textarea', `ds-input--${size}`, className)}\n aria-invalid={invalid || undefined}\n data-invalid={invalid ? '' : undefined}\n autoresize={autoresize}\n rows={rows}\n {...useFieldControlProps(props)}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-control.js","sourceRoot":"","sources":["../../src/field/use-field-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAA0C;IACtF,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAOH,SAAS,mBAAmB;IAI1B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC5C,IAAI,CAAC,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GAAG,mBAAmB,EAAE,CAAC;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClF,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,SAAS,EAAE,CAAC;AACtF,CAAC;AAeD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO;QACrB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;QACxB,WAAW;QACX,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useFieldContext } from '@ark-ui/react/field';\nimport { createContext, useContext } from 'react';\n\n/**\n * Which text parts the `Field` is rendering. Ark decides the control's\n * description from what it finds in the DOM, and which attribute carries\n * the error changed between Ark versions (`aria-describedby` up to 5.36,\n * `aria-errormessage` from 5.39). The field knows what it renders, so the\n * wrapper composes the description from that and stays the same on every\n * Ark version: the error first, then the hint.\n */\nexport const FieldPartsContext = createContext<{ hasHint: boolean; hasError: boolean }>({\n hasHint: false,\n hasError: false,\n});\n\ntype ControlProps = {\n id?: string;\n 'aria-describedby'?: string;\n};\n\nfunction useFieldDescription(): {\n field: ReturnType<typeof useFieldContext>;\n describedBy?: string;\n} {\n const field = useFieldContext();\n const parts = useContext(FieldPartsContext);\n if (!field) return { field };\n const ids = [\n field.invalid && parts.hasError ? field.ids.errorText : undefined,\n parts.hasHint ? field.ids.helperText : undefined,\n ].filter(Boolean);\n return { field, describedBy: ids.length ? ids.join(' ') : undefined };\n}\n\n/**\n * Inside a `Field`, the field owns the control's `id` (the label's `for`\n * points at it) and its description (the hint and the error). Ark lets any\n * prop on the element replace the context's, so a consumer `id` would split\n * the label from the control and a consumer `aria-describedby` would drop\n * the hint and the error. This keeps the field's id and adds the consumer's\n * description to the field's instead of replacing it. Outside a field the\n * props pass through untouched.\n */\nexport function useFieldControlProps<P extends ControlProps>(props: P): P {\n const { field, describedBy } = useFieldDescription();\n if (!field) return props;\n const merged = [describedBy, props['aria-describedby']].filter(Boolean).join(' ');\n return { ...props, id: field.ids.control, 'aria-describedby': merged || undefined };\n}\n\nexport type FieldControl = {\n /** Id the field's label points at. Put it on the element that takes the value. */\n id: string;\n /** Id of the field's label, for `aria-labelledby` on an element a `<label for>` cannot name. */\n labelId: string;\n /** Ids of the error, while invalid, and the hint. Put it in `aria-describedby`. */\n describedBy: string | undefined;\n invalid: boolean;\n disabled: boolean;\n readOnly: boolean;\n required: boolean;\n};\n\n/**\n * The field's wiring for a control that is not an `Input` or a `Textarea`:\n * a rich-text editor, a slider, anything a product composes itself. Returns\n * `null` outside a `Field`.\n *\n * ```tsx\n * const field = useFieldControl();\n * <div role=\"textbox\" aria-multiline=\"true\" id={field?.id}\n * aria-labelledby={field?.labelId} aria-describedby={field?.describedBy}\n * aria-invalid={field?.invalid || undefined} />\n * ```\n */\nexport function useFieldControl(): FieldControl | null {\n const { field, describedBy } = useFieldDescription();\n if (!field) return null;\n return {\n id: field.ids.control,\n labelId: field.ids.label,\n describedBy,\n invalid: field.invalid,\n disabled: field.disabled,\n readOnly: field.readOnly,\n required: field.required,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-layout.js","sourceRoot":"","sources":["../../src/form-layout/form-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC5D,QAAQ,GACA,CACZ,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,KAAM,KAAK,YACpE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"form-layout.js","sourceRoot":"","sources":["../../src/form-layout/form-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC5D,QAAQ,GACA,CACZ,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,KAAM,KAAK,YACpE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './form-layout.css';\nimport { cx } from '../cx';\n\nexport type FormLayoutProps = ComponentProps<typeof ark.form>;\n\n/**\n * The template a form composes: its fields in a column at the form's own\n * rhythm, then its {@link FormActions}.\n *\n * Renders a `form`, so `onSubmit`, `noValidate` and the rest land where they\n * belong; pass `asChild` when a form library renders the element. The\n * rhythm between fields is `--ds-form-layout-gap`, wider than a stack's so\n * each field's label, control and message read as one group.\n */\nexport function FormLayout({ className, children, ...props }: FormLayoutProps) {\n return (\n <ark.form className={cx('ds-form-layout', className)} {...props}>\n {children}\n </ark.form>\n );\n}\n\nexport type FormActionsProps = ComponentProps<typeof ark.div>;\n\n/**\n * The form's buttons: a row aligned to the end, with the primary action last\n * in reading order. Set apart from the fields by its own block padding.\n */\nexport function FormActions({ className, children, ...props }: FormActionsProps) {\n return (\n <ark.div className={cx('ds-form-layout__actions', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/form-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/form-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export type { FormActionsProps, FormLayoutProps } from './form-layout';\nexport { FormActions, FormLayout } from './form-layout';\n"]}
|
package/dist/group-items.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-items.js","sourceRoot":"","sources":["../src/group-items.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAA+B,KAAU;IACjE,MAAM,SAAS,GAAQ,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAe,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO;QACL,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"group-items.js","sourceRoot":"","sources":["../src/group-items.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAA+B,KAAU;IACjE,MAAM,SAAS,GAAQ,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAe,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO;QACL,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC","sourcesContent":["/** Options under one group heading; `label` is absent for the ungrouped ones. */\nexport interface ItemGroup<T> {\n label?: string;\n items: T[];\n}\n\n/**\n * The order Select and Combobox list their options in: ungrouped options\n * first (no group, or an empty one), then each group in order of first\n * appearance, each keeping its own order. Both build their keyboard\n * collection from the same groups, so every key walks the list as drawn.\n */\nexport function groupItems<T extends { group?: string }>(items: T[]): ItemGroup<T>[] {\n const ungrouped: T[] = [];\n const groups = new Map<string, T[]>();\n for (const item of items) {\n if (!item.group) {\n ungrouped.push(item);\n } else {\n const members = groups.get(item.group) ?? [];\n members.push(item);\n groups.set(item.group, members);\n }\n }\n return [\n ...(ungrouped.length > 0 ? [{ items: ungrouped }] : []),\n ...[...groups].map(([label, members]) => ({ label, items: members })),\n ];\n}\n"]}
|
package/dist/icon/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names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AS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAeF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAa;IACzF,MAAM,OAAO,GAAG,EAAE,CAChB,SAAS,EACT,YAAY,IAAI,EAAE,EAClB,IAAI,IAAI,iBAAiB,aAAa,CAAC,IAAI,CAAC,EAAE,EAC9C,SAAS,CACV,CAAC;IAEF,OAAO,aAAa,CAAC,MAAM,EAAE;QAC3B,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;QACpC,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,UAAU,IAAI,SAAS;QACtC,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,OAAO;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { type ComponentType, createElement, type SVGProps } from 'react';\nimport './icon.css';\nimport { cx } from '../cx';\n\n/**\n * Library-agnostic icon contract.\n *\n * An `IconSource` is a React component that renders its own `<svg>` root.\n * A filled glyph needs no `fill` of its own; an outline glyph declares\n * `fill=\"none\"` on the root, which `Icon` leaves alone. Both take the\n * surrounding text color. The wrapper `Icon` component injects `className`,\n * role, `aria-label`, `aria-hidden`, and `focusable` via passthrough props.\n *\n * Any icon library that exports React components with this shape can be\n * passed to `<Icon>` — hand-rolled SVGs, Lucide, Heroicons, or a\n * product-specific compiled icon package.\n */\nexport type IconSource = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport type IconSize = 'sm' | 'md' | 'lg';\nexport type IconTone =\n | 'default'\n | 'muted'\n | 'action'\n | 'onAction'\n | 'success'\n | 'warning'\n | 'danger';\n\nconst TONE_TO_CLASS: Record<IconTone, string> = {\n default: 'default',\n muted: 'muted',\n action: 'action',\n onAction: 'on-action',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n};\n\ntype IconA11y = { label: string; decorative?: never } | { decorative: true; label?: never };\n\nexport type IconProps = IconA11y & {\n /** Icon component supplied by the consumer or a compiled icon package. */\n source: IconSource;\n /** Size preset. Maps to `--ds-icon-size-*`. */\n size?: IconSize;\n /** Optional tone modifier. When omitted, the icon inherits `currentColor`. */\n tone?: IconTone;\n /** Extra class names appended after `ds-icon` modifiers. */\n className?: string;\n};\n\n/**\n * Renders an SVG icon by delegating to a passed-in icon component.\n *\n * Consumers must explicitly choose between an accessible label\n * (`label=\"…\"`) and `decorative` to opt into `aria-hidden`. TypeScript\n * enforces the choice via a discriminated union — neither prop omitted,\n * nor both supplied, will compile.\n *\n * Sizing is driven by `--ds-icon-size-{sm,md,lg}` and color by\n * `currentColor` (or `--ds-icon-color-{tone}` when a tone is set).\n *\n * The icon component owns its own `viewBox` and child geometry; `Icon`\n * only contributes layout, a11y, and styling concerns.\n */\nexport function Icon({ source, size = 'md', tone, className, label, decorative }: IconProps) {\n const classes = cx(\n 'ds-icon',\n `ds-icon--${size}`,\n tone && `ds-icon--tone-${TONE_TO_CLASS[tone]}`,\n className,\n );\n\n return createElement(source, {\n role: decorative ? undefined : 'img',\n 'aria-label': label,\n 'aria-hidden': decorative || undefined,\n focusable: 'false',\n className: classes,\n });\n}\n"]}
|
package/dist/icon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC","sourcesContent":["export * from './icon';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"illustration.js","sourceRoot":"","sources":["../../src/illustration/illustration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAiB,MAAM,OAAO,CAAC;AACz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I,GAIL;IACC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC;AAsCD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,MAAM,EACN,IAAI,GAAG,IAAI,EACX,EAAE,EACF,SAAS,EACT,KAAK,EACL,UAAU,GACQ;IAClB,MAAM,OAAO,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC,EAAE,IAAI,oBAAoB,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;IACpF,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IAE9E,OAAO,aAAa,CAAC,MAAM,EAAE;QAC3B,GAAG,SAAS;QACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;QACpC,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,UAAU,IAAI,SAAS;QACtC,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,OAAO;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { type ComponentType, createElement, type SVGProps } from 'react';\nimport './illustration.css';\nimport { cx } from '../cx';\n\n/**\n * Library-agnostic artwork contract, shaped like `IconSource`.\n *\n * An `IllustrationSource` is a React component that renders its own `<svg>`\n * root with a `viewBox` and passes its props through to it. `Illustration`\n * injects `className`, the ARIA attributes, `focusable`, and — when the\n * drawing is placed inside another SVG — its position and size.\n *\n * Artwork paints with roles, never colours. Every shape is stroked with the\n * line colour (`currentColor`) and left unfilled; `illustrationPaint` marks\n * the shapes that take the accented or muted line, or one of the fills.\n */\nexport type IllustrationSource = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport type IllustrationSize = 'sm' | 'md' | 'lg';\n\n/**\n * The emphasis a line or fill takes. `default` is the plain role — the line\n * colour, or the plain fill.\n */\nexport type IllustrationTone = 'default' | 'accent' | 'muted';\n\n/** Where a drawing sits inside a parent `<svg>`, in that SVG's user units. */\nexport interface IllustrationPlacement {\n x: number;\n y: number;\n /** Width and height. Artwork is square. */\n size: number;\n}\n\n/** The attributes `illustrationPaint` returns, which the base CSS maps onto the colour roles. */\nexport interface IllustrationPaintAttributes {\n 'data-line'?: IllustrationTone;\n 'data-fill'?: IllustrationTone;\n}\n\n/**\n * The paint attributes for one shape of a drawing.\n *\n * Omit `line` for the plain line colour; omit `fill` to leave the shape\n * unfilled. Spread the result onto the shape:\n * `<path {...illustrationPaint({ line: 'accent', fill: 'accent' })} d=\"…\" />`.\n */\nexport function illustrationPaint({\n line,\n fill,\n}: {\n line?: IllustrationTone;\n fill?: IllustrationTone;\n}): IllustrationPaintAttributes {\n return { 'data-line': line, 'data-fill': fill };\n}\n\ntype IllustrationA11y =\n | {\n /** What the drawing depicts, for a drawing that stands alone. Renders `role=\"img\"`. */\n label: string;\n decorative?: never;\n }\n | {\n /** The drawing repeats visible text beside it. Renders `aria-hidden`. */\n decorative: true;\n label?: never;\n };\n\ntype IllustrationLayout =\n | {\n /** Size preset. Maps to `--ds-illustration-size-*`. Defaults to `md`. */\n size?: IllustrationSize;\n at?: never;\n }\n | {\n /**\n * Places the drawing inside a parent `<svg>` instead of in the page\n * flow, at user-space coordinates. Replaces `size`: inside a scene the\n * drawing scales with the scene's own `viewBox`.\n */\n at: IllustrationPlacement;\n size?: never;\n };\n\nexport type IllustrationProps = IllustrationA11y &\n IllustrationLayout & {\n /** Artwork component supplied by the product package. */\n source: IllustrationSource;\n /** Extra class names appended after the `ds-illustration` classes. */\n className?: string;\n };\n\n/**\n * Renders a line drawing by delegating to a passed-in artwork component.\n *\n * Consumers must choose between an accessible `label` and `decorative`;\n * TypeScript rejects neither and both. A drawing beside its own visible\n * name is decorative. A drawing that stands alone, as in an empty state, is\n * labelled with what it depicts.\n *\n * Colour comes from the `--ds-illustration-*` roles: the line is\n * `currentColor`, which defaults to `--ds-illustration-line`, so a parent\n * that sets `color` recolours the plain line. Strokes do not scale, so a\n * drawing keeps `--ds-illustration-stroke-width` at every size.\n */\nexport function Illustration({\n source,\n size = 'md',\n at,\n className,\n label,\n decorative,\n}: IllustrationProps) {\n const classes = cx('ds-illustration', !at && `ds-illustration--${size}`, className);\n const placement = at && { x: at.x, y: at.y, width: at.size, height: at.size };\n\n return createElement(source, {\n ...placement,\n role: decorative ? undefined : 'img',\n 'aria-label': label,\n 'aria-hidden': decorative || undefined,\n focusable: 'false',\n className: classes,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/illustration/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/illustration/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './illustration';\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa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AU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ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,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './alert';\nexport * from './avatar';\nexport * from './badge';\nexport * from './breadcrumb';\nexport * from './button';\nexport * from './calendar';\nexport * from './card';\nexport * from './centered-layout';\nexport * from './checkbox';\nexport * from './combobox';\nexport { cx } from './cx';\nexport * from './date-input';\nexport * from './dialog';\nexport * from './divider';\nexport * from './empty-state';\nexport {\n Check as FallbackCheck,\n ChevronLeft as FallbackChevronLeft,\n ChevronRight as FallbackChevronRight,\n Cross as FallbackCross,\n Pin as FallbackPin,\n} from './fallback-glyphs';\nexport * from './field';\nexport * from './form-layout';\nexport * from './icon';\nexport * from './illustration';\nexport * from './layout';\nexport * from './link';\nexport type { LinkComponentProps } from './link-component';\nexport * from './menu';\nexport * from './page-layout';\nexport * from './popover';\nexport * from './progress';\nexport * from './reorder-control';\nexport * from './scroll-area';\nexport * from './section';\nexport * from './segment-group';\nexport * from './select';\nexport * from './show';\nexport * from './skeleton';\nexport * from './slider';\nexport * from './spinner';\nexport * from './split-layout';\nexport * from './sticky';\nexport * from './switch';\nexport * from './tabs';\nexport * from './text';\nexport * from './visually-hidden';\nexport * from './wizard-layout';\n"]}
|
package/dist/iso-date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iso-date.js","sourceRoot":"","sources":["../src/iso-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa;IACrD,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,oDAAoD,GAAG,GAAG,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"iso-date.js","sourceRoot":"","sources":["../src/iso-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa;IACrD,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,oDAAoD,GAAG,GAAG,CAAC,CAAC;IACtF,CAAC;AACH,CAAC","sourcesContent":["import { type DateValue, parseDate } from '@internationalized/date';\n\n/**\n * Parses the ISO calendar date, `YYYY-MM-DD`, that `DateInput` and\n * `Calendar` take and give, or throws naming the prop. A wrong shape throws\n * during render, where the product passed it: a timestamp or a locale\n * string is a bug in the caller, and a control that showed something else\n * would hide it.\n */\nexport function parseIsoDate(iso: string, label: string): DateValue {\n try {\n return parseDate(iso);\n } catch {\n throw new Error(`${label} must be an ISO calendar date (YYYY-MM-DD), got \"${iso}\"`);\n }\n}\n"]}
|
package/dist/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type {\n Breakpoint,\n ContainerAlign,\n ContainerProps,\n ContentWidth,\n ControlWidth,\n FrameProps,\n FrameWidth,\n GridColumns,\n GridProps,\n InlineProps,\n LayoutAlign,\n LayoutGap,\n LayoutJustify,\n LayoutPadding,\n LayoutSurface,\n Responsive,\n SpacerProps,\n StackProps,\n} from './layout';\nexport { Container, Frame, Grid, Inline, Spacer, Stack } from './layout';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AAAA,OA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,MAAM,CAAC;IACrB,KAAK,MAAM,UAAU,IAAI,qBAAqB,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,IAAI;YAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC;IAC/C,CAAC;IACD,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,KAAK,EACL,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,IAAI,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACG;IACX,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,UAAU,EACV,KAAK,IAAI,iBAAiB,EAC1B,IAAI,IAAI,gBAAgB,EACxB,CAAC,MAAM,IAAI,qBAAqB,EAChC,SAAS,CACV,EACD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAC1D,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAe;IACzD,OAAO,6BAAiB,MAAM,EAAC,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACtF,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps, CSSProperties } from 'react';\nimport './layout.css';\nimport { cx } from '../cx';\n\n/**\n * The distance between the children of a layout primitive. The words are the\n * semantic `space.gap-*` steps; `none` removes the gap.\n */\nexport type LayoutGap = 'none' | 'tight' | 'normal' | 'relaxed' | 'loose';\n\n/** The inset of a layout primitive from its edge: the semantic `space.padding-*` steps. */\nexport type LayoutPadding = 'none' | 'tight' | 'normal' | 'relaxed';\n\n/** Cross-axis placement of the children. */\nexport type LayoutAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';\n\n/** Main-axis distribution of the children. */\nexport type LayoutJustify = 'start' | 'center' | 'end' | 'between';\n\n/** Where a block of content stops growing: the semantic `size.content.*` steps. */\nexport type ContentWidth = 'sm' | 'md' | 'lg' | 'xl';\n\n/** Where a layout changes shape: the semantic `size.viewport.*` steps. */\nexport type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';\n\n/** A value per breakpoint, from the narrowest viewport (`base`) up. */\nexport type Responsive<T> = Partial<Record<'base' | Breakpoint, T>>;\n\n/** The width a control takes in a row when it is not left to the row: the semantic `control.width.*` steps. */\nexport type ControlWidth = 'sm' | 'md' | 'lg';\n\n/**\n * The surface drawn behind a layout primitive's children. `outlined` is a\n * hairline border; `subtle` a tinted fill; `raised` the raised fill with a\n * border; `dashed` a dashed border for a drop target or an empty slot. All\n * take the surface radius; pair with `padding` for the inset.\n */\nexport type LayoutSurface = 'outlined' | 'subtle' | 'raised' | 'dashed';\n\ninterface LayoutModifiers {\n /** Space between the children. Defaults to `normal`. */\n gap?: LayoutGap;\n /** Inset from the primitive's own edge. Defaults to `none`. */\n padding?: LayoutPadding;\n /** Cross-axis placement of the children. */\n align?: LayoutAlign;\n /** Main-axis distribution of the children. */\n justify?: LayoutJustify;\n /** A surface behind the children: a row, a panel, a drop target. */\n surface?: LayoutSurface;\n}\n\nfunction modifierClasses({\n gap = 'normal',\n padding = 'none',\n align,\n justify,\n surface,\n}: LayoutModifiers) {\n return cx(\n 'ds-layout',\n gap !== 'normal' && `ds-layout--gap-${gap}`,\n padding !== 'none' && `ds-layout--padding-${padding}`,\n align && `ds-layout--align-${align}`,\n justify && `ds-layout--justify-${justify}`,\n surface && `ds-layout--surface-${surface}`,\n );\n}\n\nexport interface StackProps extends ComponentProps<typeof ark.div>, LayoutModifiers {\n /**\n * A hairline between each pair of children, centred in the gap. A list of\n * rows that read as one column: the quarters of a review, a settings\n * dialog's sections.\n */\n divided?: boolean;\n}\n\n/**\n * A column of children with one gap between them.\n *\n * The workhorse of page composition: a form's fields, a card's regions, a\n * list of sections. Renders a `div`; pass `asChild` to lay out your own\n * element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic\n * step, so a product never writes a number.\n */\nexport function Stack({\n gap,\n padding,\n align,\n justify,\n surface,\n divided = false,\n className,\n children,\n ...props\n}: StackProps) {\n return (\n <ark.div\n className={cx(\n 'ds-stack',\n divided && 'ds-stack--divided',\n modifierClasses({ gap, padding, align, justify, surface }),\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\nexport interface InlineProps extends ComponentProps<typeof ark.div>, LayoutModifiers {\n /**\n * Whether the children wrap onto new lines when the row runs out of room.\n * Defaults to `true`; a row that must stay on one line (a toolbar in a\n * sideways scroller) passes `false`.\n */\n wrap?: boolean;\n}\n\n/**\n * A row of children with one gap between them, centred on the cross axis.\n *\n * A title beside its actions, a group of badges, a footer of buttons. Wraps by\n * default, so a long label takes a line of its own instead of squeezing its\n * neighbours. Renders a `div`; pass `asChild` to lay out your own element.\n */\nexport function Inline({\n gap,\n padding,\n align = 'center',\n justify,\n surface,\n wrap = true,\n className,\n children,\n ...props\n}: InlineProps) {\n return (\n <ark.div\n className={cx(\n 'ds-inline',\n !wrap && 'ds-inline--nowrap',\n modifierClasses({ gap, padding, align, justify, surface }),\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\n/** How many columns a grid has; `Responsive` for a count per breakpoint. */\nexport type GridColumns = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface GridProps\n extends ComponentProps<typeof ark.div>,\n Omit<LayoutModifiers, 'justify'> {\n /**\n * A fixed number of columns, or a number per breakpoint\n * (`{ base: 1, md: 2, lg: 3 }`). Without it the grid fills itself with as\n * many `minColumnWidth`-wide columns as fit.\n */\n columns?: GridColumns | Responsive<GridColumns>;\n /**\n * The narrowest a column may be when the grid fills itself: a content\n * width step. Defaults to `sm`. Ignored when `columns` is set.\n */\n minColumnWidth?: Exclude<ContentWidth, 'xl'>;\n}\n\nconst COLUMN_VARIABLES: Record<'base' | Breakpoint, string> = {\n base: '--_grid-columns-base',\n sm: '--_grid-columns-sm',\n md: '--_grid-columns-md',\n lg: '--_grid-columns-lg',\n xl: '--_grid-columns-xl',\n};\n\nconst BREAKPOINTS_ASCENDING: ('base' | Breakpoint)[] = ['base', 'sm', 'md', 'lg', 'xl'];\n\n/**\n * The column counts as the private custom properties `layout.css` reads, one\n * per breakpoint, every one written: a count carries forward to the wider\n * steps until the map names another, and a map without `base` starts at one\n * column. Writing all five is what keeps a nested grid its own — custom\n * properties inherit, so a step left unset would resolve to the parent\n * grid's count instead of the fallback.\n */\nfunction gridColumnStyle(columns: GridColumns | Responsive<GridColumns>): CSSProperties {\n const perBreakpoint: Responsive<GridColumns> =\n typeof columns === 'number' ? { base: columns } : { base: 1, ...columns };\n const style: Record<string, number> = {};\n let current: GridColumns = 1;\n for (const breakpoint of BREAKPOINTS_ASCENDING) {\n current = perBreakpoint[breakpoint] ?? current;\n style[COLUMN_VARIABLES[breakpoint]] = current;\n }\n return style as CSSProperties;\n}\n\n/**\n * Children in equal columns.\n *\n * Two modes. Without `columns` the grid is self-filling: as many columns of\n * at least `minColumnWidth` as fit, so a row of cards reflows by itself.\n * With `columns` the count is fixed, or fixed per breakpoint. Rows take the\n * height of their tallest child; pass `align=\"start\"` to stop short cards\n * stretching. Renders a `div`; pass `asChild` to lay out your own element.\n */\nexport function Grid({\n columns,\n minColumnWidth = 'sm',\n gap,\n padding,\n align,\n surface,\n className,\n style,\n children,\n ...props\n}: GridProps) {\n return (\n <ark.div\n className={cx(\n 'ds-grid',\n columns ? 'ds-grid--columns' : `ds-grid--fill-${minColumnWidth}`,\n modifierClasses({ gap, padding, align, surface }),\n className,\n )}\n style={columns ? { ...gridColumnStyle(columns), ...style } : style}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\n/** Where a column sits in a wider parent: centred, or at the start. */\nexport type ContainerAlign = 'center' | 'start';\n\nexport interface ContainerProps extends ComponentProps<typeof ark.div> {\n /**\n * Where the content stops growing: a content width step. Defaults to `xl`,\n * the width of a page. A dialog or sign-in card is `md`; a form or a\n * reading column is `lg`.\n */\n size?: ContentWidth;\n /**\n * Inset from the viewport's edge, applied inline only, so a container never\n * adds vertical rhythm of its own. Defaults to `none`.\n */\n padding?: LayoutPadding;\n /**\n * Where the column sits when its parent is wider: centred by default, or\n * at the start for a width held inside a left-aligned page (a detail's\n * one card, a tab list held to a control's width).\n */\n align?: ContainerAlign;\n}\n\n/**\n * A centred column no wider than a content width step.\n *\n * Wraps a page, a form or a reading column so it stops growing at the same\n * width in every product. Renders a `div`; pass `asChild` to make your own\n * element the container (`<Container asChild><main>…</main></Container>`).\n */\nexport function Container({\n size = 'xl',\n padding = 'none',\n align = 'center',\n className,\n children,\n ...props\n}: ContainerProps) {\n return (\n <ark.div\n className={cx(\n 'ds-container',\n `ds-container--${size}`,\n padding !== 'none' && `ds-container--padding-${padding}`,\n align === 'start' && 'ds-container--align-start',\n className,\n )}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\n/** A frame's width: a control step, or the whole row. */\nexport type FrameWidth = ControlWidth | 'full';\n\nexport interface FrameProps extends ComponentProps<typeof ark.div> {\n /**\n * How wide the frame is: a control width step, `full` for the whole row,\n * or one per breakpoint (`{ base: 'full', sm: 'md' }`: the whole row on a\n * phone, a filter's width from `sm`). Without it the frame is as wide as\n * its content.\n */\n width?: FrameWidth | Responsive<FrameWidth>;\n /** Whether the frame takes the room left in its row or column. */\n grow?: boolean;\n /**\n * Whether the frame gives up width when its row runs short. Defaults to\n * `true`; a logo or a glyph that must keep its size passes `false`.\n */\n shrink?: boolean;\n}\n\nconst WIDTH_VARIABLES: Record<'base' | Breakpoint, string> = {\n base: '--_frame-width-base',\n sm: '--_frame-width-sm',\n md: '--_frame-width-md',\n lg: '--_frame-width-lg',\n xl: '--_frame-width-xl',\n};\n\nconst widthValue = (width: FrameWidth) =>\n width === 'full' ? '100%' : `var(--_frame-control-${width})`;\n\n/**\n * The width as the private properties `layout.css` reads, one per\n * breakpoint, every one written and carried forward from the narrower\n * steps, for the reason {@link gridColumnStyle} gives: a step left unset\n * would inherit from a frame further out.\n */\nfunction frameWidthStyle(width: FrameWidth | Responsive<FrameWidth>): CSSProperties {\n const perBreakpoint: Responsive<FrameWidth> = typeof width === 'string' ? { base: width } : width;\n const style: Record<string, string> = {};\n let current = 'auto';\n for (const breakpoint of BREAKPOINTS_ASCENDING) {\n const step = perBreakpoint[breakpoint];\n if (step) current = widthValue(step);\n style[WIDTH_VARIABLES[breakpoint]] = current;\n }\n return style as CSSProperties;\n}\n\n/**\n * A sized slot in a row or column.\n *\n * What a child of a Stack or Inline says about its own size when the row\n * should not decide: a filter select held to a control width, a search\n * field that takes the rest of the toolbar (`grow`), a logo that never\n * squeezes (`shrink={false}`), an alert that takes a line of its own in a\n * wrapping row (`width=\"full\"`). Renders a `div`; pass `asChild` to size\n * your own element.\n */\nexport function Frame({\n width,\n grow = false,\n shrink = true,\n className,\n style,\n children,\n ...props\n}: FrameProps) {\n return (\n <ark.div\n className={cx(\n 'ds-frame',\n width && 'ds-frame--width',\n grow && 'ds-frame--grow',\n !shrink && 'ds-frame--no-shrink',\n className,\n )}\n style={width ? { ...frameWidthStyle(width), ...style } : style}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\nexport type SpacerProps = ComponentProps<'div'>;\n\n/**\n * The room between two groups in a row or column: everything after it is\n * pushed to the far end. A form's delete button at the start with its\n * save and cancel at the end; a row's controls pushed past its text.\n * Takes no part in the accessibility tree.\n */\nexport function Spacer({ className, ...props }: SpacerProps) {\n return <div aria-hidden=\"true\" className={cx('ds-spacer', className)} {...props} />;\n}\n"]}
|
package/dist/link/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { LinkProps, LinkTone, LinkUnderline } from './link';\nexport { Link } from './link';\n"]}
|
package/dist/link/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,QAAQ,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,GAAG,CAAC,CAAC,IACJ,SAAS,EAAE,EAAE,CACX,SAAS,EACT,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,EAAE,EAC7C,SAAS,KAAK,QAAQ,IAAI,sBAAsB,SAAS,EAAE,EAC3D,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACH,CACT,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,QAAQ,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,GAAG,CAAC,CAAC,IACJ,SAAS,EAAE,EAAE,CACX,SAAS,EACT,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,EAAE,EAC7C,SAAS,KAAK,QAAQ,IAAI,sBAAsB,SAAS,EAAE,EAC3D,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACH,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './link.css';\nimport { cx } from '../cx';\n\n/** The link's colour: the link colour, or the text it sits in. */\nexport type LinkTone = 'default' | 'inherit';\n\n/** When the link is underlined. `always` is the default, since colour alone does not mark a link in running text. */\nexport type LinkUnderline = 'always' | 'hover';\n\nexport interface LinkProps extends ComponentProps<typeof ark.a> {\n /** Defaults to `default`. */\n tone?: LinkTone;\n /**\n * Defaults to `always`. `hover` is for a link whose place already says it\n * is one, such as a row's title in a list, never for a link in a sentence.\n */\n underline?: LinkUnderline;\n}\n\n/**\n * A text link: a destination in a sentence, a list or a footnote.\n *\n * Renders an `a`; for a router's link, pass `asChild` and the link as the\n * only child, which keeps its `href`, prefetch and handlers\n * (`<Link asChild><NextLink href=\"/goals\">Goals</NextLink></Link>`). An\n * action that navigates and looks like a button is `Button asChild` instead;\n * a card's one destination is `CardLink`.\n */\nexport function Link({\n tone = 'default',\n underline = 'always',\n className,\n children,\n ...props\n}: LinkProps) {\n return (\n <ark.a\n className={cx(\n 'ds-link',\n tone !== 'default' && `ds-link--tone-${tone}`,\n underline !== 'always' && `ds-link--underline-${underline}`,\n className,\n )}\n {...props}\n >\n {children}\n </ark.a>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-component.js","sourceRoot":"","sources":["../src/link-component.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"link-component.js","sourceRoot":"","sources":["../src/link-component.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * What a component that renders links passes the product's link component\n * (a router's `Link`, say): an anchor's essentials. Shared, so one adapter in\n * a product types against every component that takes a `linkComponent`.\n */\nexport interface LinkComponentProps {\n href: string;\n className?: string;\n children?: ReactNode;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu.js","sourceRoot":"","sources":["../../src/menu/action-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAuD,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,YAAY,CAAC;AA6FpB,SAAS,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAsB;IAC9F,MAAM,IAAI,GAAG,CACX,8BACE,gBAAM,SAAS,EAAC,oBAAoB,aACjC,IAAI,CAAC,IAAI,IAAI,CACZ,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,QAAC,SAAS,EAAC,oBAAoB,GAAG,CAChF,EACD,KAAC,OAAO,CAAC,QAAQ,cAAE,IAAI,CAAC,KAAK,GAAoB,IAC5C,EACN,IAAI,CAAC,OAAO,IAAI,CACf,eAAM,SAAS,EAAC,yBAAyB,YACvC,KAAC,IAAI,IAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC/C,CACR,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,EAAE,SAAS,EAAE,SAAS,EAAC,iBAAiB,eAAW,QAAQ,YAChE,MAAM,GACH,IACF,GACa,GACd,IACI,CAChB,CAAC;AACJ,CAAC","sourcesContent":["import { Menu as ArkMenu } from '@ark-ui/react/menu';\nimport { Portal } from '@ark-ui/react/portal';\nimport { type ElementType, type ReactElement, type ReactNode, useContext, useRef } from 'react';\nimport { cx } from '../cx';\nimport { Check } from '../fallback-glyphs';\nimport { Icon, type IconSource } from '../icon/icon';\nimport type { LinkComponentProps } from '../link-component';\nimport { PortalContainerContext } from '../portal-container';\nimport './menu.css';\n\nexport interface ActionMenuItem {\n /** Stable value reported by `onSelect`. */\n value: string;\n /** Text shown in the menu. Also what typeahead matches against. */\n label: string;\n /** Glyph before the label. Decorative: the label says what the item does. */\n icon?: IconSource;\n /**\n * Makes the item a link to this address, rendered through `linkComponent`.\n * Choosing it follows the link, with the keyboard too; `onSelect` still\n * reports its value.\n */\n href?: string;\n /**\n * Marks the link to the page the user is on: `aria-current=\"page\"`, and\n * the `itemIndicator` glyph after the label so the mark is not colour alone.\n */\n current?: boolean;\n /** Individually disable this item without removing it. */\n disabled?: boolean;\n /**\n * Whether choosing the item closes the menu. Defaults to `true`. Keep an\n * item open when its outcome shows in the `footer`, so a failure appears\n * where the click happened.\n */\n closeOnSelect?: boolean;\n}\n\n/**\n * The props a `linkComponent` receives. A plain `'a'` and a router's link\n * component both accept them; Ark adds the menu item's role, id, state\n * attributes and handlers on top, so the component must pass unknown props\n * and its `ref` on to the anchor it renders.\n */\nexport interface ActionMenuLinkProps extends LinkComponentProps {\n 'aria-current'?: 'page';\n}\n\nexport interface ActionMenuProps {\n /**\n * The element that opens the menu: a `<button>`, or a component that\n * passes its props and `ref` on to one, such as `IconButton` or\n * `MenuTrigger`. Ark renders it as the trigger, adding `aria-haspopup`,\n * `aria-expanded`, `aria-controls`, the open and close handlers and\n * `data-state`. Give it an accessible name that says what the menu holds,\n * such as \"Account menu\" or \"Main navigation\": the menu takes its name\n * from the trigger.\n */\n trigger: ReactElement;\n /** The actions and links, in order. */\n items: ActionMenuItem[];\n /** Fired with the item's `value` when one is chosen, a link included. */\n onSelect?: (value: string) => void;\n /**\n * Content above the items that says whose menu this is, such as the\n * signed-in user's name and email. It names the group of items for\n * assistive technology, so keep it to text and decorative elements.\n */\n header?: ReactNode;\n /**\n * A line under the items about the last action, such as \"Couldn't sign\n * out. Check your connection, then try again.\" It is announced when it\n * appears, and a press on it leaves the menu open. It is not an item and\n * sits beside the `menu` element, which may own only items, so keep it to\n * text and a decorative glyph rather than an `Alert`.\n */\n footer?: ReactNode;\n /**\n * Renders an item with an `href`. Defaults to `'a'`; pass a router's link\n * component for client-side navigation.\n */\n linkComponent?: ElementType<ActionMenuLinkProps>;\n /**\n * Glyph marking the `current` link. Defaults to a plain built-in check so\n * `@manakind/ui-core` renders on its own; products pass their own icon.\n */\n itemIndicator?: IconSource;\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n /** Fired with the requested state whenever the menu asks to open or close. */\n onOpenChange?: (open: boolean) => void;\n /** Extra class names on the menu's popup: the frame around the items and the footer. */\n className?: string;\n}\n\ninterface ActionMenuRowProps {\n item: ActionMenuItem;\n linkComponent: ElementType<ActionMenuLinkProps>;\n itemIndicator: IconSource;\n}\n\nfunction ActionMenuRow({ item, linkComponent: LinkComponent, itemIndicator }: ActionMenuRowProps) {\n const body = (\n <>\n <span className=\"ds-menu__item-body\">\n {item.icon && (\n <Icon source={item.icon} size=\"sm\" decorative className=\"ds-menu__item-icon\" />\n )}\n <ArkMenu.ItemText>{item.label}</ArkMenu.ItemText>\n </span>\n {item.current && (\n <span className=\"ds-menu__item-indicator\">\n <Icon source={itemIndicator} size=\"sm\" decorative />\n </span>\n )}\n </>\n );\n const itemProps = {\n value: item.value,\n valueText: item.label,\n disabled: item.disabled,\n closeOnSelect: item.closeOnSelect,\n className: 'ds-menu__item',\n };\n\n if (item.href === undefined) {\n return <ArkMenu.Item {...itemProps}>{body}</ArkMenu.Item>;\n }\n return (\n <ArkMenu.Item {...itemProps} asChild>\n <LinkComponent href={item.href} aria-current={item.current ? 'page' : undefined}>\n {body}\n </LinkComponent>\n </ArkMenu.Item>\n );\n}\n\n/**\n * A menu of actions and links, opened from a trigger, built on Ark UI's\n * Menu. The counterpart of `Menu`, whose items are mutually exclusive\n * choices: here every item does something or goes somewhere.\n *\n * Ark owns the hard parts: `menu` / `menuitem` semantics, roving highlight\n * with the arrow keys, Home/End, typeahead, Escape and click outside to\n * dismiss, following a link on Enter, and focus returning to the trigger on\n * close. This wrapper contributes the `ds-menu` classes and `--ds-menu-*`\n * bindings it shares with `Menu`, a flat `items` API, and the header and\n * footer slots.\n *\n * ```tsx\n * <ActionMenu\n * trigger={<IconButton icon={MenuGlyph} variant=\"tertiary\" aria-label=\"Main navigation\" />}\n * linkComponent={Link}\n * items={[\n * { value: 'dashboard', label: 'Dashboard', href: '/dashboard', current: true },\n * { value: 'goals', label: 'Goals', href: '/goals' },\n * ]}\n * />\n * ```\n *\n * Reach for this for an account menu, a row's overflow actions, or a\n * navigation that folds into a button on a phone. A set of choices where\n * exactly one is in effect is a `Menu`; a form field is a `Select`.\n *\n * The popup renders in a portal, at the same `z-index: 60` as Select's\n * listbox, and is mounted only while open, as `Menu`'s is.\n */\nexport function ActionMenu({\n trigger,\n items,\n onSelect,\n header,\n footer,\n linkComponent = 'a',\n itemIndicator = Check,\n open,\n onOpenChange,\n className,\n}: ActionMenuProps) {\n const portalContainer = useContext(PortalContainerContext);\n const handleSelect = (details: { value: string }) => onSelect?.(details.value);\n const handleOpenChange = (details: { open: boolean }) => onOpenChange?.(details.open);\n /*\n * Enter on a link item. Zag's default dispatches a click that does not\n * bubble, which the browser follows as a document load but React never\n * sees, so a router's link component could not take it over. `click()`\n * bubbles, and the link navigates the way a pointer click would.\n */\n const navigate = (details: { node: HTMLAnchorElement }) =>\n queueMicrotask(() => details.node.click());\n /*\n * The footer sits beside the `menu` element, not in it, because a menu may\n * own only items. To Zag that makes it outside, so a press on the message\n * would dismiss the menu; this keeps it open.\n */\n const footerRef = useRef<HTMLDivElement>(null);\n const keepOpenForFooter = (event: CustomEvent<{ originalEvent: Event }>) => {\n const target = event.detail.originalEvent.target;\n if (target instanceof Node && footerRef.current?.contains(target)) event.preventDefault();\n };\n\n const rows = items.map((item) => (\n <ActionMenuRow\n key={item.value}\n item={item}\n linkComponent={linkComponent}\n itemIndicator={itemIndicator}\n />\n ));\n const list =\n header === undefined ? (\n rows\n ) : (\n <ArkMenu.ItemGroup>\n <ArkMenu.ItemGroupLabel className=\"ds-menu__header\">{header}</ArkMenu.ItemGroupLabel>\n {rows}\n </ArkMenu.ItemGroup>\n );\n\n return (\n <ArkMenu.Root\n lazyMount\n unmountOnExit\n open={open}\n onOpenChange={handleOpenChange}\n onSelect={handleSelect}\n navigate={navigate}\n onInteractOutside={keepOpenForFooter}\n >\n <ArkMenu.Trigger asChild>{trigger}</ArkMenu.Trigger>\n\n <Portal container={portalContainer}>\n <ArkMenu.Positioner>\n <div className={cx('ds-menu__popup', className)}>\n <ArkMenu.Content className=\"ds-menu__content\">{list}</ArkMenu.Content>\n <div ref={footerRef} className=\"ds-menu__footer\" aria-live=\"polite\">\n {footer}\n </div>\n </div>\n </ArkMenu.Positioner>\n </Portal>\n </ArkMenu.Root>\n );\n}\n"]}
|
package/dist/menu/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/menu/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/menu/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { ActionMenuItem, ActionMenuLinkProps, ActionMenuProps } from './action-menu';\nexport { ActionMenu } from './action-menu';\nexport type { MenuItem, MenuProps, MenuTriggerProps } from './menu';\nexport { Menu, MenuTrigger } from './menu';\n"]}
|
package/dist/menu/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/menu/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAA0C,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,YAAY,CAAC;AA6EpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,GAAG,YAAY,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS;IACjB,OAAO,CACL,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,aAC1E,QAAQ,EACT,KAAC,IAAI,IAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,QAAC,SAAS,EAAC,4BAA4B,GAAG,IAChF,CACV,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,IAAI,CAA4B,EAC9C,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EAC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K,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,MAAC,OAAO,CAAC,SAAS,IAEhB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,IAAI,CAAC,KAAK,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,eAAe,aAEzB,gBAAM,SAAS,EAAC,oBAAoB,aACjC,IAAI,CAAC,IAAI,IAAI,CACZ,KAAC,IAAI,IACH,MAAM,EAAE,IAAI,CAAC,IAAI,EACjB,IAAI,EAAC,IAAI,EACT,UAAU,QACV,SAAS,EAAC,oBAAoB,GAC9B,CACH,EACD,KAAC,OAAO,CAAC,QAAQ,cAAE,IAAI,CAAC,KAAK,GAAoB,IAC5C,EACP,KAAC,OAAO,CAAC,aAAa,IAAC,SAAS,EAAC,yBAAyB,YACxD,KAAC,IAAI,IAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC9B,KAnBnB,IAAI,CAAC,KAAK,CAoBG,CACrB,CAAC,IACqB,GACT,GACd,GACa,GACd,IACI,CAChB,CAAC;AACJ,CAAC","sourcesContent":["import { Menu as ArkMenu } from '@ark-ui/react/menu';\nimport { Portal } from '@ark-ui/react/portal';\nimport { type ComponentProps, type ReactElement, useCallback, useContext } from 'react';\nimport { cx } from '../cx';\nimport { Check, ChevronRight } from '../fallback-glyphs';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { PortalContainerContext } from '../portal-container';\nimport './menu.css';\n\nexport interface MenuItem<V extends string = string> {\n /** Stable value reported by `onValueChange` and compared with `value`. */\n value: V;\n /** Text shown in the menu. Also what typeahead matches against. */\n label: string;\n /** Individually disable this choice without removing it. */\n disabled?: boolean;\n /**\n * Glyph before the label, supplied by the product, as on an ActionMenu\n * item: the mark a choice also carries on its trigger. Decorative; the\n * label carries the meaning.\n */\n icon?: IconSource;\n}\n\n/**\n * Generic over the value type, so a union of choices (`'draft' | 'live'`)\n * comes back out of `onValueChange` as that union rather than as `string`.\n */\nexport interface MenuProps<V extends string = string> {\n /**\n * The element that opens the menu: a `<button>`, or a component that\n * passes its props and `ref` on to one.\n *\n * Ark renders it as the trigger, adding `aria-haspopup`, `aria-expanded`,\n * `aria-controls`, the open/close handlers and `data-state` (`open` or\n * `closed`, for a product's own indicator). Its own handlers still run.\n * Give it an accessible name that says what is chosen and what pressing\n * it does, such as \"Status: In progress. Change status\": the menu takes\n * its name from the trigger.\n */\n trigger: ReactElement;\n /**\n * What the items choose between, such as \"Status\". Names the group of\n * choices for assistive technology; it is not shown.\n */\n label: string;\n /** The choices, in order. Exactly one is checked: the one matching `value`. */\n items: MenuItem<V>[];\n /**\n * The checked choice. Controlled only: the menu reports a choice through\n * `onValueChange` and shows whatever `value` says next. A value matching\n * no item leaves nothing checked.\n */\n value: V;\n /**\n * Fired when a different choice is made. Choosing the item that is already\n * checked closes the menu without firing, so a consumer that saves on\n * change never writes the same value twice.\n */\n onValueChange: (value: V) => void;\n /**\n * Glyph marking the checked choice.\n *\n * Defaults to a plain built-in check so `@manakind/ui-core` installs and\n * renders on its own. Products override it with their own icon set, as\n * they do Select's `itemIndicator`.\n */\n itemIndicator?: IconSource;\n /** Extra class names on the menu's popup: the frame around the items. */\n className?: string;\n}\n\nexport interface MenuTriggerProps extends Omit<ComponentProps<'button'>, 'type'> {\n /**\n * Glyph after the content saying it opens a menu. Must point RIGHT, as\n * Select's indicator does: the trigger turns it down while closed and up\n * while open, so one glyph serves both states.\n *\n * Defaults to a plain built-in chevron. Products override it with their\n * own icon set.\n */\n indicator?: IconSource;\n}\n\n/**\n * A quiet, compact trigger for a `Menu`: the content it is given, then a\n * chevron, with a fill on hover and while open, and the focus ring.\n *\n * For a trigger that wraps something with its own look, such as a status\n * `Badge`, where a `Button` would add a second frame and its own height. It\n * takes the size of its content and inherits its font and colour.\n *\n * ```tsx\n * <Menu\n * trigger={\n * <MenuTrigger aria-label={`Status: ${status}. Change status`}>\n * <Badge variant=\"info\" appearance=\"plain\">{status}</Badge>\n * </MenuTrigger>\n * }\n * …\n * />\n * ```\n */\nexport function MenuTrigger({\n indicator = ChevronRight,\n className,\n children,\n ...props\n}: MenuTriggerProps) {\n return (\n <button type=\"button\" className={cx('ds-menu__trigger', className)} {...props}>\n {children}\n <Icon source={indicator} size=\"sm\" decorative className=\"ds-menu__trigger-indicator\" />\n </button>\n );\n}\n\n/**\n * A menu of mutually exclusive choices, opened from a trigger and applied\n * at once, built on Ark UI's Menu.\n *\n * Ark owns the hard parts: `menu` / `menuitemradio` semantics, roving\n * highlight with the arrow keys, Home/End, typeahead, Escape and click\n * outside to dismiss, and focus returning to the trigger on close. This\n * wrapper contributes `ds-` classes, the `--ds-menu-*` bindings, and a flat\n * `items` API in place of Ark's anatomy.\n *\n * ```tsx\n * <Menu\n * trigger={<button type=\"button\" aria-label=\"Status: In Progress. Change status\">…</button>}\n * label=\"Status\"\n * items={[\n * { value: 'Not Started', label: 'Not Started' },\n * { value: 'In Progress', label: 'In Progress' },\n * { value: 'Completed', label: 'Completed' },\n * ]}\n * value={status}\n * onValueChange={setStatus}\n * />\n * ```\n *\n * Reach for this when the choice takes effect immediately, from a control\n * that is not a form field — a status badge, a sort order. A form field\n * whose value is submitted later is a `Select`.\n *\n * The popup renders in a portal, at the same `z-index: 60` as Select's\n * listbox, a step above the products' overlay layer (50), so it paints above\n * the page or dialog it opens from. It is mounted only while open, so a list\n * of a hundred menus adds nothing to the page until one is opened.\n */\nexport function Menu<V extends string = string>({\n trigger,\n label,\n items,\n value,\n onValueChange,\n itemIndicator = Check,\n className,\n}: MenuProps<V>) {\n /*\n * Ark reports the value as a string; mapping it back through `items`\n * returns the caller's own type without a cast, and drops anything that is\n * not one of the choices.\n */\n const handleValueChange = useCallback(\n (details: { value: string }) => {\n const chosen = items.find((item) => item.value === details.value);\n if (chosen && chosen.value !== value) onValueChange(chosen.value);\n },\n [items, value, onValueChange],\n );\n\n const portalContainer = useContext(PortalContainerContext);\n\n return (\n <ArkMenu.Root lazyMount unmountOnExit>\n <ArkMenu.Trigger asChild>{trigger}</ArkMenu.Trigger>\n\n <Portal container={portalContainer}>\n <ArkMenu.Positioner>\n <div className={cx('ds-menu__popup', className)}>\n <ArkMenu.Content className=\"ds-menu__content\">\n <ArkMenu.RadioItemGroup value={value} onValueChange={handleValueChange}>\n <ArkMenu.ItemGroupLabel className=\"ds-menu__label\">{label}</ArkMenu.ItemGroupLabel>\n {items.map((item) => (\n <ArkMenu.RadioItem\n key={item.value}\n value={item.value}\n valueText={item.label}\n disabled={item.disabled}\n className=\"ds-menu__item\"\n >\n <span className=\"ds-menu__item-body\">\n {item.icon && (\n <Icon\n source={item.icon}\n size=\"sm\"\n decorative\n className=\"ds-menu__item-icon\"\n />\n )}\n <ArkMenu.ItemText>{item.label}</ArkMenu.ItemText>\n </span>\n <ArkMenu.ItemIndicator className=\"ds-menu__item-indicator\">\n <Icon source={itemIndicator} size=\"sm\" decorative />\n </ArkMenu.ItemIndicator>\n </ArkMenu.RadioItem>\n ))}\n </ArkMenu.RadioItemGroup>\n </ArkMenu.Content>\n </div>\n </ArkMenu.Positioner>\n </Portal>\n </ArkMenu.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export type {\n PageActionsProps,\n PageDescriptionProps,\n PageHeaderProps,\n PageLayoutProps,\n PageTitleProps,\n} from './page-layout';\nexport { PageActions, PageDescription, PageHeader, PageLayout, PageTitle } from './page-layout';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-layout.js","sourceRoot":"","sources":["../../src/page-layout/page-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAUhF;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IACxF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,YAAY,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,YACxE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,MAAM,IAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC/D,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IACzE,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,6CAA6C;AAC7C,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CAC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AACH,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IACzE,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,6CAA6C;AAC7C,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC3E,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAID,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC7D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './page-layout.css';\nimport { cx } from '../cx';\nimport type { ContentWidth } from '../layout/layout';\nimport { Heading, type HeadingProps, Text, type TextProps } from '../text/text';\n\nexport interface PageLayoutProps extends ComponentProps<typeof ark.div> {\n /**\n * Where the page's content stops growing. Defaults to `xl`, a full page; a\n * settings page or a reading page is `lg`.\n */\n size?: ContentWidth;\n}\n\n/**\n * The template every page composes: a centred column with the page's inset\n * and the rhythm between its regions.\n *\n * Children are the page's regions, usually a {@link PageHeader} and then\n * {@link Section}s, separated by `--ds-page-gap`. The inset from the viewport\n * is `--ds-page-padding-inline` and `--ds-page-padding-block`. Renders a\n * `div`; pass `asChild` to make the page a landmark\n * (`<PageLayout asChild><main>…</main></PageLayout>`).\n */\nexport function PageLayout({ size = 'xl', className, children, ...props }: PageLayoutProps) {\n return (\n <ark.div className={cx('ds-page', `ds-page--${size}`, className)} {...props}>\n {children}\n </ark.div>\n );\n}\n\nexport type PageHeaderProps = ComponentProps<typeof ark.header>;\n\n/**\n * The top of a page: its {@link PageTitle}, an optional {@link PageDescription}\n * and optional {@link PageActions}. The title and description stack; the\n * actions sit beside them from `md` up and under them on a narrower viewport.\n */\nexport function PageHeader({ className, children, ...props }: PageHeaderProps) {\n return (\n <ark.header className={cx('ds-page__header', className)} {...props}>\n {children}\n </ark.header>\n );\n}\n\nexport type PageTitleProps = Omit<HeadingProps, 'level'>;\n\n/**\n * The page's one `h1`. Takes a `ref` for focus management after a route\n * change or a removal, like any heading.\n */\nexport function PageTitle({ className, children, ...props }: PageTitleProps) {\n return (\n <Heading level={1} className={cx('ds-page__title', className)} {...props}>\n {children}\n </Heading>\n );\n}\n\nexport type PageDescriptionProps = TextProps;\n\n/** Muted supporting copy under the title. */\nexport function PageDescription({ className, children, ...props }: PageDescriptionProps) {\n return (\n <Text tone=\"muted\" className={cx('ds-page__description', className)} {...props}>\n {children}\n </Text>\n );\n}\n\nexport type PageActionsProps = ComponentProps<typeof ark.div>;\n\n/** The page's primary controls, a wrapping row aligned to the end. */\nexport function PageActions({ className, children, ...props }: PageActionsProps) {\n return (\n <ark.div className={cx('ds-page__actions', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4C,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4C,MAAM,WAAW,CAAC","sourcesContent":["export { Popover, type PopoverPlacement, type PopoverProps } from './popover';\n"]}
|
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BACW,KAAK,YAEhB,QAAQ,GACU,GACC,GACjB,IACO,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { Popover as ArkPopover } from '@ark-ui/react/popover';\nimport { Portal } from '@ark-ui/react/portal';\nimport { type ReactElement, type ReactNode, useContext } from 'react';\nimport { cx } from '../cx';\nimport { PortalContainerContext } from '../portal-container';\nimport './popover.css';\n\nexport type PopoverPlacement =\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'top-start'\n | 'top'\n | 'top-end';\n\nexport interface PopoverProps {\n /**\n * The element that opens the popover: a `<button>`, or a component that\n * passes its props and `ref` on to one.\n *\n * Ark renders it as the trigger, adding `aria-haspopup=\"dialog\"`,\n * `aria-expanded`, `aria-controls`, the open/close handlers and\n * `data-state` (`open` or `closed`, for a product's own indicator). Its\n * own handlers still run. Give it an accessible name that says what the\n * popover holds, such as \"Categories: Health, Career\": the popover takes\n * its own name from `label`.\n */\n trigger: ReactElement;\n /**\n * What the popover is, such as \"Categories\". Names the panel for\n * assistive technology; it is not shown. The trigger already says it.\n */\n label: string;\n /** What the popover holds: a group of checkboxes, a short form, a note. */\n children: ReactNode;\n /** Controlled open state. Leave undefined to let the component own it. */\n open?: boolean;\n /** Initial state when uncontrolled. */\n defaultOpen?: boolean;\n /** Fired whenever the popover opens or closes, by any means. */\n onOpenChange?: (open: boolean) => void;\n /**\n * Where the popover sits relative to the trigger. It flips to the other\n * side when there is no room. Defaults to `bottom-start`.\n */\n placement?: PopoverPlacement;\n /**\n * Make the popover as wide as its trigger, for a popover that stands in\n * for a listbox under a full-width control. Otherwise it is as wide as\n * its content, up to the room beside the trigger.\n */\n sameWidth?: boolean;\n /**\n * Move focus to the first focusable thing in the panel when it opens.\n * On by default. Turn it off when the content places focus itself, as a\n * `Calendar` with `autoFocus` does on its chosen day: the popover would\n * otherwise move it to the first button a frame later.\n */\n autoFocus?: boolean;\n /** Extra class names on the popover's panel. */\n className?: string;\n}\n\n/**\n * A small panel opened from a trigger and placed beside it, built on Ark\n * UI's Popover. It holds something richer than a menu's list of choices:\n * a group of checkboxes, a short form, a note with a link.\n *\n * Ark owns the hard parts: the `dialog` role, focus moving into the panel\n * on open and back to the trigger on close, Escape and click outside to\n * dismiss, and positioning that flips when there is no room. This wrapper\n * contributes `ds-` classes, the `--ds-popover-*` bindings, and a flat\n * prop API.\n *\n * ```tsx\n * <Popover trigger={<button type=\"button\">Categories: {chosen.join(', ')}</button>} label=\"Categories\">\n * <Checkbox label=\"Health\" checked={chosen.includes('Health')} onCheckedChange={toggle('Health')} />\n * <Checkbox label=\"Career\" checked={chosen.includes('Career')} onCheckedChange={toggle('Career')} />\n * </Popover>\n * ```\n *\n * The panel is mounted only while open, so what it holds lives in the\n * parent: a control inside is controlled, and the trigger reads the same\n * state.\n *\n * Reach for this when the content is more than a list of mutually\n * exclusive choices (that is a `Menu` or a `Select`) and less than a task\n * that should take the whole screen (that is a `Dialog`). The panel is not\n * modal: the page behind it stays usable, and a click on it closes the\n * panel.\n *\n * The panel renders in a portal at the `popup` stacking layer, as Select's\n * listbox and Menu's popup do, so it paints above the page or dialog it\n * opens from.\n */\nexport function Popover({\n trigger,\n label,\n children,\n open,\n defaultOpen,\n onOpenChange,\n placement = 'bottom-start',\n sameWidth = false,\n autoFocus = true,\n className,\n}: PopoverProps) {\n const portalContainer = useContext(PortalContainerContext);\n\n return (\n <ArkPopover.Root\n lazyMount\n unmountOnExit\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n positioning={{ placement, sameWidth }}\n autoFocus={autoFocus}\n >\n <ArkPopover.Trigger asChild>{trigger}</ArkPopover.Trigger>\n\n <Portal container={portalContainer}>\n <ArkPopover.Positioner>\n <ArkPopover.Content\n className={cx(\n 'ds-popover__content',\n sameWidth && 'ds-popover__content--same-width',\n className,\n )}\n aria-label={label}\n >\n {children}\n </ArkPopover.Content>\n </ArkPopover.Positioner>\n </Portal>\n </ArkPopover.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-container.js","sourceRoot":"","sources":["../src/portal-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CACjD,SAAS,CACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"portal-container.js","sourceRoot":"","sources":["../src/portal-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CACjD,SAAS,CACV,CAAC","sourcesContent":["import { createContext, type RefObject } from 'react';\n\n/**\n * Where a ui-core popup portals to. Unset, popups portal into `<body>`.\n *\n * A modal `Dialog` sets it to its panel. While a modal is open, Ark hides\n * every sibling of the panel in `<body>` from assistive tech, once, when it\n * opens; a popup portalled there afterwards, such as a Select's listbox,\n * would be focused but hidden. Rendered inside the panel, it stays readable,\n * inside the focus trap, and inside the area a click does not dismiss.\n */\nexport const PortalContainerContext = createContext<RefObject<HTMLElement | null> | undefined>(\n undefined,\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/progress/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/progress/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export type { ProgressProps, ProgressSize } from './progress';\nexport { Progress } from './progress';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress/progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,w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IAAC,SAAS,EAAC,oBAAoB,GAAG,GAClC,IACH,CACpB,CAAC;AACJ,CAAC","sourcesContent":["import { Progress as ArkProgress } from '@ark-ui/react/progress';\nimport { type ComponentProps, type ReactNode, useId } from 'react';\nimport './progress.css';\nimport { cx } from '../cx';\n\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\n/**\n * Exactly one of `label` or `aria-label` is required — without either, the\n * bar is announced as a bare percentage, which says nothing about what is\n * progressing. Expressed as a discriminated union so the omission is a\n * compile error rather than a convention, mirroring `IconProps`'\n * label/decorative union. `label` excludes `null`, `undefined` and booleans,\n * the values an optional one arrives as; an empty string still type-checks.\n */\ntype ProgressA11y =\n | {\n /**\n * Visible label rendered above the track. Also becomes the bar's\n * accessible name, so this is the preferred way to name a progress bar.\n */\n label: Exclude<ReactNode, null | undefined | boolean>;\n 'aria-label'?: never;\n }\n | {\n label?: never;\n /** Accessible name when there is no visible `label`. */\n 'aria-label': string;\n };\n\nexport type ProgressProps = Omit<\n ComponentProps<typeof ArkProgress.Root>,\n 'children' | 'aria-label' | 'aria-labelledby' | 'asChild'\n> &\n ProgressA11y & {\n /** Track thickness. `sm` suits inline use inside a card; `lg` stands alone. */\n size?: ProgressSize;\n /**\n * Text rendered opposite the label — typically a count like `2 of 5`.\n * Presentational; the value itself is announced from `aria-valuenow`.\n */\n valueText?: ReactNode;\n };\n\n/**\n * Determinate (or indeterminate) progress bar, built on Ark UI.\n *\n * Ark owns the ARIA value semantics — `aria-valuenow`, `aria-valuemin`,\n * `aria-valuemax`, and the indeterminate state when `value` is `null`.\n *\n * Naming needs care, because Ark places `role=\"progressbar\"` on the **track**\n * rather than the root and gives it a generated `aria-label` of the current\n * percentage. Left alone that means the bar announces as \"40%\" with no hint of\n * what is at 40%. This wrapper therefore points the track at the visible label\n * via `aria-labelledby`, or forwards `aria-label` to the track when there is no\n * visible label. `aria-labelledby` wins over Ark's generated `aria-label`, and\n * the percentage is still conveyed by the value attributes.\n *\n * ```tsx\n * <Progress value={2} max={5} label=\"Milestones\" valueText=\"2 of 5\" />\n * <Progress value={null} aria-label=\"Loading goals\" />\n * ```\n */\nexport function Progress({\n size = 'md',\n label,\n valueText,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: ProgressProps) {\n const labelId = useId();\n // Empty strings and numeric zero are supplied labels. An undefined ARIA\n // override would leave Ark's generated percentage name in place.\n const hasLabel = label !== undefined;\n const hasHeader = hasLabel || Boolean(valueText);\n\n return (\n <ArkProgress.Root className={cx('ds-progress', `ds-progress--${size}`, className)} {...props}>\n {hasHeader && (\n <div className=\"ds-progress__header\">\n {hasLabel ? (\n <ArkProgress.Label id={labelId} className=\"ds-progress__label\">\n {label}\n </ArkProgress.Label>\n ) : (\n <span />\n )}\n {valueText && <span className=\"ds-progress__value-text\">{valueText}</span>}\n </div>\n )}\n <ArkProgress.Track\n className=\"ds-progress__track\"\n {...(hasLabel ? { 'aria-labelledby': labelId } : { 'aria-label': ariaLabel })}\n >\n <ArkProgress.Range className=\"ds-progress__range\" />\n </ArkProgress.Track>\n </ArkProgress.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reorder-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAIf,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reorder-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAIf,MAAM,mBAAmB,CAAC","sourcesContent":["export {\n ReorderControl,\n type ReorderControlOrientation,\n type ReorderControlProps,\n type ReorderHandleProps,\n} from './reorder-control';\n"]}
|