@handijitcom/ui 3.0.0 → 3.2.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 (118) hide show
  1. package/README.md +209 -9
  2. package/build/components/AppShell/Nav.cjs +2 -0
  3. package/build/components/AppShell/Nav.cjs.map +1 -0
  4. package/build/components/AppShell/Nav.d.cts +75 -0
  5. package/build/components/AppShell/Nav.d.ts +75 -0
  6. package/build/components/AppShell/Nav.js +189 -0
  7. package/build/components/AppShell/Nav.js.map +1 -0
  8. package/build/components/AppShell/context.cjs +2 -0
  9. package/build/components/AppShell/context.cjs.map +1 -0
  10. package/build/components/AppShell/context.d.cts +29 -0
  11. package/build/components/AppShell/context.d.ts +29 -0
  12. package/build/components/AppShell/context.js +13 -0
  13. package/build/components/AppShell/context.js.map +1 -0
  14. package/build/components/AppShell/index.cjs +2 -0
  15. package/build/components/AppShell/index.cjs.map +1 -0
  16. package/build/components/AppShell/index.d.cts +39 -0
  17. package/build/components/AppShell/index.d.ts +39 -0
  18. package/build/components/AppShell/index.js +130 -0
  19. package/build/components/AppShell/index.js.map +1 -0
  20. package/build/components/AppShell/style.css +1 -0
  21. package/build/components/Avatar/index.cjs +1 -1
  22. package/build/components/Avatar/index.cjs.map +1 -1
  23. package/build/components/Avatar/index.js +18 -18
  24. package/build/components/Avatar/index.js.map +1 -1
  25. package/build/components/BulkPasteInput/index.cjs +2 -0
  26. package/build/components/BulkPasteInput/index.cjs.map +1 -0
  27. package/build/components/BulkPasteInput/index.d.cts +26 -0
  28. package/build/components/BulkPasteInput/index.d.ts +26 -0
  29. package/build/components/BulkPasteInput/index.js +80 -0
  30. package/build/components/BulkPasteInput/index.js.map +1 -0
  31. package/build/components/BulkPasteInput/style.css +1 -0
  32. package/build/components/Checkbox/index.cjs +1 -1
  33. package/build/components/Checkbox/index.cjs.map +1 -1
  34. package/build/components/Checkbox/index.js +6 -6
  35. package/build/components/Checkbox/index.js.map +1 -1
  36. package/build/components/DataTable/context.cjs +2 -0
  37. package/build/components/DataTable/context.cjs.map +1 -0
  38. package/build/components/DataTable/context.d.cts +17 -0
  39. package/build/components/DataTable/context.d.ts +17 -0
  40. package/build/components/DataTable/context.js +7 -0
  41. package/build/components/DataTable/context.js.map +1 -0
  42. package/build/components/DataTable/index.cjs +1 -1
  43. package/build/components/DataTable/index.cjs.map +1 -1
  44. package/build/components/DataTable/index.d.cts +46 -5
  45. package/build/components/DataTable/index.d.ts +46 -5
  46. package/build/components/DataTable/index.js +236 -93
  47. package/build/components/DataTable/index.js.map +1 -1
  48. package/build/components/DataTable/style.css +1 -1
  49. package/build/components/DataTableColumnMenu/index.cjs +2 -0
  50. package/build/components/DataTableColumnMenu/index.cjs.map +1 -0
  51. package/build/components/DataTableColumnMenu/index.d.cts +13 -0
  52. package/build/components/DataTableColumnMenu/index.d.ts +13 -0
  53. package/build/components/DataTableColumnMenu/index.js +69 -0
  54. package/build/components/DataTableColumnMenu/index.js.map +1 -0
  55. package/build/components/DataTableColumnMenu/style.css +1 -0
  56. package/build/components/Drawer/index.cjs +1 -1
  57. package/build/components/Drawer/index.cjs.map +1 -1
  58. package/build/components/Drawer/index.js +33 -33
  59. package/build/components/Drawer/index.js.map +1 -1
  60. package/build/components/Gallery/index.cjs +2 -0
  61. package/build/components/Gallery/index.cjs.map +1 -0
  62. package/build/components/Gallery/index.d.cts +56 -0
  63. package/build/components/Gallery/index.d.ts +56 -0
  64. package/build/components/Gallery/index.js +253 -0
  65. package/build/components/Gallery/index.js.map +1 -0
  66. package/build/components/Gallery/style.css +1 -0
  67. package/build/components/Menu/index.cjs +1 -1
  68. package/build/components/Menu/index.cjs.map +1 -1
  69. package/build/components/Menu/index.js +48 -48
  70. package/build/components/Menu/index.js.map +1 -1
  71. package/build/components/NotificationCenter/index.cjs +2 -0
  72. package/build/components/NotificationCenter/index.cjs.map +1 -0
  73. package/build/components/NotificationCenter/index.d.cts +45 -0
  74. package/build/components/NotificationCenter/index.d.ts +45 -0
  75. package/build/components/NotificationCenter/index.js +124 -0
  76. package/build/components/NotificationCenter/index.js.map +1 -0
  77. package/build/components/NotificationCenter/style.css +1 -0
  78. package/build/components/Popover/index.cjs +1 -1
  79. package/build/components/Popover/index.cjs.map +1 -1
  80. package/build/components/Popover/index.js +16 -16
  81. package/build/components/Popover/index.js.map +1 -1
  82. package/build/components/TreeSelect/index.cjs +2 -0
  83. package/build/components/TreeSelect/index.cjs.map +1 -0
  84. package/build/components/TreeSelect/index.d.cts +40 -0
  85. package/build/components/TreeSelect/index.d.ts +40 -0
  86. package/build/components/TreeSelect/index.js +175 -0
  87. package/build/components/TreeSelect/index.js.map +1 -0
  88. package/build/components/TreeSelect/style.css +1 -0
  89. package/build/components/UserMenu/index.cjs +2 -0
  90. package/build/components/UserMenu/index.cjs.map +1 -0
  91. package/build/components/UserMenu/index.d.cts +21 -0
  92. package/build/components/UserMenu/index.d.ts +21 -0
  93. package/build/components/UserMenu/index.js +36 -0
  94. package/build/components/UserMenu/index.js.map +1 -0
  95. package/build/components/UserMenu/style.css +1 -0
  96. package/build/helpers/app-shell.helper.cjs +2 -0
  97. package/build/helpers/app-shell.helper.cjs.map +1 -0
  98. package/build/helpers/app-shell.helper.d.cts +12 -0
  99. package/build/helpers/app-shell.helper.d.ts +12 -0
  100. package/build/helpers/app-shell.helper.js +18 -0
  101. package/build/helpers/app-shell.helper.js.map +1 -0
  102. package/build/helpers/bulk-paste.helper.cjs +2 -0
  103. package/build/helpers/bulk-paste.helper.cjs.map +1 -0
  104. package/build/helpers/bulk-paste.helper.d.cts +38 -0
  105. package/build/helpers/bulk-paste.helper.d.ts +38 -0
  106. package/build/helpers/bulk-paste.helper.js +37 -0
  107. package/build/helpers/bulk-paste.helper.js.map +1 -0
  108. package/build/index.cjs +1 -1
  109. package/build/index.d.cts +9 -1
  110. package/build/index.d.ts +9 -1
  111. package/build/index.js +138 -118
  112. package/build/index.js.map +1 -1
  113. package/build/styles.css +17 -1
  114. package/build/types/theme.type.d.cts +71 -0
  115. package/build/types/theme.type.d.ts +71 -0
  116. package/build/types/types/theme.type.d.cts +71 -0
  117. package/build/types/types/theme.type.d.ts +71 -0
  118. package/package.json +71 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/TreeSelect/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type KeyboardEvent,\n memo,\n type ReactNode,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { CaretRightFill, CheckLg, Search } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { matchesSearch } from '../../helpers/text.helper';\nimport { useUi } from '../../theme/context';\nimport Input from '../Input';\n\nimport styles from './index.module.scss';\n\nexport type TreeSelectNode = {\n value: string;\n label: string;\n children?: TreeSelectNode[];\n /** Shown and reachable by the keyboard, never selected. */\n isDisabled?: boolean;\n};\n\nexport type TreeSelectLabels = {\n search: string;\n empty: string;\n};\n\ntype BaseProps = {\n nodes: TreeSelectNode[];\n /** The tree's accessible name (\"Kategoriler\"). */\n label: string;\n /** Controlled expanded node values; uncontrolled when omitted. */\n expanded?: string[];\n onExpandedChange?: (expanded: string[]) => void;\n /** A search field above the tree: matches stay with their ancestors, which open. */\n hasSearch?: boolean;\n labels?: Partial<TreeSelectLabels>;\n className?: string;\n testId?: string;\n};\n\ntype SingleProps = BaseProps & {\n isMultiple?: false;\n /** The selected value; activating it again clears it. */\n value: string | null;\n onChange: (value: string | null) => void;\n};\n\ntype MultipleProps = BaseProps & {\n isMultiple: true;\n value: string[];\n onChange: (value: string[]) => void;\n};\n\nexport type TreeSelectProps = SingleProps | MultipleProps;\n\ntype VisibleNode = {\n node: TreeSelectNode;\n parent: string | null;\n hasChildren: boolean;\n isExpanded: boolean;\n};\n\n/** The nodes that match, with their ancestors; a matching node keeps its whole subtree. */\nconst filterTree = (\n nodes: TreeSelectNode[],\n query: string,\n opened: Set<string>,\n): TreeSelectNode[] =>\n nodes.flatMap(node => {\n if (matchesSearch(node.label, query)) return [node];\n const children = filterTree(node.children ?? [], query, opened);\n if (children.length === 0) return [];\n opened.add(node.value);\n\n return [{ ...node, children }];\n });\n\n/** The rows in view, in document order: what the arrow keys walk. */\nconst flatten = (\n nodes: TreeSelectNode[],\n expanded: Set<string>,\n parent: string | null = null,\n out: VisibleNode[] = [],\n): VisibleNode[] => {\n for (const node of nodes) {\n const hasChildren = Boolean(node.children?.length);\n const isExpanded = hasChildren && expanded.has(node.value);\n out.push({ node, parent, hasChildren, isExpanded });\n if (isExpanded) flatten(node.children as TreeSelectNode[], expanded, node.value, out);\n }\n\n return out;\n};\n\n/** Category tree: expand and collapse, single or multiple choice, search (ARIA tree, 3.1). */\nconst TreeSelect = (props: TreeSelectProps) => {\n const {\n nodes,\n label,\n expanded: controlledExpanded,\n onExpandedChange,\n hasSearch,\n labels: labelProps,\n className,\n testId,\n } = props;\n const { labels: config } = useUi();\n const treeId = useId();\n const [innerExpanded, setInnerExpanded] = useState<string[]>([]);\n const [query, setQuery] = useState('');\n const [focused, setFocused] = useState<string | null>(null);\n const itemRefs = useRef(new Map<string, HTMLLIElement>());\n /* Set by the keyboard: the newly focused item takes the focus after the render that shows it. */\n const pendingFocusRef = useRef<string | null>(null);\n\n const expandedList = controlledExpanded ?? innerExpanded;\n const selected = useMemo(\n () => new Set(props.isMultiple ? props.value : props.value === null ? [] : [props.value]),\n [props.isMultiple, props.value],\n );\n\n const { tree, expanded } = useMemo(() => {\n const open = new Set(expandedList);\n const term = query.trim();\n if (!term) return { tree: nodes, expanded: open };\n\n return { tree: filterTree(nodes, term, open), expanded: open };\n }, [nodes, expandedList, query]);\n\n const visible = useMemo(() => flatten(tree, expanded), [tree, expanded]);\n\n useEffect(() => {\n const value = pendingFocusRef.current;\n if (value === null) return;\n pendingFocusRef.current = null;\n itemRefs.current.get(value)?.focus();\n });\n\n const setExpanded = (value: string, isOpen: boolean) => {\n const next = isOpen\n ? [...expandedList.filter(item => item !== value), value]\n : expandedList.filter(item => item !== value);\n if (controlledExpanded === undefined) setInnerExpanded(next);\n onExpandedChange?.(next);\n };\n\n const choose = (node: TreeSelectNode) => {\n if (node.isDisabled) return;\n if (props.isMultiple) {\n props.onChange(\n selected.has(node.value)\n ? props.value.filter(item => item !== node.value)\n : [...props.value, node.value],\n );\n } else {\n props.onChange(selected.has(node.value) ? null : node.value);\n }\n };\n\n const focusValue = (value: string) => {\n pendingFocusRef.current = value;\n setFocused(value);\n };\n\n /* One Tab stop: the focused item if it is in view, else the first selected, else the first. */\n const tabStop =\n visible.find(item => item.node.value === focused)?.node.value ??\n visible.find(item => selected.has(item.node.value))?.node.value ??\n visible[0]?.node.value;\n\n const handleKeyDown = (event: KeyboardEvent<HTMLUListElement>) => {\n const index = visible.findIndex(item => itemRefs.current.get(item.node.value) === event.target);\n if (index < 0) return;\n const item = visible[index];\n const { value } = item.node;\n\n const go = (target: VisibleNode | undefined) => target && focusValue(target.node.value);\n\n switch (event.key) {\n case 'ArrowDown':\n go(visible[index + 1]);\n break;\n case 'ArrowUp':\n go(visible[index - 1]);\n break;\n case 'Home':\n go(visible[0]);\n break;\n case 'End':\n go(visible.at(-1));\n break;\n case 'ArrowRight':\n if (item.hasChildren && !item.isExpanded) setExpanded(value, true);\n else if (item.isExpanded) go(visible[index + 1]);\n break;\n case 'ArrowLeft':\n if (item.isExpanded) setExpanded(value, false);\n else if (item.parent !== null) focusValue(item.parent);\n break;\n case 'Enter':\n case ' ':\n choose(item.node);\n break;\n default:\n return;\n }\n event.preventDefault();\n };\n\n const renderNodes = (list: TreeSelectNode[], level: number): ReactNode =>\n list.map((node, position) => {\n const hasChildren = Boolean(node.children?.length);\n const isExpanded = hasChildren && expanded.has(node.value);\n const isSelected = selected.has(node.value);\n\n return (\n <li\n key={node.value}\n ref={element => {\n if (element) itemRefs.current.set(node.value, element);\n else itemRefs.current.delete(node.value);\n }}\n role=\"treeitem\"\n aria-level={level}\n aria-setsize={list.length}\n aria-posinset={position + 1}\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={isSelected}\n aria-disabled={node.isDisabled || undefined}\n tabIndex={node.value === tabStop ? 0 : -1}\n className={styles.item}\n onFocus={event => {\n if (event.target === event.currentTarget) setFocused(node.value);\n }}\n >\n <div\n className={cx(\n styles.row,\n isSelected && styles['row--selected'],\n node.isDisabled && styles['row--disabled'],\n )}\n onClick={() => {\n focusValue(node.value);\n choose(node);\n }}\n >\n <span\n aria-hidden\n className={cx(styles.toggle, isExpanded && styles['toggle--open'])}\n onClick={event => {\n if (!hasChildren) return;\n event.stopPropagation();\n focusValue(node.value);\n setExpanded(node.value, !isExpanded);\n }}\n >\n {hasChildren && <CaretRightFill />}\n </span>\n {props.isMultiple && (\n <span aria-hidden className={styles.check}>\n {isSelected && <CheckLg />}\n </span>\n )}\n <span className={styles.label}>{node.label}</span>\n </div>\n {isExpanded && (\n <ul role=\"group\" className={styles.group}>\n {renderNodes(node.children as TreeSelectNode[], level + 1)}\n </ul>\n )}\n </li>\n );\n });\n\n const searchLabel = hasSearch\n ? resolveLabel('TreeSelect.labels.search', labelProps?.search, config?.treeSelect?.search)\n : '';\n\n return (\n <div className={cx(styles.treeSelect, className)} data-testid={testId}>\n {hasSearch && (\n <Input\n type=\"search\"\n size=\"sm\"\n value={query}\n onChange={event => setQuery(event.target.value)}\n aria-label={searchLabel}\n placeholder={searchLabel}\n aria-controls={visible.length > 0 ? treeId : undefined}\n prefix={<Search aria-hidden />}\n />\n )}\n\n {visible.length === 0 ? (\n <p role=\"status\" className={styles.empty}>\n {resolveLabel('TreeSelect.labels.empty', labelProps?.empty, config?.treeSelect?.empty)}\n </p>\n ) : (\n <ul\n id={treeId}\n role=\"tree\"\n aria-label={label}\n aria-multiselectable={props.isMultiple || undefined}\n className={styles.tree}\n onKeyDown={handleKeyDown}\n >\n {renderNodes(tree, 1)}\n </ul>\n )}\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(TreeSelect, 'TreeSelect'),\n) as typeof TreeSelect;\n"],"names":["filterTree","nodes","query","opened","node","matchesSearch","children","flatten","expanded","parent","out","hasChildren","_a","isExpanded","TreeSelect","props","label","controlledExpanded","onExpandedChange","hasSearch","labelProps","className","testId","config","useUi","treeId","useId","innerExpanded","setInnerExpanded","useState","setQuery","focused","setFocused","itemRefs","useRef","pendingFocusRef","expandedList","selected","useMemo","tree","open","term","visible","useEffect","value","setExpanded","isOpen","next","item","choose","focusValue","tabStop","_b","_c","handleKeyDown","event","index","go","target","renderNodes","list","level","position","isSelected","jsxs","element","styles","cx","jsx","CaretRightFill","CheckLg","searchLabel","resolveLabel","_d","Input","Search","_e","memo","named"],"mappings":";;;;;;;;;;;AAyEA,MAAMA,IAAa,CACjBC,GACAC,GACAC,MAEAF,EAAM,QAAQ,CAAAG,MAAQ;AACpB,MAAIC,GAAcD,EAAK,OAAOF,CAAK,EAAG,QAAO,CAACE,CAAI;AAClD,QAAME,IAAWN,EAAWI,EAAK,YAAY,CAAA,GAAIF,GAAOC,CAAM;AAC9D,SAAIG,EAAS,WAAW,IAAU,CAAA,KAClCH,EAAO,IAAIC,EAAK,KAAK,GAEd,CAAC,EAAE,GAAGA,GAAM,UAAAE,GAAU;AAC/B,CAAC,GAGGC,IAAU,CACdN,GACAO,GACAC,IAAwB,MACxBC,IAAqB,OACH;;AAClB,aAAWN,KAAQH,GAAO;AACxB,UAAMU,IAAc,IAAQC,IAAAR,EAAK,aAAL,QAAAQ,EAAe,SACrCC,IAAaF,KAAeH,EAAS,IAAIJ,EAAK,KAAK;AACzD,IAAAM,EAAI,KAAK,EAAE,MAAAN,GAAM,QAAAK,GAAQ,aAAAE,GAAa,YAAAE,GAAY,GAC9CA,KAAYN,EAAQH,EAAK,UAA8BI,GAAUJ,EAAK,OAAOM,CAAG;AAAA,EACtF;AAEA,SAAOA;AACT,GAGMI,KAAa,CAACC,MAA2B;;AAC7C,QAAM;AAAA,IACJ,OAAAd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:flex;flex-direction:column;gap:var(--hd-space-2);min-width:0}.ui-tree-ZUR4t,.ui-group-B07SG{margin:0;padding:0;list-style:none}.ui-group-B07SG{padding-inline-start:var(--hd-space-5)}.ui-item-bT8hE{outline:none}.ui-item-bT8hE:focus-visible>.ui-row-f8tvN{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-row-f8tvN{display:flex;align-items:center;gap:var(--hd-space-1);background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-row-f8tvN:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-row-f8tvN:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-row-f8tvN{transition:none}.ui-row-f8tvN:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-row-f8tvN{min-height:32px;padding:var(--hd-space-1) var(--hd-space-2) var(--hd-space-1) var(--hd-space-1);border-radius:var(--hd-radius-sm);color:var(--hd-text);font-size:var(--hd-type-small-size);cursor:pointer;-webkit-user-select:none;user-select:none}.ui-row--selected-Ohokw{background-color:var(--hd-primary-soft);transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-row--selected-Ohokw:hover:not(:disabled):not([aria-disabled=true]){background-color:var(--hd-primary-soft-hover)}.ui-row--selected-Ohokw:active:not(:disabled):not([aria-disabled=true]){background-color:var(--hd-primary-soft-hover);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-row--selected-Ohokw{transition:none}.ui-row--selected-Ohokw:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-row--selected-Ohokw{color:var(--hd-primary-text);box-shadow:inset 3px 0 0 var(--hd-primary)}.ui-row--disabled-gh2-B{cursor:not-allowed;color:var(--hd-text-3)}@media (forced-colors: active){.ui-row--disabled-gh2-B{color:GrayText}}.ui-toggle-3vJjC{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--hd-space-5);height:var(--hd-space-5);color:var(--hd-text-2);font-size:14px;transition:rotate var(--hd-duration-fast) var(--hd-ease-standard)}[dir=rtl] .ui-toggle-3vJjC{transform:scaleX(-1)}.ui-toggle--open-w3VoA{rotate:90deg}@media (prefers-reduced-motion: reduce){.ui-toggle-3vJjC{transition:none}}.ui-check-2TtiJ{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;border:1.5px solid var(--hd-text-2);border-radius:var(--hd-radius-xs);font-size:14px}.ui-row--selected-Ohokw .ui-check-2TtiJ{border-color:var(--hd-primary);background-color:var(--hd-primary);color:var(--hd-on-primary)}@media (forced-colors: active){.ui-check-2TtiJ{border-color:CanvasText}}.ui-label-gwMBM{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ui-empty-nLfAL{margin:0;padding:var(--hd-space-3);font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2)}}
@@ -0,0 +1,2 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),d=require("react"),g=require("react-bootstrap-icons"),x=require("../../helpers/class-name.helper.cjs"),_=require("../../helpers/component.helper.cjs"),m=require("../../helpers/label.helper.cjs"),h=require("../../theme/context.cjs"),p=require("../Avatar/index.cjs"),f=require("../Menu/index.cjs"),t={default:{"trigger":"ui-trigger-hasSo","trigger__avatar":"ui-trigger__avatar-Ytn7n","trigger__text":"ui-trigger__text-I6j-f","trigger__name":"ui-trigger__name-eLefM","trigger__meta":"ui-trigger__meta-rrxCA","trigger__chevron":"ui-trigger__chevron-KDiWR"}},j=({name:s,meta:n,imageUrl:l,items:i,label:u,className:c,testId:o})=>{var a;const{labels:r}=h.useUi();return e.jsx(f.default,{label:m.resolveLabel("UserMenu.label",u,(a=r==null?void 0:r.appShell)==null?void 0:a.userMenu),items:i,align:"end",testId:o,trigger:e.jsxs("button",{type:"button",className:x.cx(t.default.trigger,c),children:[e.jsx("span",{"aria-hidden":!0,className:t.default.trigger__avatar,children:e.jsx(p.default,{name:s,imageUrl:l,locale:r==null?void 0:r.locale,size:"sm"})}),e.jsxs("span",{className:t.default.trigger__text,children:[e.jsx("span",{className:t.default.trigger__name,children:s}),n&&e.jsx("span",{className:t.default.trigger__meta,children:n})]}),e.jsx(g.ChevronDown,{"aria-hidden":!0,className:t.default.trigger__chevron})]})})},q=d.memo(_.named(j,"UserMenu"));exports.default=q;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/UserMenu/index.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { ChevronDown } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport Avatar from '../Avatar';\nimport Menu, { type MenuItem } from '../Menu';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n /** The signed-in person's name: the avatar's initials and the trigger's text. */\n name: string;\n /** A second line: the role, the branch, the e-mail address. */\n meta?: string;\n imageUrl?: string;\n /** Profile, settings, sign out… (`isDanger` for sign out is the caller's call). */\n items: MenuItem[];\n /** The menu's name; `labels.appShell.userMenu` by default. */\n label?: string;\n className?: string;\n testId?: string;\n};\n\n/**\n * The account button of a top bar (3.2): avatar, name and role opening a `Menu`. Below the mobile\n * width only the avatar shows; the name is still read.\n */\nconst UserMenu = ({ name, meta, imageUrl, items, label, className, testId }: Props) => {\n const { labels } = useUi();\n\n return (\n <Menu\n label={resolveLabel('UserMenu.label', label, labels?.appShell?.userMenu)}\n items={items}\n align=\"end\"\n testId={testId}\n trigger={\n <button type=\"button\" className={cx(styles.trigger, className)}>\n {/* The avatar repeats the name: the button reads it once, from the text. */}\n <span aria-hidden className={styles.trigger__avatar}>\n <Avatar name={name} imageUrl={imageUrl} locale={labels?.locale} size=\"sm\" />\n </span>\n <span className={styles.trigger__text}>\n <span className={styles.trigger__name}>{name}</span>\n {meta && <span className={styles.trigger__meta}>{meta}</span>}\n </span>\n <ChevronDown aria-hidden className={styles.trigger__chevron} />\n </button>\n }\n />\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(UserMenu, 'UserMenu')) as typeof UserMenu;\n"],"names":["UserMenu","name","meta","imageUrl","items","label","className","testId","labels","useUi","jsx","Menu","resolveLabel","_a","jsxs","cx","styles","Avatar","ChevronDown","index","memo","named"],"mappings":"2eAgCMA,EAAW,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,UAAAC,EAAW,OAAAC,KAAoB,OACrF,KAAM,CAAE,OAAAC,CAAA,EAAWC,QAAA,EAEnB,OACEC,EAAAA,IAACC,EAAAA,QAAA,CACC,MAAOC,EAAAA,aAAa,iBAAkBP,GAAOQ,EAAAL,GAAA,YAAAA,EAAQ,WAAR,YAAAK,EAAkB,QAAQ,EACvE,MAAAT,EACA,MAAM,MACN,OAAAG,EACA,QACEO,EAAAA,KAAC,SAAA,CAAO,KAAK,SAAS,UAAWC,EAAAA,GAAGC,EAAAA,QAAO,QAASV,CAAS,EAE3D,SAAA,CAAAI,MAAC,OAAA,CAAK,cAAW,GAAC,UAAWM,EAAAA,QAAO,gBAClC,SAAAN,EAAAA,IAACO,EAAAA,QAAA,CAAO,KAAAhB,EAAY,SAAAE,EAAoB,OAAQK,GAAA,YAAAA,EAAQ,OAAQ,KAAK,KAAK,EAC5E,EACAM,EAAAA,KAAC,OAAA,CAAK,UAAWE,EAAAA,QAAO,cACtB,SAAA,CAAAN,EAAAA,IAAC,OAAA,CAAK,UAAWM,EAAAA,QAAO,cAAgB,SAAAf,EAAK,EAC5CC,GAAQQ,EAAAA,IAAC,OAAA,CAAK,UAAWM,EAAAA,QAAO,cAAgB,SAAAd,CAAA,CAAK,CAAA,EACxD,QACCgB,EAAAA,YAAA,CAAY,cAAW,GAAC,UAAWF,EAAAA,QAAO,gBAAA,CAAkB,CAAA,CAAA,CAC/D,CAAA,CAAA,CAIR,EAEAG,EAA6BC,OAAmBC,EAAAA,MAAMrB,EAAU,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { MenuItem } from '../Menu/index.cjs';
2
+ type Props = {
3
+ /** The signed-in person's name: the avatar's initials and the trigger's text. */
4
+ name: string;
5
+ /** A second line: the role, the branch, the e-mail address. */
6
+ meta?: string;
7
+ imageUrl?: string;
8
+ /** Profile, settings, sign out… (`isDanger` for sign out is the caller's call). */
9
+ items: MenuItem[];
10
+ /** The menu's name; `labels.appShell.userMenu` by default. */
11
+ label?: string;
12
+ className?: string;
13
+ testId?: string;
14
+ };
15
+ /**
16
+ * The account button of a top bar (3.2): avatar, name and role opening a `Menu`. Below the mobile
17
+ * width only the avatar shows; the name is still read.
18
+ */
19
+ declare const UserMenu: ({ name, meta, imageUrl, items, label, className, testId }: Props) => import("react").JSX.Element;
20
+ declare const _default: typeof UserMenu;
21
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { MenuItem } from '../Menu/index.js';
2
+ type Props = {
3
+ /** The signed-in person's name: the avatar's initials and the trigger's text. */
4
+ name: string;
5
+ /** A second line: the role, the branch, the e-mail address. */
6
+ meta?: string;
7
+ imageUrl?: string;
8
+ /** Profile, settings, sign out… (`isDanger` for sign out is the caller's call). */
9
+ items: MenuItem[];
10
+ /** The menu's name; `labels.appShell.userMenu` by default. */
11
+ label?: string;
12
+ className?: string;
13
+ testId?: string;
14
+ };
15
+ /**
16
+ * The account button of a top bar (3.2): avatar, name and role opening a `Menu`. Below the mobile
17
+ * width only the avatar shows; the name is still read.
18
+ */
19
+ declare const UserMenu: ({ name, meta, imageUrl, items, label, className, testId }: Props) => import("react").JSX.Element;
20
+ declare const _default: typeof UserMenu;
21
+ export default _default;
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
3
+ import { memo as g } from "react";
4
+ import { ChevronDown as u } from "react-bootstrap-icons";
5
+ import { cx as d } from "../../helpers/class-name.helper.js";
6
+ import { named as f } from "../../helpers/component.helper.js";
7
+ import { resolveLabel as h } from "../../helpers/label.helper.js";
8
+ import { useUi as _ } from "../../theme/context.js";
9
+ import x from "../Avatar/index.js";
10
+ import N from "../Menu/index.js";
11
+ const t = {"trigger":"ui-trigger-hasSo","trigger__avatar":"ui-trigger__avatar-Ytn7n","trigger__text":"ui-trigger__text-I6j-f","trigger__name":"ui-trigger__name-eLefM","trigger__meta":"ui-trigger__meta-rrxCA","trigger__chevron":"ui-trigger__chevron-KDiWR"};
12
+ const v = ({ name: o, meta: a, imageUrl: m, items: n, label: l, className: c, testId: p }) => {
13
+ var i;
14
+ const { labels: r } = _();
15
+ return /* @__PURE__ */ e(
16
+ N,
17
+ {
18
+ label: h("UserMenu.label", l, (i = r == null ? void 0 : r.appShell) == null ? void 0 : i.userMenu),
19
+ items: n,
20
+ align: "end",
21
+ testId: p,
22
+ trigger: /* @__PURE__ */ s("button", { type: "button", className: d(t.trigger, c), children: [
23
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: t.trigger__avatar, children: /* @__PURE__ */ e(x, { name: o, imageUrl: m, locale: r == null ? void 0 : r.locale, size: "sm" }) }),
24
+ /* @__PURE__ */ s("span", { className: t.trigger__text, children: [
25
+ /* @__PURE__ */ e("span", { className: t.trigger__name, children: o }),
26
+ a && /* @__PURE__ */ e("span", { className: t.trigger__meta, children: a })
27
+ ] }),
28
+ /* @__PURE__ */ e(u, { "aria-hidden": !0, className: t.trigger__chevron })
29
+ ] })
30
+ }
31
+ );
32
+ }, L = /* @__PURE__ */ g(/* @__PURE__ */ f(v, "UserMenu"));
33
+ export {
34
+ L as default
35
+ };
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/UserMenu/index.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { ChevronDown } from 'react-bootstrap-icons';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport Avatar from '../Avatar';\nimport Menu, { type MenuItem } from '../Menu';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n /** The signed-in person's name: the avatar's initials and the trigger's text. */\n name: string;\n /** A second line: the role, the branch, the e-mail address. */\n meta?: string;\n imageUrl?: string;\n /** Profile, settings, sign out… (`isDanger` for sign out is the caller's call). */\n items: MenuItem[];\n /** The menu's name; `labels.appShell.userMenu` by default. */\n label?: string;\n className?: string;\n testId?: string;\n};\n\n/**\n * The account button of a top bar (3.2): avatar, name and role opening a `Menu`. Below the mobile\n * width only the avatar shows; the name is still read.\n */\nconst UserMenu = ({ name, meta, imageUrl, items, label, className, testId }: Props) => {\n const { labels } = useUi();\n\n return (\n <Menu\n label={resolveLabel('UserMenu.label', label, labels?.appShell?.userMenu)}\n items={items}\n align=\"end\"\n testId={testId}\n trigger={\n <button type=\"button\" className={cx(styles.trigger, className)}>\n {/* The avatar repeats the name: the button reads it once, from the text. */}\n <span aria-hidden className={styles.trigger__avatar}>\n <Avatar name={name} imageUrl={imageUrl} locale={labels?.locale} size=\"sm\" />\n </span>\n <span className={styles.trigger__text}>\n <span className={styles.trigger__name}>{name}</span>\n {meta && <span className={styles.trigger__meta}>{meta}</span>}\n </span>\n <ChevronDown aria-hidden className={styles.trigger__chevron} />\n </button>\n }\n />\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(UserMenu, 'UserMenu')) as typeof UserMenu;\n"],"names":["UserMenu","name","meta","imageUrl","items","label","className","testId","labels","useUi","jsx","Menu","resolveLabel","_a","jsxs","cx","styles","Avatar","ChevronDown","index","memo","named"],"mappings":";;;;;;;;;;;AAgCA,MAAMA,IAAW,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,UAAAC,GAAU,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,QAAAC,QAAoB;;AACrF,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA;AAEnB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOC,EAAa,kBAAkBP,IAAOQ,IAAAL,KAAA,gBAAAA,EAAQ,aAAR,gBAAAK,EAAkB,QAAQ;AAAA,MACvE,OAAAT;AAAA,MACA,OAAM;AAAA,MACN,QAAAG;AAAA,MACA,SACE,gBAAAO,EAAC,UAAA,EAAO,MAAK,UAAS,WAAWC,EAAGC,EAAO,SAASV,CAAS,GAE3D,UAAA;AAAA,QAAA,gBAAAI,EAAC,QAAA,EAAK,eAAW,IAAC,WAAWM,EAAO,iBAClC,UAAA,gBAAAN,EAACO,GAAA,EAAO,MAAAhB,GAAY,UAAAE,GAAoB,QAAQK,KAAA,gBAAAA,EAAQ,QAAQ,MAAK,MAAK,GAC5E;AAAA,QACA,gBAAAM,EAAC,QAAA,EAAK,WAAWE,EAAO,eACtB,UAAA;AAAA,UAAA,gBAAAN,EAAC,QAAA,EAAK,WAAWM,EAAO,eAAgB,UAAAf,GAAK;AAAA,UAC5CC,KAAQ,gBAAAQ,EAAC,QAAA,EAAK,WAAWM,EAAO,eAAgB,UAAAd,EAAA,CAAK;AAAA,QAAA,GACxD;AAAA,0BACCgB,GAAA,EAAY,eAAW,IAAC,WAAWF,EAAO,iBAAA,CAAkB;AAAA,MAAA,EAAA,CAC/D;AAAA,IAAA;AAAA,EAAA;AAIR,GAEAG,IAA6B,gBAAAC,EAAmB,gBAAAC,EAAMrB,GAAU,UAAU,CAAC;"}
@@ -0,0 +1 @@
1
+ @layer ui{.ui-trigger-hasSo{display:flex;align-items:center;gap:var(--hd-space-2);background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-trigger-hasSo:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-trigger-hasSo:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-trigger-hasSo{transition:none}.ui-trigger-hasSo:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-trigger-hasSo:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-trigger-hasSo{min-width:0;max-width:240px;min-height:40px;padding:var(--hd-space-1) var(--hd-space-2) var(--hd-space-1) var(--hd-space-1);border:0;border-radius:var(--hd-radius-sm);color:var(--hd-text);font-family:var(--hd-font-body);text-align:start;cursor:pointer}.ui-trigger__avatar-Ytn7n{display:inline-flex;flex-shrink:0}.ui-trigger__text-I6j-f{display:flex;flex-direction:column;min-width:0}@media (max-width: 640px){.ui-trigger__text-I6j-f{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}}.ui-trigger__name-eLefM{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height)}.ui-trigger__meta-rrxCA{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--hd-text-3);font-size:var(--hd-type-caption-size);line-height:var(--hd-type-h4-line-height)}.ui-trigger__chevron-KDiWR{flex-shrink:0;color:var(--hd-text-3);font-size:14px}}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=i=>{const t=i.split(/[?#]/)[0];return t.length>1&&t.endsWith("/")?t.slice(0,-1):t},r=(i,t)=>{const e=o(i),n=o(t);return n===e||e!=="/"&&n.startsWith(`${e}/`)},s=(i,t)=>{if(t===void 0)return;let e;for(const n of i)r(n,t)&&(e===void 0||o(n).length>o(e).length)&&(e=n);return e};exports.findActiveHref=s;exports.matchesPath=r;
2
+ //# sourceMappingURL=app-shell.helper.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.helper.cjs","sources":["../../src/helpers/app-shell.helper.ts"],"sourcesContent":["/** Which navigation link is the current page — `AppShellNav` (3.2). */\n\n/** The path of an address without its query, fragment and trailing slash (`/a/?b#c` → `/a`). */\nconst pathOf = (href: string): string => {\n const path = href.split(/[?#]/)[0];\n\n return path.length > 1 && path.endsWith('/') ? path.slice(0, -1) : path;\n};\n\n/**\n * True when `href` is the current page or one of its ancestors, by whole segments: `/orders`\n * matches `/orders` and `/orders/42`, never `/orders-archive`. The root (`/`) matches only\n * itself: it is the ancestor of every page, not the page of every address.\n */\nexport const matchesPath = (href: string, currentPath: string): boolean => {\n const base = pathOf(href);\n const current = pathOf(currentPath);\n\n return current === base || (base !== '/' && current.startsWith(`${base}/`));\n};\n\n/**\n * The link of the current page among `hrefs`: the LONGEST one that matches. A panel's home\n * (`/panel`) is an ancestor of every page, so \"any match\" would mark it next to `/panel/orders`.\n */\nexport const findActiveHref = (\n hrefs: readonly string[],\n currentPath: string | undefined,\n): string | undefined => {\n if (currentPath === undefined) return undefined;\n\n let active: string | undefined;\n for (const href of hrefs) {\n if (!matchesPath(href, currentPath)) continue;\n if (active === undefined || pathOf(href).length > pathOf(active).length) active = href;\n }\n\n return active;\n};\n"],"names":["pathOf","href","path","matchesPath","currentPath","base","current","findActiveHref","hrefs","active"],"mappings":"gFAGA,MAAMA,EAAUC,GAAyB,CACvC,MAAMC,EAAOD,EAAK,MAAM,MAAM,EAAE,CAAC,EAEjC,OAAOC,EAAK,OAAS,GAAKA,EAAK,SAAS,GAAG,EAAIA,EAAK,MAAM,EAAG,EAAE,EAAIA,CACrE,EAOaC,EAAc,CAACF,EAAcG,IAAiC,CACzE,MAAMC,EAAOL,EAAOC,CAAI,EAClBK,EAAUN,EAAOI,CAAW,EAElC,OAAOE,IAAYD,GAASA,IAAS,KAAOC,EAAQ,WAAW,GAAGD,CAAI,GAAG,CAC3E,EAMaE,EAAiB,CAC5BC,EACAJ,IACuB,CACvB,GAAIA,IAAgB,OAAW,OAE/B,IAAIK,EACJ,UAAWR,KAAQO,EACZL,EAAYF,EAAMG,CAAW,IAC9BK,IAAW,QAAaT,EAAOC,CAAI,EAAE,OAASD,EAAOS,CAAM,EAAE,UAAQA,EAASR,GAGpF,OAAOQ,CACT"}
@@ -0,0 +1,12 @@
1
+ /** Which navigation link is the current page — `AppShellNav` (3.2). */
2
+ /**
3
+ * True when `href` is the current page or one of its ancestors, by whole segments: `/orders`
4
+ * matches `/orders` and `/orders/42`, never `/orders-archive`. The root (`/`) matches only
5
+ * itself: it is the ancestor of every page, not the page of every address.
6
+ */
7
+ export declare const matchesPath: (href: string, currentPath: string) => boolean;
8
+ /**
9
+ * The link of the current page among `hrefs`: the LONGEST one that matches. A panel's home
10
+ * (`/panel`) is an ancestor of every page, so "any match" would mark it next to `/panel/orders`.
11
+ */
12
+ export declare const findActiveHref: (hrefs: readonly string[], currentPath: string | undefined) => string | undefined;
@@ -0,0 +1,12 @@
1
+ /** Which navigation link is the current page — `AppShellNav` (3.2). */
2
+ /**
3
+ * True when `href` is the current page or one of its ancestors, by whole segments: `/orders`
4
+ * matches `/orders` and `/orders/42`, never `/orders-archive`. The root (`/`) matches only
5
+ * itself: it is the ancestor of every page, not the page of every address.
6
+ */
7
+ export declare const matchesPath: (href: string, currentPath: string) => boolean;
8
+ /**
9
+ * The link of the current page among `hrefs`: the LONGEST one that matches. A panel's home
10
+ * (`/panel`) is an ancestor of every page, so "any match" would mark it next to `/panel/orders`.
11
+ */
12
+ export declare const findActiveHref: (hrefs: readonly string[], currentPath: string | undefined) => string | undefined;
@@ -0,0 +1,18 @@
1
+ const o = (i) => {
2
+ const t = i.split(/[?#]/)[0];
3
+ return t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
4
+ }, s = (i, t) => {
5
+ const e = o(i), n = o(t);
6
+ return n === e || e !== "/" && n.startsWith(`${e}/`);
7
+ }, r = (i, t) => {
8
+ if (t === void 0) return;
9
+ let e;
10
+ for (const n of i)
11
+ s(n, t) && (e === void 0 || o(n).length > o(e).length) && (e = n);
12
+ return e;
13
+ };
14
+ export {
15
+ r as findActiveHref,
16
+ s as matchesPath
17
+ };
18
+ //# sourceMappingURL=app-shell.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.helper.js","sources":["../../src/helpers/app-shell.helper.ts"],"sourcesContent":["/** Which navigation link is the current page — `AppShellNav` (3.2). */\n\n/** The path of an address without its query, fragment and trailing slash (`/a/?b#c` → `/a`). */\nconst pathOf = (href: string): string => {\n const path = href.split(/[?#]/)[0];\n\n return path.length > 1 && path.endsWith('/') ? path.slice(0, -1) : path;\n};\n\n/**\n * True when `href` is the current page or one of its ancestors, by whole segments: `/orders`\n * matches `/orders` and `/orders/42`, never `/orders-archive`. The root (`/`) matches only\n * itself: it is the ancestor of every page, not the page of every address.\n */\nexport const matchesPath = (href: string, currentPath: string): boolean => {\n const base = pathOf(href);\n const current = pathOf(currentPath);\n\n return current === base || (base !== '/' && current.startsWith(`${base}/`));\n};\n\n/**\n * The link of the current page among `hrefs`: the LONGEST one that matches. A panel's home\n * (`/panel`) is an ancestor of every page, so \"any match\" would mark it next to `/panel/orders`.\n */\nexport const findActiveHref = (\n hrefs: readonly string[],\n currentPath: string | undefined,\n): string | undefined => {\n if (currentPath === undefined) return undefined;\n\n let active: string | undefined;\n for (const href of hrefs) {\n if (!matchesPath(href, currentPath)) continue;\n if (active === undefined || pathOf(href).length > pathOf(active).length) active = href;\n }\n\n return active;\n};\n"],"names":["pathOf","href","path","matchesPath","currentPath","base","current","findActiveHref","hrefs","active"],"mappings":"AAGA,MAAMA,IAAS,CAACC,MAAyB;AACvC,QAAMC,IAAOD,EAAK,MAAM,MAAM,EAAE,CAAC;AAEjC,SAAOC,EAAK,SAAS,KAAKA,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA;AACrE,GAOaC,IAAc,CAACF,GAAcG,MAAiC;AACzE,QAAMC,IAAOL,EAAOC,CAAI,GAClBK,IAAUN,EAAOI,CAAW;AAElC,SAAOE,MAAYD,KAASA,MAAS,OAAOC,EAAQ,WAAW,GAAGD,CAAI,GAAG;AAC3E,GAMaE,IAAiB,CAC5BC,GACAJ,MACuB;AACvB,MAAIA,MAAgB,OAAW;AAE/B,MAAIK;AACJ,aAAWR,KAAQO;AACjB,IAAKL,EAAYF,GAAMG,CAAW,MAC9BK,MAAW,UAAaT,EAAOC,CAAI,EAAE,SAASD,EAAOS,CAAM,EAAE,YAAQA,IAASR;AAGpF,SAAOQ;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=/^([1-9]\d{0,2}(?:\.\d{3})+|\d+)(?:,0+)?$/,m=t=>{const e=h.exec(t);if(!e)return null;const n=Number(e[1].replace(/\./g,""));return n>0&&Number.isSafeInteger(n)?n:null},y=t=>{for(const s of[" ",";",","])if(t.includes(s))return t.split(s).map(r=>r.trim());const e=t.trim().split(/\s+/),n=e.at(-1);return e.length>1&&m(n)!==null?[e.slice(0,-1).join(" "),n]:[t.trim()]},b=(t,{defaultQuantity:e=1,isMergingDuplicates:n=!1}={})=>{const s=[],r=[],a=new Map;return t.split(/\r\n|\r|\n/).forEach((c,l)=>{const i=c.trim();if(!i)return;const[o,...g]=y(c),d=g.filter(Boolean),u=d.length===0?e:d.map(m).find(Boolean)??null;if(!o){r.push({line:l+1,text:i,reason:"missingCode"});return}if(u===null){r.push({line:l+1,text:i,reason:"invalidQuantity"});return}const f=n?a.get(o):void 0;if(f){f.quantity+=u;return}const p={code:o,quantity:u,line:l+1};s.push(p),a.set(o,p)}),{rows:s,invalid:r}};exports.parseBulkPaste=b;
2
+ //# sourceMappingURL=bulk-paste.helper.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-paste.helper.cjs","sources":["../../src/helpers/bulk-paste.helper.ts"],"sourcesContent":["/**\n * Bulk paste parser (3.1): a pasted list of part codes and quantities → rows.\n *\n * ⚠ No `'use client'`: the parser is a plain function, callable in a server action or a worker.\n * `BulkPasteInput` (a client module) uses it; the root entry exports it from HERE so that a server\n * component calling it does not reach a client reference.\n */\n\nexport type BulkPasteRow = {\n code: string;\n quantity: number;\n /** 1-based line of the pasted text (the first line when duplicates were merged). */\n line: number;\n};\n\nexport type BulkPasteInvalidReason = 'missingCode' | 'invalidQuantity';\n\nexport type BulkPasteInvalidLine = {\n /** 1-based line of the pasted text. */\n line: number;\n /** The line as pasted, trimmed. */\n text: string;\n reason: BulkPasteInvalidReason;\n};\n\nexport type BulkPasteResult = {\n rows: BulkPasteRow[];\n invalid: BulkPasteInvalidLine[];\n};\n\nexport type BulkPasteOptions = {\n /** Quantity of a line that names only a code. Default 1. */\n defaultQuantity?: number;\n /** Adds up the quantities of a code that appears on several lines. Default `false`. */\n isMergingDuplicates?: boolean;\n};\n\n/*\n * The number grammar of the data contract (the one `QuantityInput` reads): the comma is the decimal\n * point and dots only group by three, so \"1.250\" is a thousand two hundred and fifty. A quantity of\n * a part is whole: a zero fraction (\"2,00\", a spreadsheet's number format) is allowed, \"1,5\" is not.\n */\nconst QUANTITY = /^([1-9]\\d{0,2}(?:\\.\\d{3})+|\\d+)(?:,0+)?$/;\n\n/** A positive whole quantity, or `null`. */\nconst parseQuantity = (cell: string): number | null => {\n const match = QUANTITY.exec(cell);\n if (!match) return null;\n\n const value = Number(match[1].replace(/\\./g, ''));\n\n return value > 0 && Number.isSafeInteger(value) ? value : null;\n};\n\n/**\n * The cells of one line. A spreadsheet copy is tab separated; otherwise `;`, then `,`, then runs of\n * spaces (\"ABC-123 4\"), where the last word is the quantity only if it is a number.\n */\nconst splitLine = (line: string): string[] => {\n for (const separator of ['\\t', ';', ',']) {\n if (line.includes(separator)) return line.split(separator).map(cell => cell.trim());\n }\n\n const words = line.trim().split(/\\s+/);\n const last = words.at(-1) as string;\n\n return words.length > 1 && parseQuantity(last) !== null\n ? [words.slice(0, -1).join(' '), last]\n : [line.trim()];\n};\n\n/**\n * Parses pasted text into `{ code, quantity }` rows. Blank lines are skipped; a line with a code and\n * no quantity takes `defaultQuantity`; extra cells (a description column) are skipped and the first\n * number after the code is the quantity. Codes are kept as written (trimmed).\n * @example parseBulkPaste('0986494524\\t2\\nGDB1550 4') // 2 rows\n */\nexport const parseBulkPaste = (\n text: string,\n { defaultQuantity = 1, isMergingDuplicates = false }: BulkPasteOptions = {},\n): BulkPasteResult => {\n const rows: BulkPasteRow[] = [];\n const invalid: BulkPasteInvalidLine[] = [];\n const byCode = new Map<string, BulkPasteRow>();\n\n text.split(/\\r\\n|\\r|\\n/).forEach((raw, position) => {\n const line = raw.trim();\n if (!line) return;\n\n /* Split BEFORE trimming: a leading tab is an empty code cell, not nothing. */\n const [code, ...cells] = splitLine(raw);\n const rest = cells.filter(Boolean);\n const quantity =\n rest.length === 0 ? defaultQuantity : (rest.map(parseQuantity).find(Boolean) ?? null);\n\n if (!code) {\n invalid.push({ line: position + 1, text: line, reason: 'missingCode' });\n return;\n }\n if (quantity === null) {\n invalid.push({ line: position + 1, text: line, reason: 'invalidQuantity' });\n return;\n }\n\n const existing = isMergingDuplicates ? byCode.get(code) : undefined;\n if (existing) {\n existing.quantity += quantity;\n return;\n }\n\n const row = { code, quantity, line: position + 1 };\n rows.push(row);\n byCode.set(code, row);\n });\n\n return { rows, invalid };\n};\n"],"names":["QUANTITY","parseQuantity","cell","match","value","splitLine","line","separator","words","last","parseBulkPaste","text","defaultQuantity","isMergingDuplicates","rows","invalid","byCode","raw","position","code","cells","rest","quantity","existing","row"],"mappings":"gFA0CA,MAAMA,EAAW,2CAGXC,EAAiBC,GAAgC,CACrD,MAAMC,EAAQH,EAAS,KAAKE,CA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,EAC1E,MACF,CAEA,MAAMiB,EAAWV,EAAsBG,EAAO,IAAIG,CAAI,EAAI,OAC1D,GAAII,EAAU,CACZA,EAAS,UAAYD,EACrB,MACF,CAEA,MAAME,EAAM,CAAE,KAAAL,EAAM,SAAAG,EAAU,KAAMJ,EAAW,CAAA,EAC/CJ,EAAK,KAAKU,CAAG,EACbR,EAAO,IAAIG,EAAMK,CAAG,CACtB,CAAC,EAEM,CAAE,KAAAV,EAAM,QAAAC,CAAA,CACjB"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Bulk paste parser (3.1): a pasted list of part codes and quantities → rows.
3
+ *
4
+ * ⚠ No `'use client'`: the parser is a plain function, callable in a server action or a worker.
5
+ * `BulkPasteInput` (a client module) uses it; the root entry exports it from HERE so that a server
6
+ * component calling it does not reach a client reference.
7
+ */
8
+ export type BulkPasteRow = {
9
+ code: string;
10
+ quantity: number;
11
+ /** 1-based line of the pasted text (the first line when duplicates were merged). */
12
+ line: number;
13
+ };
14
+ export type BulkPasteInvalidReason = 'missingCode' | 'invalidQuantity';
15
+ export type BulkPasteInvalidLine = {
16
+ /** 1-based line of the pasted text. */
17
+ line: number;
18
+ /** The line as pasted, trimmed. */
19
+ text: string;
20
+ reason: BulkPasteInvalidReason;
21
+ };
22
+ export type BulkPasteResult = {
23
+ rows: BulkPasteRow[];
24
+ invalid: BulkPasteInvalidLine[];
25
+ };
26
+ export type BulkPasteOptions = {
27
+ /** Quantity of a line that names only a code. Default 1. */
28
+ defaultQuantity?: number;
29
+ /** Adds up the quantities of a code that appears on several lines. Default `false`. */
30
+ isMergingDuplicates?: boolean;
31
+ };
32
+ /**
33
+ * Parses pasted text into `{ code, quantity }` rows. Blank lines are skipped; a line with a code and
34
+ * no quantity takes `defaultQuantity`; extra cells (a description column) are skipped and the first
35
+ * number after the code is the quantity. Codes are kept as written (trimmed).
36
+ * @example parseBulkPaste('0986494524\t2\nGDB1550 4') // 2 rows
37
+ */
38
+ export declare const parseBulkPaste: (text: string, { defaultQuantity, isMergingDuplicates }?: BulkPasteOptions) => BulkPasteResult;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Bulk paste parser (3.1): a pasted list of part codes and quantities → rows.
3
+ *
4
+ * ⚠ No `'use client'`: the parser is a plain function, callable in a server action or a worker.
5
+ * `BulkPasteInput` (a client module) uses it; the root entry exports it from HERE so that a server
6
+ * component calling it does not reach a client reference.
7
+ */
8
+ export type BulkPasteRow = {
9
+ code: string;
10
+ quantity: number;
11
+ /** 1-based line of the pasted text (the first line when duplicates were merged). */
12
+ line: number;
13
+ };
14
+ export type BulkPasteInvalidReason = 'missingCode' | 'invalidQuantity';
15
+ export type BulkPasteInvalidLine = {
16
+ /** 1-based line of the pasted text. */
17
+ line: number;
18
+ /** The line as pasted, trimmed. */
19
+ text: string;
20
+ reason: BulkPasteInvalidReason;
21
+ };
22
+ export type BulkPasteResult = {
23
+ rows: BulkPasteRow[];
24
+ invalid: BulkPasteInvalidLine[];
25
+ };
26
+ export type BulkPasteOptions = {
27
+ /** Quantity of a line that names only a code. Default 1. */
28
+ defaultQuantity?: number;
29
+ /** Adds up the quantities of a code that appears on several lines. Default `false`. */
30
+ isMergingDuplicates?: boolean;
31
+ };
32
+ /**
33
+ * Parses pasted text into `{ code, quantity }` rows. Blank lines are skipped; a line with a code and
34
+ * no quantity takes `defaultQuantity`; extra cells (a description column) are skipped and the first
35
+ * number after the code is the quantity. Codes are kept as written (trimmed).
36
+ * @example parseBulkPaste('0986494524\t2\nGDB1550 4') // 2 rows
37
+ */
38
+ export declare const parseBulkPaste: (text: string, { defaultQuantity, isMergingDuplicates }?: BulkPasteOptions) => BulkPasteResult;
@@ -0,0 +1,37 @@
1
+ const h = /^([1-9]\d{0,2}(?:\.\d{3})+|\d+)(?:,0+)?$/, m = (t) => {
2
+ const n = h.exec(t);
3
+ if (!n) return null;
4
+ const e = Number(n[1].replace(/\./g, ""));
5
+ return e > 0 && Number.isSafeInteger(e) ? e : null;
6
+ }, x = (t) => {
7
+ for (const s of [" ", ";", ","])
8
+ if (t.includes(s)) return t.split(s).map((r) => r.trim());
9
+ const n = t.trim().split(/\s+/), e = n.at(-1);
10
+ return n.length > 1 && m(e) !== null ? [n.slice(0, -1).join(" "), e] : [t.trim()];
11
+ }, y = (t, { defaultQuantity: n = 1, isMergingDuplicates: e = !1 } = {}) => {
12
+ const s = [], r = [], u = /* @__PURE__ */ new Map();
13
+ return t.split(/\r\n|\r|\n/).forEach((a, i) => {
14
+ const l = a.trim();
15
+ if (!l) return;
16
+ const [o, ...g] = x(a), f = g.filter(Boolean), c = f.length === 0 ? n : f.map(m).find(Boolean) ?? null;
17
+ if (!o) {
18
+ r.push({ line: i + 1, text: l, reason: "missingCode" });
19
+ return;
20
+ }
21
+ if (c === null) {
22
+ r.push({ line: i + 1, text: l, reason: "invalidQuantity" });
23
+ return;
24
+ }
25
+ const p = e ? u.get(o) : void 0;
26
+ if (p) {
27
+ p.quantity += c;
28
+ return;
29
+ }
30
+ const d = { code: o, quantity: c, line: i + 1 };
31
+ s.push(d), u.set(o, d);
32
+ }), { rows: s, invalid: r };
33
+ };
34
+ export {
35
+ y as parseBulkPaste
36
+ };
37
+ //# sourceMappingURL=bulk-paste.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-paste.helper.js","sources":["../../src/helpers/bulk-paste.helper.ts"],"sourcesContent":["/**\n * Bulk paste parser (3.1): a pasted list of part codes and quantities → rows.\n *\n * ⚠ No `'use client'`: the parser is a plain function, callable in a server action or a worker.\n * `BulkPasteInput` (a client module) uses it; the root entry exports it from HERE so that a server\n * component calling it does not reach a client reference.\n */\n\nexport type BulkPasteRow = {\n code: string;\n quantity: number;\n /** 1-based line of the pasted text (the first line when duplicates were merged). */\n line: number;\n};\n\nexport type BulkPasteInvalidReason = 'missingCode' | 'invalidQuantity';\n\nexport type BulkPasteInvalidLine = {\n /** 1-based line of the pasted text. */\n line: number;\n /** The line as pasted, trimmed. */\n text: string;\n reason: BulkPasteInvalidReason;\n};\n\nexport type BulkPasteResult = {\n rows: BulkPasteRow[];\n invalid: BulkPasteInvalidLine[];\n};\n\nexport type BulkPasteOptions = {\n /** Quantity of a line that names only a code. Default 1. */\n defaultQuantity?: number;\n /** Adds up the quantities of a code that appears on several lines. Default `false`. */\n isMergingDuplicates?: boolean;\n};\n\n/*\n * The number grammar of the data contract (the one `QuantityInput` reads): the comma is the decimal\n * point and dots only group by three, so \"1.250\" is a thousand two hundred and fifty. A quantity of\n * a part is whole: a zero fraction (\"2,00\", a spreadsheet's number format) is allowed, \"1,5\" is not.\n */\nconst QUANTITY = /^([1-9]\\d{0,2}(?:\\.\\d{3})+|\\d+)(?:,0+)?$/;\n\n/** A positive whole quantity, or `null`. */\nconst parseQuantity = (cell: string): number | null => {\n const match = QUANTITY.exec(cell);\n if (!match) return null;\n\n const value = Number(match[1].replace(/\\./g, ''));\n\n return value > 0 && Number.isSafeInteger(value) ? value : null;\n};\n\n/**\n * The cells of one line. A spreadsheet copy is tab separated; otherwise `;`, then `,`, then runs of\n * spaces (\"ABC-123 4\"), where the last word is the quantity only if it is a number.\n */\nconst splitLine = (line: string): string[] => {\n for (const separator of ['\\t', ';', ',']) {\n if (line.includes(separator)) return line.split(separator).map(cell => cell.trim());\n }\n\n const words = line.trim().split(/\\s+/);\n const last = words.at(-1) as string;\n\n return words.length > 1 && parseQuantity(last) !== null\n ? [words.slice(0, -1).join(' '), last]\n : [line.trim()];\n};\n\n/**\n * Parses pasted text into `{ code, quantity }` rows. Blank lines are skipped; a line with a code and\n * no quantity takes `defaultQuantity`; extra cells (a description column) are skipped and the first\n * number after the code is the quantity. Codes are kept as written (trimmed).\n * @example parseBulkPaste('0986494524\\t2\\nGDB1550 4') // 2 rows\n */\nexport const parseBulkPaste = (\n text: string,\n { defaultQuantity = 1, isMergingDuplicates = false }: BulkPasteOptions = {},\n): BulkPasteResult => {\n const rows: BulkPasteRow[] = [];\n const invalid: BulkPasteInvalidLine[] = [];\n const byCode = new Map<string, BulkPasteRow>();\n\n text.split(/\\r\\n|\\r|\\n/).forEach((raw, position) => {\n const line = raw.trim();\n if (!line) return;\n\n /* Split BEFORE trimming: a leading tab is an empty code cell, not nothing. */\n const [code, ...cells] = splitLine(raw);\n const rest = cells.filter(Boolean);\n const quantity =\n rest.length === 0 ? defaultQuantity : (rest.map(parseQuantity).find(Boolean) ?? null);\n\n if (!code) {\n invalid.push({ line: position + 1, text: line, reason: 'missingCode' });\n return;\n }\n if (quantity === null) {\n invalid.push({ line: position + 1, text: line, reason: 'invalidQuantity' });\n return;\n }\n\n const existing = isMergingDuplicates ? byCode.get(code) : undefined;\n if (existing) {\n existing.quantity += quantity;\n return;\n }\n\n const row = { code, quantity, line: position + 1 };\n rows.push(row);\n byCode.set(code, row);\n });\n\n return { rows, invalid };\n};\n"],"names":["QUANTITY","parseQuantity","cell","match","value","splitLine","line","separator","words","last","parseBulkPaste","text","defaultQuantity","isMergingDuplicates","rows","invalid","byCode","raw","position","code","cells","rest","quantity","existing","row"],"mappings":"AA0CA,MAAMA,IAAW,4CAGXC,IAAgB,CAACC,MAAgC;AACrD,QAAMC,IAAQH,EAAS,KAAKE,CAAI;AAChC,MAAI,CAACC,EAAO,QAAO;AAEnB,QAAMC,IAAQ,OAAOD,EAAM,CAAC,EAAE,QAAQ,OAAO,EAAE,CAAC;AAEhD,SAAOC,IAAQ,KAAK,OAAO,cAAcA,CAAK,IAAIA,IAAQ;AAC5D,GAMMC,IAAY,CAACC,MAA2B;AAC5C,aAAWC,KAAa,CAAC,KAAM,KAAK,GAAG;AACrC,QAAID,EAAK,SAASC,CAAS,EAAG,QAAOD,EAAK,MAAMC,CAAS,EAAE,IAAI,CAAAL,MAAQA,EAAK,MAAM;AAGpF,QAAMM,IAAQF,EAAK,KAAA,EAAO,MAAM,KAAK,GAC/BG,IAAOD,EAAM,GAAG,EAAE;AAExB,SAAOA,EAAM,SAAS,KAAKP,EAAcQ,CAAI,MAAM,OAC/C,CAACD,EAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,GAAGC,CAAI,IACnC,CAACH,EAAK,MAAM;AAClB,GAQaI,IAAiB,CAC5BC,GACA,EAAE,iBAAAC,IAAkB,GAAG,qBAAAC,IAAsB,GAAA,IAA4B,OACrD;AACpB,QAAMC,IAAuB,CAAA,GACvBC,IAAkC,CAAA,GAClCC,wBAAa,IAAA;AAEnB,SAAAL,EAAK,MAAM,YAAY,EAAE,QAAQ,CAACM,GAAKC,MAAa;AAClD,UAAMZ,IAAOW,EAAI,KAAA;AACjB,QAAI,CAACX,EAAM;AAGX,UAAM,CAACa,GAAM,GAAGC,CAAK,IAAIf,EAAUY,CAAG,GAChCI,IAAOD,EAAM,OAAO,OAAO,GAC3BE,IACJD,EAAK,WAAW,IAAIT,IAAmBS,EAAK,IAAIpB,CAAa,EAAE,KAAK,OAAO,KAAK;AAElF,QAAI,CAACkB,GAAM;AACT,MAAAJ,EAAQ,KAAK,EAAE,MAAMG,IAAW,GAAG,MAAMZ,GAAM,QAAQ,eAAe;AACtE;AAAA,IACF;AACA,QAAIgB,MAAa,MAAM;AACrB,MAAAP,EAAQ,KAAK,EAAE,MAAMG,IAAW,GAAG,MAAMZ,GAAM,QAAQ,mBAAmB;AAC1E;AAAA,IACF;AAEA,UAAMiB,IAAWV,IAAsBG,EAAO,IAAIG,CAAI,IAAI;AAC1D,QAAII,GAAU;AACZ,MAAAA,EAAS,YAAYD;AACrB;AAAA,IACF;AAEA,UAAME,IAAM,EAAE,MAAAL,GAAM,UAAAG,GAAU,MAAMJ,IAAW,EAAA;AAC/C,IAAAJ,EAAK,KAAKU,CAAG,GACbR,EAAO,IAAIG,GAAMK,CAAG;AAAA,EACtB,CAAC,GAEM,EAAE,MAAAV,GAAM,SAAAC,EAAA;AACjB;"}
package/build/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./theme/UiProvider.cjs"),$=require("./theme/UiThemeScript.cjs"),E=require("./theme/context.cjs"),r=require("@handijitcom/ui/design"),S=require("./helpers/focus.helper.cjs"),_=require("./hooks/useAnnounce.cjs"),B=require("./hooks/useUiTheme.cjs"),p=require("./hooks/useUiTokens.cjs"),R=require("./hooks/useStickToBottom.cjs"),P=require("./hooks/useListboxNavigation.cjs"),A=require("./hooks/usePositioning.cjs"),I=require("./hooks/useVirtualList.cjs"),m=require("./enums/ui-variant.enum.cjs"),O=require("./enums/ui-size.enum.cjs"),e=require("./constants/breakpoint.constants.cjs"),d=require("./helpers/text.helper.cjs"),b=require("./components/Button/index.cjs"),C=require("./components/IconButton/index.cjs"),g=require("./components/TextLink/index.cjs"),M=require("./components/Tooltip/index.cjs"),a=require("./components/Menu/index.cjs"),D=require("./components/Popover/index.cjs"),y=require("./components/Chip/index.cjs"),U=require("./components/ChipGroup/index.cjs"),h=require("./components/Combobox/index.cjs"),H=require("./components/SegmentedControl/index.cjs"),k=require("./components/Select/index.cjs"),L=require("./components/Checkbox/index.cjs"),F=require("./components/Switch/index.cjs"),w=require("./components/Radio/index.cjs"),v=require("./components/RadioCard/index.cjs"),K=require("./components/RangeSlider/index.cjs"),N=require("./components/RatingInput/index.cjs"),Q=require("./components/QuantityStepper/index.cjs"),V=require("./components/TableCheckbox/index.cjs"),Y=require("./components/Input/index.cjs"),j=require("./components/PasswordInput/index.cjs"),G=require("./components/ScaledInput/index.cjs"),z=require("./components/MoneyInput/index.cjs"),J=require("./components/QuantityInput/index.cjs"),W=require("./components/RateInput/index.cjs"),X=require("./components/PercentInput/index.cjs"),Z=require("./components/TagInput/index.cjs"),ee=require("./components/Textarea/index.cjs"),o=require("./components/DateField/index.cjs"),te=require("./components/Field/index.cjs"),re=require("./components/FileUpload/index.cjs"),ie=require("./components/Alert/index.cjs"),ne=require("./components/Avatar/index.cjs"),ue=require("./components/Badge/index.cjs"),de=require("./components/Breadcrumb/index.cjs"),t=require("./components/Card/index.cjs"),ae=require("./components/Carousel/index.cjs"),oe=require("./components/CodeBadge/index.cjs"),le=require("./components/Kbd/index.cjs"),se=require("./components/StatusDot/index.cjs"),ce=require("./components/CopyField/index.cjs"),fe=require("./components/Divider/index.cjs"),i=require("./components/Directory/index.cjs"),qe=require("./components/EmptyState/index.cjs"),xe=require("./components/PageHeader/index.cjs"),u=require("./components/Panel/index.cjs"),Te=require("./components/Price/index.cjs"),$e=require("./components/Rating/index.cjs"),Ee=require("./components/SectionHeader/index.cjs"),Se=require("./components/ScrollArea/index.cjs"),n=require("./components/Skeleton/index.cjs"),_e=require("./components/Stat/index.cjs"),Be=require("./components/SummaryCard/index.cjs"),l=require("./components/Progress/index.cjs"),pe=require("./components/Spinner/index.cjs"),s=require("./components/Toast/index.cjs"),Re=require("./components/ToastPortal/index.cjs"),Pe=require("./components/Accordion/index.cjs"),Ae=require("./components/Disclosure/index.cjs"),Ie=require("./components/Steps/index.cjs"),me=require("./components/Tabs/index.cjs"),Oe=require("./components/Tile/index.cjs"),be=require("./components/Timeline/index.cjs"),c=require("./components/BrandSurface/index.cjs"),Ce=require("./components/Eyebrow/index.cjs"),ge=require("./components/StatStrip/index.cjs"),Me=require("./components/BottomSheet/index.cjs"),De=require("./components/Modal/index.cjs"),ye=require("./components/CommandPalette/index.cjs"),Ue=require("./components/ConfirmDialog/index.cjs"),he=require("./components/Drawer/index.cjs"),He=require("./components/PromptDialog/index.cjs"),f=require("./components/Table/index.cjs"),q=require("./components/DataTable/index.cjs"),x=require("./components/FilterBar/index.cjs"),ke=require("./components/Pagination/index.cjs");exports.UiProvider=T.default;exports.UiThemeScript=$.default;exports.useUi=E.useUi;Object.defineProperty(exports,"THEME_ATTRIBUTE",{enumerable:!0,get:()=>r.THEME_ATTRIBUTE});Object.defineProperty(exports,"THEME_BOOT_SCRIPT",{enumerable:!0,get:()=>r.THEME_BOOT_SCRIPT});Object.defineProperty(exports,"THEME_BOOT_SCRIPT_HASH",{enumerable:!0,get:()=>r.THEME_BOOT_SCRIPT_HASH});Object.defineProperty(exports,"THEME_STORAGE_KEY",{enumerable:!0,get:()=>r.THEME_STORAGE_KEY});exports.hasOpenSurface=S.hasOpenSurface;exports.useAnnounce=_.default;exports.useUiTheme=B.default;exports.useUiTokens=p.default;exports.useStickToBottom=R.default;exports.useListboxNavigation=P.default;exports.usePositioning=A.default;exports.useVirtualList=I.default;exports.UIVariant=m.default;exports.UISize=O.default;exports.ABOVE_MOBILE_MEDIA_QUERY=e.ABOVE_MOBILE_MEDIA_QUERY;exports.ABOVE_TABLET_MEDIA_QUERY=e.ABOVE_TABLET_MEDIA_QUERY;exports.MOBILE_BREAKPOINT=e.MOBILE_BREAKPOINT;exports.SHEET_MEDIA_QUERY=e.SHEET_MEDIA_QUERY;exports.TABLET_BREAKPOINT=e.TABLET_BREAKPOINT;exports.TABLET_PORTRAIT_BREAKPOINT=e.TABLET_PORTRAIT_BREAKPOINT;exports.matchesSearch=d.matchesSearch;exports.normalizeSearchTerm=d.normalizeSearchTerm;exports.Button=b.default;exports.IconButton=C.default;exports.TextLink=g.default;exports.Tooltip=M.default;exports.ContextMenu=a.ContextMenu;exports.Menu=a.default;exports.Popover=D.default;exports.Chip=y.default;exports.ChipGroup=U.default;exports.Combobox=h.default;exports.SegmentedControl=H.default;exports.Select=k.default;exports.Checkbox=L.default;exports.Switch=F.default;exports.Radio=w.default;exports.RadioCard=v.default;exports.RangeSlider=K.default;exports.RatingInput=N.default;exports.QuantityStepper=Q.default;exports.TableCheckbox=V.default;exports.Input=Y.default;exports.PasswordInput=j.default;exports.ScaledInput=G.default;exports.MoneyInput=z.default;exports.QuantityInput=J.default;exports.RateInput=W.default;exports.PercentInput=X.default;exports.TagInput=Z.default;exports.Textarea=ee.default;exports.DateField=o.default;exports.DateRange=o.DateRange;exports.Field=te.default;exports.FileUpload=re.default;exports.Alert=ie.default;exports.Avatar=ne.default;exports.Badge=ue.default;exports.Breadcrumb=de.default;exports.Card=t.default;exports.CardBody=t.CardBody;exports.CardFooter=t.CardFooter;exports.CardMedia=t.CardMedia;exports.CardOverlay=t.CardOverlay;exports.Carousel=ae.default;exports.CodeBadge=oe.default;exports.Kbd=le.default;exports.StatusDot=se.default;exports.CopyField=ce.default;exports.Divider=fe.default;exports.Directory=i.default;exports.DirectoryGroup=i.DirectoryGroup;exports.DirectoryJump=i.DirectoryJump;exports.DirectoryRow=i.DirectoryRow;exports.EmptyState=qe.default;exports.PageHeader=xe.default;exports.Panel=u.default;exports.PanelForm=u.PanelForm;exports.PanelRow=u.PanelRow;exports.Price=Te.default;exports.Rating=$e.default;exports.SectionHeader=Ee.default;exports.ScrollArea=Se.default;exports.Skeleton=n.default;exports.SkeletonCard=n.SkeletonCard;exports.SkeletonRows=n.SkeletonRows;exports.SkeletonTable=n.SkeletonTable;exports.Stat=_e.default;exports.SummaryCard=Be.default;exports.Progress=l.default;exports.ProgressCircle=l.ProgressCircle;exports.Spinner=pe.default;exports.ToastHub=s.default;exports.toast=s.toast;exports.ToastPortal=Re.default;exports.Accordion=Pe.default;exports.Disclosure=Ae.default;exports.Steps=Ie.default;exports.Tabs=me.default;exports.Tile=Oe.default;exports.Timeline=be.default;exports.BrandBlueprint=c.BrandBlueprint;exports.BrandSurface=c.default;exports.Eyebrow=Ce.default;exports.StatStrip=ge.default;exports.BottomSheet=Me.default;exports.Modal=De.default;exports.CommandPalette=ye.default;exports.ConfirmDialog=Ue.default;exports.Drawer=he.default;exports.PromptDialog=He.default;exports.Table=f.default;exports.TableScroller=f.TableScroller;exports.DataTable=q.default;exports.DataTableRow=q.DataTableRow;exports.FilterBar=x.default;exports.FilterBarField=x.FilterBarField;exports.Pagination=ke.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./theme/UiProvider.cjs"),p=require("./theme/UiThemeScript.cjs"),E=require("./theme/context.cjs"),r=require("@handijitcom/ui/design"),S=require("./helpers/focus.helper.cjs"),B=require("./hooks/useAnnounce.cjs"),_=require("./hooks/useUiTheme.cjs"),A=require("./hooks/useUiTokens.cjs"),P=require("./hooks/useStickToBottom.cjs"),R=require("./hooks/useListboxNavigation.cjs"),I=require("./hooks/usePositioning.cjs"),m=require("./hooks/useVirtualList.cjs"),O=require("./enums/ui-variant.enum.cjs"),b=require("./enums/ui-size.enum.cjs"),e=require("./constants/breakpoint.constants.cjs"),d=require("./helpers/text.helper.cjs"),C=require("./components/Button/index.cjs"),h=require("./components/IconButton/index.cjs"),g=require("./components/TextLink/index.cjs"),M=require("./components/Tooltip/index.cjs"),o=require("./components/Menu/index.cjs"),D=require("./components/Popover/index.cjs"),y=require("./components/Chip/index.cjs"),U=require("./components/ChipGroup/index.cjs"),k=require("./components/Combobox/index.cjs"),v=require("./components/SegmentedControl/index.cjs"),H=require("./components/Select/index.cjs"),N=require("./components/Checkbox/index.cjs"),L=require("./components/Switch/index.cjs"),F=require("./components/Radio/index.cjs"),w=require("./components/RadioCard/index.cjs"),K=require("./components/RangeSlider/index.cjs"),G=require("./components/RatingInput/index.cjs"),Q=require("./components/QuantityStepper/index.cjs"),V=require("./components/TableCheckbox/index.cjs"),Y=require("./components/Input/index.cjs"),j=require("./components/PasswordInput/index.cjs"),z=require("./components/ScaledInput/index.cjs"),J=require("./components/MoneyInput/index.cjs"),W=require("./components/QuantityInput/index.cjs"),X=require("./components/RateInput/index.cjs"),Z=require("./components/PercentInput/index.cjs"),ee=require("./components/TagInput/index.cjs"),te=require("./components/Textarea/index.cjs"),l=require("./components/DateField/index.cjs"),re=require("./components/Field/index.cjs"),ie=require("./components/FileUpload/index.cjs"),ne=require("./components/Alert/index.cjs"),ue=require("./components/Avatar/index.cjs"),ae=require("./components/Badge/index.cjs"),de=require("./components/Breadcrumb/index.cjs"),t=require("./components/Card/index.cjs"),oe=require("./components/Carousel/index.cjs"),le=require("./components/CodeBadge/index.cjs"),se=require("./components/Kbd/index.cjs"),ce=require("./components/StatusDot/index.cjs"),fe=require("./components/CopyField/index.cjs"),qe=require("./components/Divider/index.cjs"),i=require("./components/Directory/index.cjs"),xe=require("./components/EmptyState/index.cjs"),$e=require("./components/PageHeader/index.cjs"),u=require("./components/Panel/index.cjs"),Te=require("./components/Price/index.cjs"),pe=require("./components/Rating/index.cjs"),Ee=require("./components/SectionHeader/index.cjs"),Se=require("./components/ScrollArea/index.cjs"),n=require("./components/Skeleton/index.cjs"),Be=require("./components/Stat/index.cjs"),_e=require("./components/SummaryCard/index.cjs"),s=require("./components/Progress/index.cjs"),Ae=require("./components/Spinner/index.cjs"),c=require("./components/Toast/index.cjs"),Pe=require("./components/ToastPortal/index.cjs"),Re=require("./components/Accordion/index.cjs"),Ie=require("./components/Disclosure/index.cjs"),me=require("./components/Steps/index.cjs"),Oe=require("./components/Tabs/index.cjs"),be=require("./components/Tile/index.cjs"),Ce=require("./components/Timeline/index.cjs"),f=require("./components/BrandSurface/index.cjs"),he=require("./components/Eyebrow/index.cjs"),ge=require("./components/StatStrip/index.cjs"),Me=require("./components/BottomSheet/index.cjs"),De=require("./components/Modal/index.cjs"),ye=require("./components/CommandPalette/index.cjs"),Ue=require("./components/ConfirmDialog/index.cjs"),ke=require("./components/Drawer/index.cjs"),ve=require("./components/PromptDialog/index.cjs"),q=require("./components/Table/index.cjs"),x=require("./components/DataTable/index.cjs"),He=require("./components/DataTableColumnMenu/index.cjs"),Ne=require("./components/Gallery/index.cjs"),Le=require("./components/TreeSelect/index.cjs"),Fe=require("./components/NotificationCenter/index.cjs"),we=require("./components/BulkPasteInput/index.cjs"),Ke=require("./helpers/bulk-paste.helper.cjs"),Ge=require("./components/AppShell/index.cjs"),Qe=require("./components/UserMenu/index.cjs"),$=require("./components/FilterBar/index.cjs"),Ve=require("./components/Pagination/index.cjs"),a=require("./components/AppShell/Nav.cjs");exports.UiProvider=T.default;exports.UiThemeScript=p.default;exports.useUi=E.useUi;Object.defineProperty(exports,"THEME_ATTRIBUTE",{enumerable:!0,get:()=>r.THEME_ATTRIBUTE});Object.defineProperty(exports,"THEME_BOOT_SCRIPT",{enumerable:!0,get:()=>r.THEME_BOOT_SCRIPT});Object.defineProperty(exports,"THEME_BOOT_SCRIPT_HASH",{enumerable:!0,get:()=>r.THEME_BOOT_SCRIPT_HASH});Object.defineProperty(exports,"THEME_STORAGE_KEY",{enumerable:!0,get:()=>r.THEME_STORAGE_KEY});exports.hasOpenSurface=S.hasOpenSurface;exports.useAnnounce=B.default;exports.useUiTheme=_.default;exports.useUiTokens=A.default;exports.useStickToBottom=P.default;exports.useListboxNavigation=R.default;exports.usePositioning=I.default;exports.useVirtualList=m.default;exports.UIVariant=O.default;exports.UISize=b.default;exports.ABOVE_MOBILE_MEDIA_QUERY=e.ABOVE_MOBILE_MEDIA_QUERY;exports.ABOVE_TABLET_MEDIA_QUERY=e.ABOVE_TABLET_MEDIA_QUERY;exports.MOBILE_BREAKPOINT=e.MOBILE_BREAKPOINT;exports.SHEET_MEDIA_QUERY=e.SHEET_MEDIA_QUERY;exports.TABLET_BREAKPOINT=e.TABLET_BREAKPOINT;exports.TABLET_PORTRAIT_BREAKPOINT=e.TABLET_PORTRAIT_BREAKPOINT;exports.matchesSearch=d.matchesSearch;exports.normalizeSearchTerm=d.normalizeSearchTerm;exports.Button=C.default;exports.IconButton=h.default;exports.TextLink=g.default;exports.Tooltip=M.default;exports.ContextMenu=o.ContextMenu;exports.Menu=o.default;exports.Popover=D.default;exports.Chip=y.default;exports.ChipGroup=U.default;exports.Combobox=k.default;exports.SegmentedControl=v.default;exports.Select=H.default;exports.Checkbox=N.default;exports.Switch=L.default;exports.Radio=F.default;exports.RadioCard=w.default;exports.RangeSlider=K.default;exports.RatingInput=G.default;exports.QuantityStepper=Q.default;exports.TableCheckbox=V.default;exports.Input=Y.default;exports.PasswordInput=j.default;exports.ScaledInput=z.default;exports.MoneyInput=J.default;exports.QuantityInput=W.default;exports.RateInput=X.default;exports.PercentInput=Z.default;exports.TagInput=ee.default;exports.Textarea=te.default;exports.DateField=l.default;exports.DateRange=l.DateRange;exports.Field=re.default;exports.FileUpload=ie.default;exports.Alert=ne.default;exports.Avatar=ue.default;exports.Badge=ae.default;exports.Breadcrumb=de.default;exports.Card=t.default;exports.CardBody=t.CardBody;exports.CardFooter=t.CardFooter;exports.CardMedia=t.CardMedia;exports.CardOverlay=t.CardOverlay;exports.Carousel=oe.default;exports.CodeBadge=le.default;exports.Kbd=se.default;exports.StatusDot=ce.default;exports.CopyField=fe.default;exports.Divider=qe.default;exports.Directory=i.default;exports.DirectoryGroup=i.DirectoryGroup;exports.DirectoryJump=i.DirectoryJump;exports.DirectoryRow=i.DirectoryRow;exports.EmptyState=xe.default;exports.PageHeader=$e.default;exports.Panel=u.default;exports.PanelForm=u.PanelForm;exports.PanelRow=u.PanelRow;exports.Price=Te.default;exports.Rating=pe.default;exports.SectionHeader=Ee.default;exports.ScrollArea=Se.default;exports.Skeleton=n.default;exports.SkeletonCard=n.SkeletonCard;exports.SkeletonRows=n.SkeletonRows;exports.SkeletonTable=n.SkeletonTable;exports.Stat=Be.default;exports.SummaryCard=_e.default;exports.Progress=s.default;exports.ProgressCircle=s.ProgressCircle;exports.Spinner=Ae.default;exports.ToastHub=c.default;exports.toast=c.toast;exports.ToastPortal=Pe.default;exports.Accordion=Re.default;exports.Disclosure=Ie.default;exports.Steps=me.default;exports.Tabs=Oe.default;exports.Tile=be.default;exports.Timeline=Ce.default;exports.BrandBlueprint=f.BrandBlueprint;exports.BrandSurface=f.default;exports.Eyebrow=he.default;exports.StatStrip=ge.default;exports.BottomSheet=Me.default;exports.Modal=De.default;exports.CommandPalette=ye.default;exports.ConfirmDialog=Ue.default;exports.Drawer=ke.default;exports.PromptDialog=ve.default;exports.Table=q.default;exports.TableScroller=q.TableScroller;exports.DataTable=x.default;exports.DataTableRow=x.DataTableRow;exports.DataTableColumnMenu=He.default;exports.Gallery=Ne.default;exports.TreeSelect=Le.default;exports.NotificationCenter=Fe.default;exports.BulkPasteInput=we.default;exports.parseBulkPaste=Ke.parseBulkPaste;exports.AppShell=Ge.default;exports.UserMenu=Qe.default;exports.FilterBar=$.default;exports.FilterBarField=$.FilterBarField;exports.Pagination=Ve.default;exports.AppShellNav=a.AppShellNav;exports.AppShellNavGroup=a.AppShellNavGroup;exports.AppShellNavItem=a.AppShellNavItem;
2
2
  //# sourceMappingURL=index.cjs.map
package/build/index.d.cts CHANGED
@@ -93,7 +93,15 @@ export { default as ConfirmDialog, type ConfirmKind } from './components/Confirm
93
93
  export { default as Drawer } from './components/Drawer/index.cjs';
94
94
  export { default as PromptDialog } from './components/PromptDialog/index.cjs';
95
95
  export { default as Table, TableScroller } from './components/Table/index.cjs';
96
- export { default as DataTable, DataTableRow, type DataTableColumn } from './components/DataTable/index.cjs';
96
+ export { default as DataTable, DataTableRow, type DataTableColumn, type DataTableColumnState, type DataTableDensity, } from './components/DataTable/index.cjs';
97
+ export { default as DataTableColumnMenu, type DataTableColumnMenuLabels, } from './components/DataTableColumnMenu/index.cjs';
98
+ export { default as Gallery, type GalleryImage, type GalleryImageVariant, type GalleryLabels, type GalleryRenderImageProps, } from './components/Gallery/index.cjs';
99
+ export { default as TreeSelect, type TreeSelectLabels, type TreeSelectNode, type TreeSelectProps, } from './components/TreeSelect/index.cjs';
100
+ export { default as NotificationCenter, type NotificationCenterLabels, type NotificationItem, } from './components/NotificationCenter/index.cjs';
101
+ export { default as BulkPasteInput, type BulkPasteLabels } from './components/BulkPasteInput/index.cjs';
102
+ export { type BulkPasteInvalidLine, type BulkPasteInvalidReason, type BulkPasteOptions, type BulkPasteResult, type BulkPasteRow, parseBulkPaste, } from './helpers/bulk-paste.helper.cjs';
103
+ export { default as AppShell, AppShellNav, AppShellNavGroup, AppShellNavItem, type AppShellLabels, type AppShellNavGroupProps, type AppShellNavItemProps, type AppShellNavLink, type AppShellNavProps, type AppShellNavSection, } from './components/AppShell/index.cjs';
104
+ export { default as UserMenu } from './components/UserMenu/index.cjs';
97
105
  export { default as FilterBar, FilterBarField } from './components/FilterBar/index.cjs';
98
106
  export { default as Pagination } from './components/Pagination/index.cjs';
99
107
  export type { AnnouncePoliteness, ListboxNavigationOptions, VirtualRange } from './types/hook.type.cjs';
package/build/index.d.ts CHANGED
@@ -93,7 +93,15 @@ export { default as ConfirmDialog, type ConfirmKind } from './components/Confirm
93
93
  export { default as Drawer } from './components/Drawer/index.js';
94
94
  export { default as PromptDialog } from './components/PromptDialog/index.js';
95
95
  export { default as Table, TableScroller } from './components/Table/index.js';
96
- export { default as DataTable, DataTableRow, type DataTableColumn } from './components/DataTable/index.js';
96
+ export { default as DataTable, DataTableRow, type DataTableColumn, type DataTableColumnState, type DataTableDensity, } from './components/DataTable/index.js';
97
+ export { default as DataTableColumnMenu, type DataTableColumnMenuLabels, } from './components/DataTableColumnMenu/index.js';
98
+ export { default as Gallery, type GalleryImage, type GalleryImageVariant, type GalleryLabels, type GalleryRenderImageProps, } from './components/Gallery/index.js';
99
+ export { default as TreeSelect, type TreeSelectLabels, type TreeSelectNode, type TreeSelectProps, } from './components/TreeSelect/index.js';
100
+ export { default as NotificationCenter, type NotificationCenterLabels, type NotificationItem, } from './components/NotificationCenter/index.js';
101
+ export { default as BulkPasteInput, type BulkPasteLabels } from './components/BulkPasteInput/index.js';
102
+ export { type BulkPasteInvalidLine, type BulkPasteInvalidReason, type BulkPasteOptions, type BulkPasteResult, type BulkPasteRow, parseBulkPaste, } from './helpers/bulk-paste.helper.js';
103
+ export { default as AppShell, AppShellNav, AppShellNavGroup, AppShellNavItem, type AppShellLabels, type AppShellNavGroupProps, type AppShellNavItemProps, type AppShellNavLink, type AppShellNavProps, type AppShellNavSection, } from './components/AppShell/index.js';
104
+ export { default as UserMenu } from './components/UserMenu/index.js';
97
105
  export { default as FilterBar, FilterBarField } from './components/FilterBar/index.js';
98
106
  export { default as Pagination } from './components/Pagination/index.js';
99
107
  export type { AnnouncePoliteness, ListboxNavigationOptions, VirtualRange } from './types/hook.type.js';