@manakind/ui-core 0.25.0 → 0.26.0

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.
Files changed (121) hide show
  1. package/README.md +7 -5
  2. package/dist/alert/alert.js.map +1 -1
  3. package/dist/alert/index.js.map +1 -1
  4. package/dist/avatar/avatar.js.map +1 -1
  5. package/dist/avatar/index.js.map +1 -1
  6. package/dist/badge/badge.js.map +1 -1
  7. package/dist/badge/index.js.map +1 -1
  8. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  9. package/dist/breadcrumb/index.js.map +1 -1
  10. package/dist/button/button.js.map +1 -1
  11. package/dist/button/icon-button.d.ts +11 -3
  12. package/dist/button/icon-button.d.ts.map +1 -1
  13. package/dist/button/icon-button.js +5 -3
  14. package/dist/button/icon-button.js.map +1 -1
  15. package/dist/button/index.js.map +1 -1
  16. package/dist/calendar/calendar.js.map +1 -1
  17. package/dist/calendar/index.js.map +1 -1
  18. package/dist/card/card.js.map +1 -1
  19. package/dist/card/index.js.map +1 -1
  20. package/dist/centered-layout/centered-layout.js.map +1 -1
  21. package/dist/centered-layout/index.js.map +1 -1
  22. package/dist/checkbox/checkbox.js.map +1 -1
  23. package/dist/checkbox/index.js.map +1 -1
  24. package/dist/combobox/combobox.d.ts.map +1 -1
  25. package/dist/combobox/combobox.js +3 -2
  26. package/dist/combobox/combobox.js.map +1 -1
  27. package/dist/combobox/index.js.map +1 -1
  28. package/dist/cx.js.map +1 -1
  29. package/dist/date-input/date-input.js.map +1 -1
  30. package/dist/date-input/index.js.map +1 -1
  31. package/dist/dialog/dialog-close.js.map +1 -1
  32. package/dist/dialog/dialog.js.map +1 -1
  33. package/dist/dialog/index.js.map +1 -1
  34. package/dist/divider/divider.js.map +1 -1
  35. package/dist/divider/index.js.map +1 -1
  36. package/dist/empty-state/empty-state.js.map +1 -1
  37. package/dist/empty-state/index.js.map +1 -1
  38. package/dist/fallback-glyphs.js.map +1 -1
  39. package/dist/field/field.js.map +1 -1
  40. package/dist/field/index.js.map +1 -1
  41. package/dist/field/input.js.map +1 -1
  42. package/dist/field/textarea.js.map +1 -1
  43. package/dist/field/use-field-control.js.map +1 -1
  44. package/dist/form-layout/form-layout.js.map +1 -1
  45. package/dist/form-layout/index.js.map +1 -1
  46. package/dist/group-items.js.map +1 -1
  47. package/dist/icon/icon.js.map +1 -1
  48. package/dist/icon/index.js.map +1 -1
  49. package/dist/illustration/illustration.js.map +1 -1
  50. package/dist/illustration/index.js.map +1 -1
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +1 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/iso-date.js.map +1 -1
  56. package/dist/layout/index.js.map +1 -1
  57. package/dist/layout/layout.js.map +1 -1
  58. package/dist/link/index.js.map +1 -1
  59. package/dist/link/link.js.map +1 -1
  60. package/dist/link-component.js.map +1 -1
  61. package/dist/menu/action-menu.js.map +1 -1
  62. package/dist/menu/index.js.map +1 -1
  63. package/dist/menu/menu.js.map +1 -1
  64. package/dist/page-layout/index.js.map +1 -1
  65. package/dist/page-layout/page-layout.js.map +1 -1
  66. package/dist/popover/index.js.map +1 -1
  67. package/dist/popover/popover.js.map +1 -1
  68. package/dist/portal-container.js.map +1 -1
  69. package/dist/progress/index.js.map +1 -1
  70. package/dist/progress/progress.js.map +1 -1
  71. package/dist/reorder-control/index.js.map +1 -1
  72. package/dist/reorder-control/reorder-control.js.map +1 -1
  73. package/dist/scroll-area/index.js.map +1 -1
  74. package/dist/scroll-area/scroll-area.js.map +1 -1
  75. package/dist/section/index.js.map +1 -1
  76. package/dist/section/section.js.map +1 -1
  77. package/dist/segment-group/index.d.ts +1 -1
  78. package/dist/segment-group/index.d.ts.map +1 -1
  79. package/dist/segment-group/index.js.map +1 -1
  80. package/dist/segment-group/segment-group.css +63 -3
  81. package/dist/segment-group/segment-group.d.ts +27 -1
  82. package/dist/segment-group/segment-group.d.ts.map +1 -1
  83. package/dist/segment-group/segment-group.js +11 -2
  84. package/dist/segment-group/segment-group.js.map +1 -1
  85. package/dist/select/index.js.map +1 -1
  86. package/dist/select/select.css +3 -3
  87. package/dist/select/select.js.map +1 -1
  88. package/dist/show/index.js.map +1 -1
  89. package/dist/show/show.js.map +1 -1
  90. package/dist/skeleton/index.js.map +1 -1
  91. package/dist/skeleton/skeleton.js.map +1 -1
  92. package/dist/slider/index.js.map +1 -1
  93. package/dist/slider/slider.css +5 -3
  94. package/dist/slider/slider.js.map +1 -1
  95. package/dist/spinner/index.js.map +1 -1
  96. package/dist/spinner/spinner.js.map +1 -1
  97. package/dist/split-layout/index.js.map +1 -1
  98. package/dist/split-layout/split-layout.js.map +1 -1
  99. package/dist/sticky/index.js.map +1 -1
  100. package/dist/sticky/sticky.js.map +1 -1
  101. package/dist/switch/index.js.map +1 -1
  102. package/dist/switch/switch.js.map +1 -1
  103. package/dist/tabs/index.js.map +1 -1
  104. package/dist/tabs/tabs.js.map +1 -1
  105. package/dist/text/index.js.map +1 -1
  106. package/dist/text/text.js.map +1 -1
  107. package/dist/tooltip/index.d.ts +2 -0
  108. package/dist/tooltip/index.d.ts.map +1 -0
  109. package/dist/tooltip/index.js +2 -0
  110. package/dist/tooltip/index.js.map +1 -0
  111. package/dist/tooltip/tooltip.css +20 -0
  112. package/dist/tooltip/tooltip.css.d.ts +2 -0
  113. package/dist/tooltip/tooltip.d.ts +38 -0
  114. package/dist/tooltip/tooltip.d.ts.map +1 -0
  115. package/dist/tooltip/tooltip.js +41 -0
  116. package/dist/tooltip/tooltip.js.map +1 -0
  117. package/dist/visually-hidden/index.js.map +1 -1
  118. package/dist/visually-hidden/visually-hidden.js.map +1 -1
  119. package/dist/wizard-layout/index.js.map +1 -1
  120. package/dist/wizard-layout/wizard-layout.js.map +1 -1
  121. package/package.json +10 -2
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,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K,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"]}
@@ -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"]}
@@ -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,IACA,CACJ,CAAC;IACF,MAAM,SAAS,GAAG;QAChB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,KAAK;QACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QAC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{ 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"]}
@@ -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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../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C,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,I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AE,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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/popover/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAqC,UAAU,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EA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O,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,eAAe,CAAC;AA0DvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,SAAS,GAAG,cAAc,EAC1B,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,IAAI,EAChB,SAAS,GACI;IACb,MAAM,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAE3D,OAAO,CACL,MAAC,UAAU,CAAC,IAAI,IACd,SAAS,QACT,aAAa,QACb,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EACvD,WAAW,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EACrC,SAAS,EAAE,SAAS,aAEpB,KAAC,UAAU,CAAC,OAAO,IAAC,OAAO,kBAAE,OAAO,GAAsB,EAE1D,KAAC,MAAM,IAAC,SAAS,EAAE,eAAe,YAChC,KAAC,UAAU,CAAC,UAAU,cACpB,KAAC,UAAU,CAAC,OAAO,IACjB,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,SAAS,IAAI,iCAAiC,EAC9C,SAAS,CACV,gBACW,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,wBAAwB,CAAC;AACjE,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAyC3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,IAAI,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACM;IACd,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,QAAQ,GAAG,KAAK,K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OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,CAAC;IACrC,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEjD,OAAO,CACL,MAAC,WAAW,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,aACzF,SAAS,IAAI,CACZ,eAAK,SAAS,EAAC,qBAAqB,aACjC,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,WAAW,CAAC,KAAK,IAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,oBAAoB,YAC3D,KAAK,GACY,CACrB,CAAC,CAAC,CAAC,CACF,gBAAQ,CACT,EACA,SAAS,IAAI,eAAM,SAAS,EAAC,yBAAyB,YAAE,SAAS,GAAQ,IACtE,CACP,EACD,KAAC,WAAW,CAAC,KAAK,IAChB,SAAS,EAAC,oBAAoB,KAC1B,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,YAE7E,KAAC,WAAW,CAAC,KAAK,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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reorder-control.js","sourceRoot":"","sources":["../../src/reorder-control/reorder-control.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA2C,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAgDvC,SAAS,aAAa,CAAC,KAAa,EAAE,KAAa;IACjD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,E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M,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EACpE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EACzC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,QAAQ,GAClB,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { type ComponentProps, type KeyboardEvent, useState } from 'react';\nimport './reorder-control.css';\nimport { IconButton } from '../button/icon-button';\nimport { cx } from '../cx';\nimport { Input } from '../field/input';\nimport type { IconSource } from '../icon/icon';\n\n/**\n * What a drag library puts on the handle: its ref, ARIA attributes and\n * pointer and keyboard listeners. The handle's name, look and disabled state\n * stay the control's own.\n */\nexport type ReorderHandleProps = Omit<\n ComponentProps<'button'>,\n 'children' | 'aria-label' | 'className' | 'disabled' | 'type'\n>;\n\n/** How the handle and the position stand: side by side, or the handle above. */\nexport type ReorderControlOrientation = 'horizontal' | 'vertical';\n\nexport interface ReorderControlProps {\n /** The item's name. The handle is named \"Reorder …\" and the input \"Position of …\". */\n label: string;\n /** Where the item sits in its list, counting from 1. */\n position: number;\n /** How many items the list holds. A typed position is clamped to 1 through this. */\n count: number;\n /** Called with a typed position, once it is committed and only if it moved. */\n onPositionChange: (position: number) => void;\n /** Glyph on the drag handle, supplied by the product. */\n handleIcon: IconSource;\n /**\n * Spread onto the drag handle, so a drag library can drive it: with\n * dnd-kit, `{ ref: setActivatorNodeRef, ...attributes, ...listeners }`.\n */\n handleProps?: ReorderHandleProps;\n /**\n * `horizontal` (default) sets the position after the handle, for a row of\n * text. `vertical` stacks it under the handle, half as wide, for a column\n * beside a card, where a phone's row has little width to give.\n */\n orientation?: ReorderControlOrientation;\n /**\n * Disables the handle and the input. The drag library's own listeners and\n * ARIA come in through `handleProps`, so give it the same flag (dnd-kit:\n * `useSortable({ id, disabled })`), or a pointer can still start a drag.\n */\n disabled?: boolean;\n /** Extra class names appended after `ds-reorder-control`. */\n className?: string;\n}\n\nfunction clampPosition(value: number, count: number) {\n return Math.min(Math.max(value, 1), count);\n}\n\n/**\n * Two ways to move an item in an ordered list: a drag handle, then the\n * item's position as a number to retype.\n *\n * The handle is a button the product's drag library drives through\n * `handleProps`; the control only names it and gives it the grab cursor and\n * `touch-action: none` a pointer drag needs. The input is the way that does\n * not need a pointer or a drag library's keyboard mode: it keeps what is\n * typed (digits only) as a draft, selects its text on focus so a new number\n * replaces the old, and commits on Enter or blur. Enter only commits: in a\n * form it does not also submit it. A committed position is\n * clamped to the list and reported only if it moved; Escape drops the draft.\n *\n * ```tsx\n * <ReorderControl\n * label={item.title}\n * position={index + 1}\n * count={items.length}\n * onPositionChange={(position) => move(item.id, position)}\n * handleIcon={DragHandle}\n * handleProps={{ ref: setActivatorNodeRef, ...attributes, ...listeners }}\n * />\n * ```\n */\nexport function ReorderControl({\n label,\n position,\n count,\n onPositionChange,\n handleIcon,\n handleProps,\n orientation = 'horizontal',\n disabled = false,\n className,\n}: ReorderControlProps) {\n const [draft, setDraft] = useState<string | null>(null);\n\n const commit = () => {\n if (draft === null) return;\n setDraft(null);\n const typed = Number.parseInt(draft, 10);\n if (Number.isNaN(typed)) return;\n const next = clampPosition(typed, count);\n if (next !== position) onPositionChange(next);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n commit();\n }\n if (event.key === 'Escape') setDraft(null);\n };\n\n return (\n <div className={cx('ds-reorder-control', `ds-reorder-control--${orientation}`, className)}>\n <IconButton\n {...handleProps}\n type=\"button\"\n className=\"ds-reorder-control__handle\"\n variant=\"tertiary\"\n size=\"sm\"\n icon={handleIcon}\n aria-label={`Reorder ${label}`}\n disabled={disabled}\n />\n <Input\n className=\"ds-reorder-control__input\"\n size=\"sm\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n aria-label={`Position of ${label}`}\n value={draft ?? String(position)}\n onChange={(event) => setDraft(event.target.value.replace(/\\D/g, ''))}\n onFocus={(event) => event.target.select()}\n onBlur={commit}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n />\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scroll-area/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scroll-area/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export type { ScrollAreaProps, ScrollAxis } from './scroll-area';\nexport { ScrollArea } from './scroll-area';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/scroll-area/scroll-area.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB3B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC9F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBACtB,KAAK,EACjB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/B,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,IAAI,EAAE,EAAE,SAAS,CAAC,KACjE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/scroll-area/scroll-area.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB3B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC9F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBACtB,KAAK,EACjB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/B,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,IAAI,EAAE,EAAE,SAAS,CAAC,KACjE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './scroll-area.css';\nimport { cx } from '../cx';\n\n/** The axis a scroll area scrolls along. */\nexport type ScrollAxis = 'x' | 'y';\n\nexport interface ScrollAreaProps extends ComponentProps<typeof ark.div> {\n /** `y` (the default) scrolls a column that outgrows its box; `x` a row that outgrows its width. */\n axis?: ScrollAxis;\n /**\n * The region's name. A scroller with nothing focusable inside cannot be\n * reached from the keyboard, so naming it makes it a focusable region\n * that the arrow keys scroll; leave it out when a control inside takes\n * focus already.\n */\n label?: string;\n}\n\n/**\n * A box whose content scrolls inside it instead of widening the page.\n *\n * A tree or a grid wider than its card scrolls sideways; a list that must\n * not outgrow its panel scrolls down. The box is sized by its parent (a\n * dialog body, a popover, a Frame): the scroll area only keeps its content\n * inside. Renders a `div`; pass `asChild` to scroll your own element.\n */\nexport function ScrollArea({ axis = 'y', label, className, children, ...props }: ScrollAreaProps) {\n return (\n <ark.div\n role={label ? 'region' : undefined}\n aria-label={label}\n tabIndex={label ? 0 : undefined}\n className={cx('ds-scroll-area', `ds-scroll-area--${axis}`, className)}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type { SectionProps } from './section';\nexport { Section } from './section';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"section.js","sourceRoot":"","sources":["../../src/section/section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAiD,KAAK,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAE,MAAM,cAAc,CAAC;AA2BhE;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,UAAU,GAAG,CAAC,EACd,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACK;IACb,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,OAAO,CACL,MAAC,GAAG,CAAC,OAAO,uBAAkB,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,KAAM,KAAK,aACtF,eAAK,SAAS,EAAC,oBAAoB,aACjC,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,OAAO,IACN,KAAK,EAAE,UAAU,EACjB,IAAI,EAAC,IAAI,EACT,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,QAAQ,CAAC,CAA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CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACnC,SAAS,EAAC,mBAAmB,YAE5B,KAAK,GACE,EACT,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,yBAAyB,YACnD,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,qBAAqB,YAAE,OAAO,GAAO,CAAC,CAAC,CAAC,IAAI,IAClE,EACL,QAAQ,IACG,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport { type ComponentProps, type ReactNode, type Ref, useId } from 'react';\nimport './section.css';\nimport { cx } from '../cx';\nimport { Heading, type HeadingLevel, Text } from '../text/text';\n\n/**\n * No `asChild`: the region renders its own header beside `children`, and Ark's\n * `asChild` clones exactly one element, so it would render nothing.\n */\nexport interface SectionProps\n extends Omit<ComponentProps<typeof ark.section>, 'title' | 'asChild'> {\n /** The section's heading, which also names the region for assistive technology. */\n title: ReactNode;\n /**\n * The heading level of `title`. Defaults to `2`, a section of a page; a\n * section inside another section is `3`.\n */\n titleLevel?: HeadingLevel;\n /** Muted copy under the title. */\n description?: ReactNode;\n /** Controls beside the title: a \"See all\" link, a filter. */\n actions?: ReactNode;\n /**\n * The heading element, for moving focus to the region after a change\n * inside it (a deletion that removed the focused row). The heading takes\n * `tabIndex={-1}` so it can take focus without entering the tab order.\n */\n titleRef?: Ref<HTMLHeadingElement>;\n}\n\n/**\n * A titled region of a page.\n *\n * Renders a `section` named by its own heading (`aria-labelledby`), so a\n * screen reader can jump between the page's regions by name. The header is\n * title and description with the actions beside them; the children follow\n * at the section's own gap, tighter than the page's.\n */\nexport function Section({\n title,\n titleLevel = 2,\n description,\n actions,\n titleRef,\n className,\n children,\n ...props\n}: SectionProps) {\n const titleId = useId();\n return (\n <ark.section aria-labelledby={titleId} className={cx('ds-section', className)} {...props}>\n <div className=\"ds-section__header\">\n <div className=\"ds-section__heading\">\n <Heading\n level={titleLevel}\n size=\"xl\"\n id={titleId}\n ref={titleRef}\n tabIndex={titleRef ? -1 : undefined}\n className=\"ds-section__title\"\n >\n {title}\n </Heading>\n {description ? (\n <Text tone=\"muted\" className=\"ds-section__description\">\n {description}\n </Text>\n ) : null}\n </div>\n {actions ? <div className=\"ds-section__actions\">{actions}</div> : null}\n </div>\n {children}\n </ark.section>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- export { SegmentGroup, type SegmentGroupItem, type SegmentGroupProps, type SegmentGroupSize, } from './segment-group';
1
+ export { SegmentGroup, type SegmentGroupCustom, type SegmentGroupItem, type SegmentGroupProps, type SegmentGroupSize, } from './segment-group';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAIb,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segment-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAKb,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n SegmentGroup,\n type SegmentGroupCustom,\n type SegmentGroupItem,\n type SegmentGroupProps,\n type SegmentGroupSize,\n} from './segment-group';\n"]}
@@ -17,11 +17,12 @@
17
17
  calc(var(--ds-segment-group-track-radius) - var(--ds-segment-group-track-padding))
18
18
  );
19
19
 
20
+ /* Field's label, whatever the group's size, as every control a form names. */
20
21
  & .ds-segment-group__label {
21
22
  min-inline-size: 0;
22
- color: var(--ds-segment-group-label-text);
23
- font-size: var(--_segment-group-font-size);
24
- font-weight: var(--ds-segment-group-label-font-weight);
23
+ color: var(--ds-field-label-text);
24
+ font-size: var(--ds-field-label-font-size);
25
+ font-weight: var(--ds-field-label-font-weight);
25
26
  }
26
27
 
27
28
  /*
@@ -96,6 +97,65 @@
96
97
  }
97
98
  }
98
99
 
100
+ /*
101
+ * The custom field sits in the track as one more segment, drawn as a
102
+ * field so it reads as typed rather than chosen. While it is the choice
103
+ * its border takes the checked segment's colour.
104
+ */
105
+ & .ds-segment-group__custom {
106
+ display: inline-flex;
107
+ align-items: center;
108
+ gap: var(--ds-segment-group-custom-gap);
109
+ min-inline-size: 0;
110
+ padding: var(--_segment-group-padding-block) var(--_segment-group-padding-inline);
111
+ border: 1px solid var(--ds-input-border);
112
+ border-radius: var(--_segment-group-inner-radius);
113
+ background-color: var(--ds-input-bg);
114
+ color: var(--ds-input-text);
115
+ font-size: var(--_segment-group-font-size);
116
+ cursor: text;
117
+
118
+ &:hover:not([data-disabled]) {
119
+ border-color: var(--ds-input-border-hover);
120
+ }
121
+
122
+ &[data-state="checked"] {
123
+ border-color: var(--ds-segment-group-item-bg-checked);
124
+ box-shadow: 0 0 0 1px var(--ds-segment-group-item-bg-checked);
125
+ }
126
+
127
+ &:focus-within {
128
+ outline: 2px solid var(--ds-segment-group-focus-ring);
129
+ outline-offset: 3px;
130
+ }
131
+
132
+ &[data-disabled] {
133
+ opacity: var(--ds-opacity-disabled);
134
+ cursor: not-allowed;
135
+ }
136
+ }
137
+
138
+ & .ds-segment-group__custom-input {
139
+ flex: 1 1 auto;
140
+ inline-size: 100%;
141
+ min-inline-size: 3ch;
142
+ padding: 0;
143
+ border: 0;
144
+ background: transparent;
145
+ color: inherit;
146
+ font: inherit;
147
+ outline: none;
148
+
149
+ &::placeholder {
150
+ color: var(--ds-input-placeholder);
151
+ }
152
+ }
153
+
154
+ & .ds-segment-group__custom-unit {
155
+ flex-shrink: 0;
156
+ color: var(--ds-segment-group-item-text);
157
+ }
158
+
99
159
  /*
100
160
  * Content-sized: each segment starts at its label's width and the spare
101
161
  * width is shared out evenly. Short of room the segments shrink, but no
@@ -9,6 +9,26 @@ export interface SegmentGroupItem {
9
9
  /** Individually disable this choice without removing it. */
10
10
  disabled?: boolean;
11
11
  }
12
+ /**
13
+ * A value typed beside the segments, for one no segment offers: the minutes
14
+ * of a duration whose presets are 30 minutes and an hour. The consumer owns
15
+ * both values and keeps them agreeing: a typed value that matches a segment
16
+ * checks that segment, and choosing a segment fills the field with its value.
17
+ */
18
+ export interface SegmentGroupCustom {
19
+ /** What the field holds, `''` when empty. */
20
+ value: string;
21
+ /** Fired with the field's text on every change. */
22
+ onValueChange: (value: string) => void;
23
+ /** The field's accessible name ("Duration in minutes"); it has no visible label of its own. */
24
+ 'aria-label': string;
25
+ /** Shown while the field is empty. */
26
+ placeholder?: string;
27
+ /** A unit written after the value, such as `min`. Decorative: put the unit in `aria-label` too. */
28
+ unit?: string;
29
+ /** The keyboard a phone shows for the field. */
30
+ inputMode?: 'numeric' | 'decimal' | 'text';
31
+ }
12
32
  /**
13
33
  * A segment group has to have a name. A visible `label` is the one to reach
14
34
  * for; expressed as a union so an unnamed group is a compile error rather
@@ -64,6 +84,12 @@ export type SegmentGroupProps = SegmentGroupName & {
64
84
  * a state or effort choice in a form, level with the fields above it.
65
85
  */
66
86
  fullWidth?: boolean;
87
+ /**
88
+ * A field at the end of the track for a value no segment offers. While it
89
+ * holds a value and no segment is checked, it is drawn as the choice and
90
+ * submits under `name`.
91
+ */
92
+ custom?: SegmentGroupCustom;
67
93
  /** Disable every segment. The checked one keeps showing which is set. */
68
94
  disabled?: boolean;
69
95
  /** Name for native form participation through the hidden radio inputs. */
@@ -98,6 +124,6 @@ export type SegmentGroupProps = SegmentGroupName & {
98
124
  * want a `Select`. Panels that change with the choice are `Tabs`; a segment
99
125
  * group changes a value, not what is on the page.
100
126
  */
101
- export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, fullWidth, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
127
+ export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, fullWidth, custom, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
102
128
  export {};
103
129
  //# sourceMappingURL=segment-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GACjB;IACE,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,qDAAqD;IACrD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,GAAa,EACb,OAAmB,EACnB,SAAiB,EACjB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,2CAuEnB"}
1
+ {"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kB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0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,GAAa,EACb,OAAmB,EACnB,SAAiB,EACjB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,2CA8GnB"}
@@ -30,7 +30,7 @@ import { cx } from '../cx';
30
30
  * want a `Select`. Panels that change with the choice are `Tabs`; a segment
31
31
  * group changes a value, not what is on the page.
32
32
  */
33
- export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', fullWidth = false, disabled, name, className, 'aria-label': ariaLabel, }) {
33
+ export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', fullWidth = false, custom, disabled, name, className, 'aria-label': ariaLabel, }) {
34
34
  const rootRef = useRef(null);
35
35
  /*
36
36
  * Zag reports `null` only when the value is cleared through its API, which
@@ -59,6 +59,15 @@ export function SegmentGroup({ label, items, value, defaultValue, onValueChange,
59
59
  const visibleLabel = label &&
60
60
  (ariaLabel ? (_jsx("span", { className: "ds-segment-group__label", children: label })) : (_jsx(ArkSegmentGroup.Label, { className: "ds-segment-group__label", children: label })));
61
61
  const renderItem = (item) => (_jsxs(ArkSegmentGroup.Item, { value: item.value, disabled: item.disabled, className: "ds-segment-group__item", children: [_jsx(ArkSegmentGroup.ItemText, { className: "ds-segment-group__item-text", children: item.label }), _jsx(ArkSegmentGroup.ItemHiddenInput, {})] }, item.value));
62
- return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', fullWidth && 'ds-segment-group--full-width', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsx("div", { className: "ds-segment-group__track", children: items.map(renderItem) })] }));
62
+ /*
63
+ * The field is the choice while it holds a value no segment has. That is
64
+ * read from Ark's own value, so an uncontrolled group draws it right too,
65
+ * and it submits under `name` only then, when no radio is checked.
66
+ */
67
+ const renderCustom = (custom, current) => {
68
+ const chosen = custom.value !== '' && !items.some((item) => item.value === current);
69
+ return (_jsxs("label", { className: "ds-segment-group__custom", "data-state": chosen ? 'checked' : 'unchecked', "data-disabled": disabled ? '' : undefined, children: [_jsx("input", { className: "ds-segment-group__custom-input", value: custom.value, onChange: (event) => custom.onValueChange(event.target.value), "aria-label": custom['aria-label'], placeholder: custom.placeholder, inputMode: custom.inputMode, name: chosen ? name : undefined, disabled: disabled }), custom.unit && (_jsx("span", { className: "ds-segment-group__custom-unit", "aria-hidden": "true", children: custom.unit }))] }));
70
+ };
71
+ return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', fullWidth && 'ds-segment-group--full-width', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsxs("div", { className: "ds-segment-group__track", children: [items.map(renderItem), custom && (_jsx(ArkSegmentGroup.Context, { children: (group) => renderCustom(custom, group.value) }))] })] }));
63
72
  }
64
73
  //# sourceMappingURL=segment-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,C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AiB,EAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,WAAW,EAAC,YAAY,gBACZ,SAAS,aAEpB,YAAY,EACb,eAAK,SAAS,EAAC,yBAAyB,aACrC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EACrB,MAAM,IAAI,CACT,KAAC,eAAe,CAAC,OAAO,cACrB,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GACrB,CAC3B,IACG,IACe,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { SegmentGroup as ArkSegmentGroup } from '@ark-ui/react/segment-group';\nimport { type ReactNode, useRef } from 'react';\nimport './segment-group.css';\nimport { cx } from '../cx';\n\nexport type SegmentGroupSize = 'sm' | 'md';\n\nexport interface SegmentGroupItem {\n /** Stable value reported by `onValueChange` and compared with `value`. */\n value: string;\n /** Text shown on the segment. Keep it to a word or two; a longer one wraps inside its segment. */\n label: string;\n /** Individually disable this choice without removing it. */\n disabled?: boolean;\n}\n\n/**\n * A value typed beside the segments, for one no segment offers: the minutes\n * of a duration whose presets are 30 minutes and an hour. The consumer owns\n * both values and keeps them agreeing: a typed value that matches a segment\n * checks that segment, and choosing a segment fills the field with its value.\n */\nexport interface SegmentGroupCustom {\n /** What the field holds, `''` when empty. */\n value: string;\n /** Fired with the field's text on every change. */\n onValueChange: (value: string) => void;\n /** The field's accessible name (\"Duration in minutes\"); it has no visible label of its own. */\n 'aria-label': string;\n /** Shown while the field is empty. */\n placeholder?: string;\n /** A unit written after the value, such as `min`. Decorative: put the unit in `aria-label` too. */\n unit?: string;\n /** The keyboard a phone shows for the field. */\n inputMode?: 'numeric' | 'decimal' | 'text';\n}\n\n/**\n * A segment group has to have a name. A visible `label` is the one to reach\n * for; expressed as a union so an unnamed group is a compile error rather\n * than an axe finding, as `Checkbox` and `Switch` do.\n */\ntype SegmentGroupName =\n | {\n /** Visible label, rendered above the track and naming the group. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the choice is. Keep the visible words in it (\"Period\" →\n * \"Reporting period\"), so a voice user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when the surrounding heading or row already says what the choice is. */\n 'aria-label': string;\n };\n\nexport type SegmentGroupProps = SegmentGroupName & {\n /** The choices, in order. Exactly one is checked. */\n items: SegmentGroupItem[];\n /**\n * Controlled value. `null` is controlled with nothing checked, for a form\n * that starts without a choice; `undefined` leaves the component to own\n * its value from `defaultValue` onward, as `Select` does.\n */\n value?: string | null;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /**\n * Fired with the newly checked value. Choosing the checked segment again\n * does nothing, so a consumer that saves on change never writes twice.\n */\n onValueChange?: (value: string) => void;\n /** Segment height and type scale. `sm` suits a toolbar or a card header. */\n size?: SegmentGroupSize;\n /**\n * How the segments share the track. `equal` (default): every segment as\n * wide as the widest, and a word longer than its column breaks inside it.\n * `content`: each segment as wide as its own label, the spare width shared\n * out, so a group of labels of uneven length fits a narrow container\n * without breaking a word.\n */\n fit?: 'equal' | 'content';\n /**\n * `dense` tightens each segment's inline padding, for a group of many\n * short items (six t-shirt sizes) that has to fit a phone.\n */\n density?: 'default' | 'dense';\n /**\n * Whether the group takes the whole width of its row, the track with it:\n * a state or effort choice in a form, level with the fields above it.\n */\n fullWidth?: boolean;\n /**\n * A field at the end of the track for a value no segment offers. While it\n * holds a value and no segment is checked, it is drawn as the choice and\n * submits under `name`.\n */\n custom?: SegmentGroupCustom;\n /** Disable every segment. The checked one keeps showing which is set. */\n disabled?: boolean;\n /** Name for native form participation through the hidden radio inputs. */\n name?: string;\n /** Extra class names appended after the `ds-segment-group` modifiers. */\n className?: string;\n};\n\n/**\n * One choice among a few, shown as a row of segments, built on Ark UI's\n * SegmentGroup: a radio group whose radios are drawn as one control.\n *\n * Ark owns the behaviour: hidden radio inputs carry the state, the arrow keys\n * move the choice, and the whole segment is its radio's label. This wrapper\n * contributes `ds-` classes, the `--ds-segment-group-*` bindings and a flat\n * `items` API in place of Ark's anatomy.\n *\n * ```tsx\n * <SegmentGroup\n * label=\"Period\"\n * items={[\n * { value: 'today', label: 'Today' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]}\n * value={period}\n * onValueChange={setPeriod}\n * />\n * ```\n *\n * Reach for it when the choices are few, short and all worth seeing at once:\n * a period, a size, a view. More than five, or labels that need a sentence,\n * want a `Select`. Panels that change with the choice are `Tabs`; a segment\n * group changes a value, not what is on the page.\n */\nexport function SegmentGroup({\n label,\n items,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n fit = 'equal',\n density = 'default',\n fullWidth = false,\n custom,\n disabled,\n name,\n className,\n 'aria-label': ariaLabel,\n}: SegmentGroupProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n\n /*\n * Zag reports `null` only when the value is cleared through its API, which\n * this wrapper never calls; a user can only move the choice to a segment.\n *\n * Ark renders the hidden radios uncontrolled and syncs them only when its\n * own state changes, so a controlled parent that declines a choice would\n * leave the native radio checked while the segment shows the old one.\n * Restoring the parent's value after Ark has read the radios keeps the two\n * agreeing, as Checkbox and Switch do.\n */\n const handleValueChange = (details: { value: string | null }) => {\n if (details.value !== null) onValueChange?.(details.value);\n if (value === undefined || !rootRef.current) return;\n for (const input of rootRef.current.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n input.checked = input.value === value;\n }\n };\n\n /*\n * Zag always names the root by its label part's id, which would outrank an\n * `aria-label`. With both given, the visible label is plain text instead,\n * so that id resolves to nothing and the `aria-label` is what is announced.\n */\n const visibleLabel =\n label &&\n (ariaLabel ? (\n <span className=\"ds-segment-group__label\">{label}</span>\n ) : (\n <ArkSegmentGroup.Label className=\"ds-segment-group__label\">{label}</ArkSegmentGroup.Label>\n ));\n\n const renderItem = (item: SegmentGroupItem) => (\n <ArkSegmentGroup.Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n className=\"ds-segment-group__item\"\n >\n <ArkSegmentGroup.ItemText className=\"ds-segment-group__item-text\">\n {item.label}\n </ArkSegmentGroup.ItemText>\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n\n /*\n * The field is the choice while it holds a value no segment has. That is\n * read from Ark's own value, so an uncontrolled group draws it right too,\n * and it submits under `name` only then, when no radio is checked.\n */\n const renderCustom = (custom: SegmentGroupCustom, current: string | null) => {\n const chosen = custom.value !== '' && !items.some((item) => item.value === current);\n return (\n <label\n className=\"ds-segment-group__custom\"\n data-state={chosen ? 'checked' : 'unchecked'}\n data-disabled={disabled ? '' : undefined}\n >\n <input\n className=\"ds-segment-group__custom-input\"\n value={custom.value}\n onChange={(event) => custom.onValueChange(event.target.value)}\n aria-label={custom['aria-label']}\n placeholder={custom.placeholder}\n inputMode={custom.inputMode}\n name={chosen ? name : undefined}\n disabled={disabled}\n />\n {custom.unit && (\n <span className=\"ds-segment-group__custom-unit\" aria-hidden=\"true\">\n {custom.unit}\n </span>\n )}\n </label>\n );\n };\n\n return (\n <ArkSegmentGroup.Root\n ref={rootRef}\n className={cx(\n 'ds-segment-group',\n `ds-segment-group--${size}`,\n fit === 'content' && 'ds-segment-group--fit-content',\n density === 'dense' && 'ds-segment-group--dense',\n fullWidth && 'ds-segment-group--full-width',\n className,\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleValueChange}\n disabled={disabled}\n name={name}\n orientation=\"horizontal\"\n aria-label={ariaLabel}\n >\n {visibleLabel}\n <div className=\"ds-segment-group__track\">\n {items.map(renderItem)}\n {custom && (\n <ArkSegmentGroup.Context>\n {(group) => renderCustom(custom, group.value)}\n </ArkSegmentGroup.Context>\n )}\n </div>\n </ArkSegmentGroup.Root>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/select/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/select/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { SelectItem, SelectProps, SelectSize } from './select';\nexport { Select } from './select';\n"]}
@@ -162,9 +162,9 @@
162
162
  overflow-wrap: anywhere;
163
163
 
164
164
  & .ds-select__label {
165
- color: var(--ds-select-label-text);
166
- font-size: var(--ds-select-label-font-size);
167
- font-weight: var(--ds-select-label-font-weight);
165
+ color: var(--ds-field-label-text);
166
+ font-size: var(--ds-field-label-font-size);
167
+ font-weight: var(--ds-field-label-font-weight);
168
168
  }
169
169
 
170
170
  & .ds-select__trigger {