@solibo/solibo-ui 0.4.10 → 0.5.3

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 (192) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/assets/index10.css +1 -1
  4. package/dist/assets/index11.css +1 -1
  5. package/dist/assets/index12.css +1 -1
  6. package/dist/assets/index13.css +1 -1
  7. package/dist/assets/index14.css +1 -1
  8. package/dist/assets/index15.css +1 -1
  9. package/dist/assets/index16.css +1 -1
  10. package/dist/assets/index17.css +1 -1
  11. package/dist/assets/index18.css +1 -1
  12. package/dist/assets/index19.css +1 -1
  13. package/dist/assets/index2.css +1 -1
  14. package/dist/assets/index20.css +1 -1
  15. package/dist/assets/index21.css +1 -1
  16. package/dist/assets/index22.css +1 -1
  17. package/dist/assets/index23.css +1 -1
  18. package/dist/assets/index24.css +1 -1
  19. package/dist/assets/index25.css +1 -1
  20. package/dist/assets/index26.css +1 -1
  21. package/dist/assets/index27.css +1 -1
  22. package/dist/assets/index29.css +1 -1
  23. package/dist/assets/index3.css +1 -1
  24. package/dist/assets/index30.css +1 -1
  25. package/dist/assets/index31.css +1 -1
  26. package/dist/assets/index32.css +1 -1
  27. package/dist/assets/index33.css +1 -1
  28. package/dist/assets/index34.css +1 -1
  29. package/dist/assets/index35.css +1 -1
  30. package/dist/assets/index36.css +1 -1
  31. package/dist/assets/index37.css +1 -1
  32. package/dist/assets/index38.css +1 -1
  33. package/dist/assets/index39.css +1 -1
  34. package/dist/assets/index4.css +1 -1
  35. package/dist/assets/index40.css +1 -1
  36. package/dist/assets/index41.css +1 -1
  37. package/dist/assets/index42.css +1 -1
  38. package/dist/assets/index43.css +1 -1
  39. package/dist/assets/index44.css +1 -1
  40. package/dist/assets/index5.css +1 -1
  41. package/dist/assets/index6.css +1 -1
  42. package/dist/assets/index8.css +1 -1
  43. package/dist/assets/index9.css +1 -1
  44. package/dist/assets/styles.css +1 -1
  45. package/dist/components/_avatar/index.cjs +1 -1
  46. package/dist/components/_avatar/index.cjs.map +1 -1
  47. package/dist/components/_avatar/index.js +9 -9
  48. package/dist/components/_avatar/index.js.map +1 -1
  49. package/dist/components/_card/index.cjs +1 -1
  50. package/dist/components/_card/index.js +12 -12
  51. package/dist/components/_collapsible/index.cjs +1 -1
  52. package/dist/components/_collapsible/index.js +1 -1
  53. package/dist/components/_croppable/index.cjs +1 -1
  54. package/dist/components/_croppable/index.js +175 -175
  55. package/dist/components/_dropdown/index.cjs +1 -1
  56. package/dist/components/_dropdown/index.cjs.map +1 -1
  57. package/dist/components/_dropdown/index.js +87 -87
  58. package/dist/components/_dropdown/index.js.map +1 -1
  59. package/dist/components/_dropzone/index.cjs +1 -1
  60. package/dist/components/_dropzone/index.js +34 -34
  61. package/dist/components/_editor/index.cjs +16 -16
  62. package/dist/components/_editor/index.cjs.map +1 -1
  63. package/dist/components/_editor/index.js +19 -19
  64. package/dist/components/_editor/index.js.map +1 -1
  65. package/dist/components/_messages/index.cjs +1 -1
  66. package/dist/components/_messages/index.cjs.map +1 -1
  67. package/dist/components/_messages/index.js +15 -15
  68. package/dist/components/_messages/index.js.map +1 -1
  69. package/dist/components/_portal/index.cjs +1 -1
  70. package/dist/components/_portal/index.cjs.map +1 -1
  71. package/dist/components/_portal/index.js +17 -16
  72. package/dist/components/_portal/index.js.map +1 -1
  73. package/dist/components/_sortable/index.cjs +1 -1
  74. package/dist/components/_sortable/index.cjs.map +1 -1
  75. package/dist/components/_sortable/index.js +64 -33
  76. package/dist/components/_sortable/index.js.map +1 -1
  77. package/dist/components/_widget/index.cjs +1 -1
  78. package/dist/components/_widget/index.js +3 -3
  79. package/dist/components/accordion/index.cjs +1 -1
  80. package/dist/components/accordion/index.cjs.map +1 -1
  81. package/dist/components/accordion/index.js +16 -10
  82. package/dist/components/accordion/index.js.map +1 -1
  83. package/dist/components/app-link/index.cjs +1 -1
  84. package/dist/components/app-link/index.cjs.map +1 -1
  85. package/dist/components/app-link/index.js +9 -9
  86. package/dist/components/app-link/index.js.map +1 -1
  87. package/dist/components/aside/index.cjs +1 -1
  88. package/dist/components/aside/index.js +6 -6
  89. package/dist/components/badge/index.cjs +1 -1
  90. package/dist/components/badge/index.cjs.map +1 -1
  91. package/dist/components/badge/index.js +19 -18
  92. package/dist/components/badge/index.js.map +1 -1
  93. package/dist/components/banner/index.cjs +1 -1
  94. package/dist/components/banner/index.js +9 -9
  95. package/dist/components/branding/index.cjs +1 -1
  96. package/dist/components/branding/index.js +12 -12
  97. package/dist/components/button/index.cjs +1 -1
  98. package/dist/components/button/index.js +12 -12
  99. package/dist/components/checkbox/index.cjs +1 -1
  100. package/dist/components/checkbox/index.js +7 -7
  101. package/dist/components/controls/index.cjs +1 -1
  102. package/dist/components/controls/index.cjs.map +1 -1
  103. package/dist/components/controls/index.js +21 -10
  104. package/dist/components/controls/index.js.map +1 -1
  105. package/dist/components/dialog/index.cjs +1 -1
  106. package/dist/components/dialog/index.js +3 -3
  107. package/dist/components/figure/index.cjs +1 -1
  108. package/dist/components/figure/index.cjs.map +1 -1
  109. package/dist/components/figure/index.js +11 -11
  110. package/dist/components/figure/index.js.map +1 -1
  111. package/dist/components/file/index.cjs +1 -1
  112. package/dist/components/file/index.cjs.map +1 -1
  113. package/dist/components/file/index.js +14 -13
  114. package/dist/components/file/index.js.map +1 -1
  115. package/dist/components/footer/index.cjs +1 -1
  116. package/dist/components/footer/index.js +3 -3
  117. package/dist/components/form/index.cjs +1 -1
  118. package/dist/components/form/index.js +11 -11
  119. package/dist/components/graph/index.cjs +1 -1
  120. package/dist/components/graph/index.cjs.map +1 -1
  121. package/dist/components/graph/index.js +31 -31
  122. package/dist/components/graph/index.js.map +1 -1
  123. package/dist/components/header/index.cjs +1 -1
  124. package/dist/components/header/index.js +3 -3
  125. package/dist/components/icon/index.cjs +1 -1
  126. package/dist/components/icon/index.cjs.map +1 -1
  127. package/dist/components/icon/index.js +26 -26
  128. package/dist/components/icon/index.js.map +1 -1
  129. package/dist/components/image/index.cjs +1 -1
  130. package/dist/components/image/index.js +9 -9
  131. package/dist/components/input/index.cjs +1 -1
  132. package/dist/components/input/index.cjs.map +1 -1
  133. package/dist/components/input/index.js +34 -33
  134. package/dist/components/input/index.js.map +1 -1
  135. package/dist/components/link/index.cjs +1 -1
  136. package/dist/components/link/index.js +11 -11
  137. package/dist/components/list/index.cjs +1 -1
  138. package/dist/components/list/index.js +7 -7
  139. package/dist/components/loading/index.cjs +1 -1
  140. package/dist/components/loading/index.js +13 -13
  141. package/dist/components/message/index.cjs +1 -1
  142. package/dist/components/message/index.js +7 -7
  143. package/dist/components/nav/index.cjs +1 -1
  144. package/dist/components/nav/index.js +23 -23
  145. package/dist/components/object/index.cjs +2 -0
  146. package/dist/components/object/index.cjs.map +1 -0
  147. package/dist/components/object/index.js +16 -0
  148. package/dist/components/object/index.js.map +1 -0
  149. package/dist/components/select/index.cjs +1 -1
  150. package/dist/components/select/index.js +1 -1
  151. package/dist/components/table/index.cjs +1 -1
  152. package/dist/components/table/index.cjs.map +1 -1
  153. package/dist/components/table/index.js +22 -22
  154. package/dist/components/table/index.js.map +1 -1
  155. package/dist/components/textarea/index.cjs +1 -1
  156. package/dist/components/textarea/index.cjs.map +1 -1
  157. package/dist/components/textarea/index.js +23 -23
  158. package/dist/components/textarea/index.js.map +1 -1
  159. package/dist/components/toast/index.cjs +1 -1
  160. package/dist/components/toast/index.cjs.map +1 -1
  161. package/dist/components/toast/index.js +23 -24
  162. package/dist/components/toast/index.js.map +1 -1
  163. package/dist/components/toggle/index.cjs +1 -1
  164. package/dist/components/toggle/index.js +1 -1
  165. package/dist/components/toolbar/index.cjs +1 -1
  166. package/dist/components/toolbar/index.js +9 -9
  167. package/dist/index-CiEbbnD6.js +42 -0
  168. package/dist/index-CiEbbnD6.js.map +1 -0
  169. package/dist/index-ClrKYsAQ.cjs +2 -0
  170. package/dist/index-ClrKYsAQ.cjs.map +1 -0
  171. package/dist/index.cjs +1 -1
  172. package/dist/index.d.ts +28 -22
  173. package/dist/index.js +33 -33
  174. package/dist/styles.module-BOTEBJ0C.js +9 -0
  175. package/dist/styles.module-BOTEBJ0C.js.map +1 -0
  176. package/dist/styles.module-BPvMQa_x.cjs +2 -0
  177. package/dist/styles.module-BPvMQa_x.cjs.map +1 -0
  178. package/dist/tokens.css +44 -12
  179. package/dist/tokens.json +541 -68
  180. package/package.json +1 -1
  181. package/dist/components/layout/index.cjs +0 -2
  182. package/dist/components/layout/index.cjs.map +0 -1
  183. package/dist/components/layout/index.js +0 -18
  184. package/dist/components/layout/index.js.map +0 -1
  185. package/dist/index-BpUboRfJ.cjs +0 -2
  186. package/dist/index-BpUboRfJ.cjs.map +0 -1
  187. package/dist/index-ChKhFyp8.js +0 -40
  188. package/dist/index-ChKhFyp8.js.map +0 -1
  189. package/dist/styles.module-DZXAP_eP.js +0 -8
  190. package/dist/styles.module-DZXAP_eP.js.map +0 -1
  191. package/dist/styles.module-Vt6mmlsz.cjs +0 -2
  192. package/dist/styles.module-Vt6mmlsz.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n aria-hidden='true'\n name='updown'\n variant='primary'\n />\n </span>\n );\n }\n\n return nextProps || nextChildren !== child.props.children\n ? cloneElement(child, nextProps, nextChildren)\n : child;\n });\n\n/**\n * Sortable columns must provide data-type (text, number, or date) in the `th` element.\n */\n\nconst compare = (a: string, b: string, type: SortType, locale?: string | string[], dir = 1) => {\n if (type === 'text') {\n return a.localeCompare(b, locale, { sensitivity: 'base' }) * dir;\n }\n\n const left = type === 'date' ? Date.parse(a) : Number.parseFloat(a);\n const right = type === 'date' ? Date.parse(b) : Number.parseFloat(b);\n\n if (Number.isNaN(left) && Number.isNaN(right)) return 0;\n if (Number.isNaN(left)) return 1;\n if (Number.isNaN(right)) return -1;\n return (left - right) * dir;\n};\n\nexport const Table = ({ children, locale, ...props }: TableProps) => {\n const ref = useRef<HTMLTableElement | null>(null);\n const columnCount = getFirstRowCellCount(children);\n const normalizedChildren =\n columnCount && columnCount > 0 ? normalizeChildren(children, columnCount) : children;\n\n const setSortState = (\n thead: HTMLTableSectionElement,\n active: HTMLTableCellElement,\n dir: 'asc' | 'desc'\n ) => {\n const ths = thead.querySelectorAll<HTMLTableCellElement>('th[data-type]');\n\n ths.forEach((th) => {\n if (th === active) {\n th.dataset.dir = dir;\n th.setAttribute('aria-sort', dir === 'asc' ? 'ascending' : 'descending');\n } else {\n delete th.dataset.dir;\n th.setAttribute('aria-sort', 'none');\n }\n });\n };\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLTableElement>) => {\n const table = ref.current;\n if (!table) return;\n\n const th = (e.target as HTMLElement | null)?.closest('th');\n if (!th) return;\n\n const thead = table.tHead;\n if (!thead || !thead.contains(th)) return;\n\n const col = th.cellIndex;\n if (col < 0) return;\n\n const tbody = table.tBodies?.[0];\n if (!tbody) return;\n\n const type = th.getAttribute('data-type') as SortType | null;\n if (!type) return;\n\n const direction = th.dataset.dir === 'asc' ? 'desc' : 'asc';\n setSortState(thead, th, direction);\n const dir = direction === 'asc' ? 1 : -1;\n\n const rows = Array.from(tbody.rows);\n\n rows.sort((a, b) => {\n const av = (a.cells[col]?.textContent ?? '').trim();\n const bv = (b.cells[col]?.textContent ?? '').trim();\n return compare(av, bv, type, locale, dir);\n });\n\n tbody.append(...rows);\n },\n [locale]\n );\n\n return (\n <table\n className={styles.table}\n onClick={onClick}\n ref={ref}\n {...props}\n >\n {normalizedChildren}\n </table>\n );\n};\n"],"names":["isTableElement","child","isValidElement","countCells","children","Children","toArray","reduce","count","type","props","getFirstRowCellCount","nestedCount","normalizeChildren","columnCount","map","nextChildren","undefined","nextProps","colSpan","jsxs","styles","sortable","Icon","cloneElement","compare","a","b","locale","dir","localeCompare","sensitivity","left","Date","parse","Number","parseFloat","right","isNaN","Table","ref","useRef","normalizedChildren","setSortState","thead","active","ths","querySelectorAll","forEach","th","dataset","setAttribute","onClick","useCallback","e","table","current","target","closest","tHead","contains","col","cellIndex","tbody","tBodies","getAttribute","direction","rows","Array","from","sort","av","cells","textContent","trim","bv","append","jsx"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/table/index.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, useCallback, useRef } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {\n children?: React.ReactNode;\n locale?: string | string[];\n};\n\ntype SortType = 'date' | 'number' | 'text';\n\ntype TableChildProps = {\n children?: React.ReactNode;\n colSpan?: number;\n 'data-span'?: string;\n 'data-type'?: SortType;\n};\n\nconst isTableElement = (child: React.ReactNode): child is React.ReactElement<TableChildProps> =>\n isValidElement<TableChildProps>(child);\n\nconst countCells = (children: React.ReactNode): number =>\n Children.toArray(children).reduce<number>((count, child) => {\n if (!isTableElement(child)) return count;\n return (\n count + (child.type === 'td' || child.type === 'th' ? 1 : countCells(child.props.children))\n );\n }, 0);\n\nconst getFirstRowCellCount = (children: React.ReactNode): number | null => {\n for (const child of Children.toArray(children)) {\n if (!isTableElement(child)) continue;\n\n if (child.type === 'tr') return countCells(child.props.children);\n\n const nestedCount = getFirstRowCellCount(child.props.children);\n if (nestedCount !== null) return nestedCount;\n }\n\n return null;\n};\n\nconst normalizeChildren = (children: React.ReactNode, columnCount: number): React.ReactNode =>\n Children.map(children, (child) => {\n if (!isTableElement(child)) return child;\n\n let nextChildren =\n child.props.children === undefined\n ? child.props.children\n : normalizeChildren(child.props.children, columnCount);\n let nextProps: Partial<TableChildProps> | undefined;\n\n if (child.type === 'td' && child.props['data-span'] === 'all') {\n nextProps = { colSpan: columnCount };\n }\n\n if (child.type === 'th' && child.props['data-type']) {\n nextChildren = (\n <span className={styles.sortable}>\n {nextChildren}\n <Icon\n name='updown'\n variant='primary'\n />\n </span>\n );\n }\n\n return nextProps || nextChildren !== child.props.children\n ? cloneElement(child, nextProps, nextChildren)\n : child;\n });\n\n/**\n * Sortable columns must provide data-type (text, number, or date) in the `th` element.\n */\n\nconst compare = (a: string, b: string, type: SortType, locale?: string | string[], dir = 1) => {\n if (type === 'text') {\n return a.localeCompare(b, locale, { sensitivity: 'base' }) * dir;\n }\n\n const left = type === 'date' ? Date.parse(a) : Number.parseFloat(a);\n const right = type === 'date' ? Date.parse(b) : Number.parseFloat(b);\n\n if (Number.isNaN(left) && Number.isNaN(right)) return 0;\n if (Number.isNaN(left)) return 1;\n if (Number.isNaN(right)) return -1;\n return (left - right) * dir;\n};\n\nexport const Table = ({ children, locale, ...props }: TableProps) => {\n const ref = useRef<HTMLTableElement | null>(null);\n const columnCount = getFirstRowCellCount(children);\n const normalizedChildren =\n columnCount && columnCount > 0 ? normalizeChildren(children, columnCount) : children;\n\n const setSortState = (\n thead: HTMLTableSectionElement,\n active: HTMLTableCellElement,\n dir: 'asc' | 'desc'\n ) => {\n const ths = thead.querySelectorAll<HTMLTableCellElement>('th[data-type]');\n\n ths.forEach((th) => {\n if (th === active) {\n th.dataset.dir = dir;\n th.setAttribute('aria-sort', dir === 'asc' ? 'ascending' : 'descending');\n } else {\n delete th.dataset.dir;\n th.setAttribute('aria-sort', 'none');\n }\n });\n };\n\n const onClick = useCallback(\n (e: React.MouseEvent<HTMLTableElement>) => {\n const table = ref.current;\n if (!table) return;\n\n const th = (e.target as HTMLElement | null)?.closest('th');\n if (!th) return;\n\n const thead = table.tHead;\n if (!thead || !thead.contains(th)) return;\n\n const col = th.cellIndex;\n if (col < 0) return;\n\n const tbody = table.tBodies?.[0];\n if (!tbody) return;\n\n const type = th.getAttribute('data-type') as SortType | null;\n if (!type) return;\n\n const direction = th.dataset.dir === 'asc' ? 'desc' : 'asc';\n setSortState(thead, th, direction);\n const dir = direction === 'asc' ? 1 : -1;\n\n const rows = Array.from(tbody.rows);\n\n rows.sort((a, b) => {\n const av = (a.cells[col]?.textContent ?? '').trim();\n const bv = (b.cells[col]?.textContent ?? '').trim();\n return compare(av, bv, type, locale, dir);\n });\n\n tbody.append(...rows);\n },\n [locale]\n );\n\n return (\n <table\n className={styles.table}\n onClick={onClick}\n ref={ref}\n {...props}\n >\n {normalizedChildren}\n </table>\n );\n};\n"],"names":["isTableElement","child","isValidElement","countCells","children","Children","toArray","reduce","count","type","props","getFirstRowCellCount","nestedCount","normalizeChildren","columnCount","map","nextChildren","undefined","nextProps","colSpan","jsxs","styles","sortable","jsx","Icon","cloneElement","compare","a","b","locale","dir","localeCompare","sensitivity","left","Date","parse","Number","parseFloat","right","isNaN","Table","ref","useRef","normalizedChildren","setSortState","thead","active","ths","querySelectorAll","forEach","th","dataset","setAttribute","onClick","useCallback","e","table","current","target","closest","tHead","contains","col","cellIndex","tbody","tBodies","getAttribute","direction","rows","Array","from","sort","av","cells","textContent","trim","bv","append"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const e=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),x=require("../../utils-DBzf7CFq.cjs"),l=require("../../styles.module-Vt6mmlsz.cjs"),d="_textarea_b5yys_5",y={textarea:d},m=({label:t,maxRows:r=12,minRows:a=3,required:n,value:s,...o})=>{const{touched:c,onBlur:u}=x.useTouched(s==="");return e.jsxs("label",{"data-component":"textarea",children:[t&&e.jsx("span",{children:t}),e.jsx("textarea",{className:i.t(l.inputStyles.input,y.textarea,c&&"touched"),onBlur:u,...o,required:n,style:{"--min-rows":a,"--max-rows":r},value:s})]})};exports.Textarea=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const e=require("react/jsx-runtime"),n=require("../../classix-5H4IWnMA.cjs"),x=require("../../utils-DBzf7CFq.cjs"),t=require("../../styles.module-BPvMQa_x.cjs"),d="_textarea_19s8w_5",m={textarea:d},y=({label:s,maxRows:o=12,minRows:c=3,required:r,value:a,...u})=>{const{touched:i,onBlur:l}=x.useTouched(a==="");return e.jsxs("label",{"data-component":"textarea",children:[s&&e.jsx("span",{className:n.t(r&&t.inputStyles.required),children:s}),e.jsx("textarea",{className:n.t(t.inputStyles.input,m.textarea,i&&t.inputStyles.touched),onBlur:l,...u,required:r,style:{"--min-rows":c,"--max-rows":o},value:a})]})};exports.Textarea=y;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && 'touched')}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":"sRAaaA,EAAWA,CAAC,CACvBC,MAAAA,EACAC,QAAAA,EAAU,GACVC,QAAAA,EAAU,EACVC,SAAAA,EACAC,MAAAA,EACA,GAAGC,CACU,IAAM,CACnB,KAAM,CAAEC,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAEnD,OACEK,EAAAA,KAAC,QAAA,CAAK,iBAAA,WACHT,SAAAA,CAAAA,GAASU,EAAAA,IAAC,QAAMV,SAAAA,CAAAA,CAAM,EACvBU,EAAAA,IAAC,WAAA,CACC,UAAWC,EAAAA,EAAGC,EAAAA,YAAYC,MAAOC,EAAOC,SAAUT,GAAW,SAAS,EACtE,OAAAC,KACIF,EACJ,SAAAF,EACA,MACE,CACE,aAAcD,EACd,aAAcD,CAAAA,EAGlB,MAAAG,CAAA,CAAa,CAAA,EAEjB,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && inputStyles.touched)}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":"sRAaaA,EAAWA,CAAC,CACvBC,MAAAA,EACAC,QAAAA,EAAU,GACVC,QAAAA,EAAU,EACVC,SAAAA,EACAC,MAAAA,EACA,GAAGC,CACU,IAAM,CACnB,KAAM,CAAEC,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAEnD,OACEK,EAAAA,KAAC,QAAA,CAAK,iBAAA,WACHT,SAAAA,CAAAA,GAASU,EAAAA,IAAC,QAAK,UAAWC,EAAAA,EAAGR,GAAYS,EAAAA,YAAYT,QAAQ,EAAIH,SAAAA,CAAAA,CAAM,QACvE,WAAA,CACC,UAAWW,EAAAA,EAAGC,EAAAA,YAAYC,MAAOC,EAAOC,SAAUT,GAAWM,EAAAA,YAAYN,OAAO,EAChF,OAAAC,EACA,GAAIF,EACJ,SAAAF,EACA,MACE,CACE,aAAcD,EACd,aAAcD,CAAAA,EAGlB,MAAAG,CAAA,CAAa,CAAA,EAEjB,CAEJ"}
@@ -1,30 +1,30 @@
1
- import { jsxs as x, jsx as r } from "react/jsx-runtime";
2
- import { t as i } from "../../classix-DG18itHa.js";
3
- import { u as p } from "../../utils--n2yqjCy.js";
4
- import { i as u } from "../../styles.module-DZXAP_eP.js";
5
- import '../../assets/index42.css';const d = "_textarea_b5yys_5", l = {
6
- textarea: d
7
- }, j = ({
8
- label: t,
9
- maxRows: a = 12,
10
- minRows: o = 3,
11
- required: s,
12
- value: e,
13
- ...n
1
+ import { jsxs as p, jsx as s } from "react/jsx-runtime";
2
+ import { t as o } from "../../classix-DG18itHa.js";
3
+ import { u } from "../../utils--n2yqjCy.js";
4
+ import { i as t } from "../../styles.module-BOTEBJ0C.js";
5
+ import '../../assets/index42.css';const l = "_textarea_19s8w_5", d = {
6
+ textarea: l
7
+ }, _ = ({
8
+ label: e,
9
+ maxRows: n = 12,
10
+ minRows: m = 3,
11
+ required: a,
12
+ value: r,
13
+ ...c
14
14
  }) => {
15
15
  const {
16
- touched: m,
17
- onBlur: c
18
- } = p(e === "");
19
- return /* @__PURE__ */ x("label", { "data-component": "textarea", children: [
20
- t && /* @__PURE__ */ r("span", { children: t }),
21
- /* @__PURE__ */ r("textarea", { className: i(u.input, l.textarea, m && "touched"), onBlur: c, ...n, required: s, style: {
22
- "--min-rows": o,
23
- "--max-rows": a
24
- }, value: e })
16
+ touched: x,
17
+ onBlur: i
18
+ } = u(r === "");
19
+ return /* @__PURE__ */ p("label", { "data-component": "textarea", children: [
20
+ e && /* @__PURE__ */ s("span", { className: o(a && t.required), children: e }),
21
+ /* @__PURE__ */ s("textarea", { className: o(t.input, d.textarea, x && t.touched), onBlur: i, ...c, required: a, style: {
22
+ "--min-rows": m,
23
+ "--max-rows": n
24
+ }, value: r })
25
25
  ] });
26
26
  };
27
27
  export {
28
- j as Textarea
28
+ _ as Textarea
29
29
  };
30
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && 'touched')}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":";;;;;;GAaaA,IAAWA,CAAC;AAAA,EACvBC,OAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,SAAAA,IAAU;AAAA,EACVC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACA,GAAGC;AACU,MAAM;AACnB,QAAM;AAAA,IAAEC,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE;AAEnD,SACE,gBAAAK,EAAC,SAAA,EAAK,kBAAA,YACHT,UAAAA;AAAAA,IAAAA,KAAS,gBAAAU,EAAC,UAAMV,UAAAA,EAAAA,CAAM;AAAA,IACvB,gBAAAU,EAAC,YAAA,EACC,WAAWC,EAAGC,EAAYC,OAAOC,EAAOC,UAAUT,KAAW,SAAS,GACtE,QAAAC,MACIF,GACJ,UAAAF,GACA,OACE;AAAA,MACE,cAAcD;AAAAA,MACd,cAAcD;AAAAA,IAAAA,GAGlB,OAAAG,EAAA,CAAa;AAAA,EAAA,GAEjB;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && inputStyles.touched)}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","inputStyles","input","styles","textarea"],"mappings":";;;;;;GAaaA,IAAWA,CAAC;AAAA,EACvBC,OAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,SAAAA,IAAU;AAAA,EACVC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACA,GAAGC;AACU,MAAM;AACnB,QAAM;AAAA,IAAEC,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE;AAEnD,SACE,gBAAAK,EAAC,SAAA,EAAK,kBAAA,YACHT,UAAAA;AAAAA,IAAAA,KAAS,gBAAAU,EAAC,UAAK,WAAWC,EAAGR,KAAYS,EAAYT,QAAQ,GAAIH,UAAAA,EAAAA,CAAM;AAAA,sBACvE,YAAA,EACC,WAAWW,EAAGC,EAAYC,OAAOC,EAAOC,UAAUT,KAAWM,EAAYN,OAAO,GAChF,QAAAC,GACA,GAAIF,GACJ,UAAAF,GACA,OACE;AAAA,MACE,cAAcD;AAAAA,MACd,cAAcD;AAAAA,IAAAA,GAGlB,OAAAG,EAAA,CAAa;AAAA,EAAA,GAEjB;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index43.css');const o=require("react/jsx-runtime"),v=require("../../classix-5H4IWnMA.cjs"),n=require("react"),f=require("../icon/index.cjs"),l="_toast_tav58_1",d="_active_tav58_18",m="_error_tav58_24",q="_info_tav58_28",T="_success_tav58_33",a={toast:l,active:d,error:m,info:q,success:T},g=({label:i,type:s="success",onClick:u,onExitComplete:e,open:r=!0})=>{const[_,c]=n.useState(!1);return n.useEffect(()=>{if(!r)return c(!1);const t=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(t)},[r]),o.jsxs("div",{"aria-live":s==="error"?"assertive":"polite",className:v.t(a.toast,a[s],_&&a.active),onClick:u,onTransitionEnd:t=>{r||t.propertyName!=="opacity"||t.currentTarget!==t.target||e==null||e()},"data-component":"toast",children:[o.jsx(f.Icon,{name:s}),i]})};exports.Toast=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index43.css');const o=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),n=require("react"),q=require("../icon/index.cjs"),d="_toast_12yql_1",f="_active_12yql_21",m="_error_12yql_27",y="_success_12yql_36",c={toast:d,active:f,error:m,success:y},v=({label:i,type:t="success",onClick:u,onExitComplete:e,open:r=!0})=>{const[_,a]=n.useState(!1);return n.useEffect(()=>{if(!r)return a(!1);const s=requestAnimationFrame(()=>a(!0));return()=>cancelAnimationFrame(s)},[r]),o.jsxs("div",{"aria-live":t==="error"?"assertive":"polite",className:l.t(c.toast,c[t],_&&c.active),onClick:u,onTransitionEnd:s=>{r||s.propertyName!=="opacity"||s.currentTarget!==s.target||e==null||e()},"data-component":"toast",children:[o.jsx(q.Icon,{name:t}),i]})};exports.Toast=v;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/toast/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type ToastOptions = {\n durationMs?: number;\n label: string;\n type?: 'error' | 'info' | 'success';\n};\n\nexport type ToastProps = ToastOptions & {\n onClick?: () => void;\n onExitComplete?: () => void;\n open?: boolean;\n};\n\nexport const Toast = ({\n label,\n type = 'success',\n onClick,\n onExitComplete,\n open = true,\n}: ToastProps) => {\n const [show, setShow] = useState(false);\n\n useEffect(() => {\n if (!open) return setShow(false);\n\n const enter = requestAnimationFrame(() => setShow(true));\n return () => cancelAnimationFrame(enter);\n }, [open]);\n\n return (\n <div\n aria-live={type === 'error' ? 'assertive' : 'polite'}\n className={cx(styles.toast, styles[type], show && styles.active)}\n onClick={onClick}\n onTransitionEnd={(event) => {\n if (open || event.propertyName !== 'opacity' || event.currentTarget !== event.target)\n return;\n onExitComplete?.();\n }}\n >\n <Icon name={type} />\n {label}\n </div>\n );\n};\n"],"names":["Toast","label","type","onClick","onExitComplete","open","show","setShow","useState","useEffect","enter","requestAnimationFrame","cancelAnimationFrame","jsxs","cx","styles","toast","active","event","propertyName","currentTarget","target","jsx","Icon"],"mappings":"kWAkBaA,EAAQA,CAAC,CACpBC,MAAAA,EACAC,KAAAA,EAAO,UACPC,QAAAA,EACAC,eAAAA,EACAC,KAAAA,EAAO,EACG,IAAM,CAChB,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAEtCC,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAI,CAACJ,EAAM,OAAOE,EAAQ,EAAK,EAE/B,MAAMG,EAAQC,sBAAsB,IAAMJ,EAAQ,EAAI,CAAC,EACvD,MAAO,IAAMK,qBAAqBF,CAAK,CACzC,EAAG,CAACL,CAAI,CAAC,EAGPQ,EAAAA,KAAC,OACC,YAAWX,IAAS,QAAU,YAAc,SAC5C,UAAWY,IAAGC,EAAOC,MAAOD,EAAOb,CAAI,EAAGI,GAAQS,EAAOE,MAAM,EAC/D,QAAAd,EACA,gBAAkBe,GAAU,CACtBb,GAAQa,EAAMC,eAAiB,WAAaD,EAAME,gBAAkBF,EAAMG,QAE9EjB,GAAAA,MAAAA,GACF,EAAE,iBAAA,QAEF,SAAA,CAAAkB,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMrB,CAAAA,CAAK,EAChBD,CAAAA,EACH,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/toast/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type ToastOptions = {\n durationMs?: number;\n label: string;\n type?: 'error' | 'success';\n};\n\nexport type ToastProps = ToastOptions & {\n onClick?: () => void;\n onExitComplete?: () => void;\n open?: boolean;\n};\n\nexport const Toast = ({\n label,\n type = 'success',\n onClick,\n onExitComplete,\n open = true,\n}: ToastProps) => {\n const [show, setShow] = useState(false);\n\n useEffect(() => {\n if (!open) return setShow(false);\n\n const enter = requestAnimationFrame(() => setShow(true));\n return () => cancelAnimationFrame(enter);\n }, [open]);\n\n return (\n <div\n aria-live={type === 'error' ? 'assertive' : 'polite'}\n className={cx(styles.toast, styles[type], show && styles.active)}\n onClick={onClick}\n onTransitionEnd={(event) => {\n if (open || event.propertyName !== 'opacity' || event.currentTarget !== event.target)\n return;\n onExitComplete?.();\n }}\n >\n <Icon name={type} />\n {label}\n </div>\n );\n};\n"],"names":["Toast","label","type","onClick","onExitComplete","open","show","setShow","useState","useEffect","enter","requestAnimationFrame","cancelAnimationFrame","jsxs","cx","styles","toast","active","event","propertyName","currentTarget","target","jsx","Icon"],"mappings":"wUAkBaA,EAAQA,CAAC,CACpBC,MAAAA,EACAC,KAAAA,EAAO,UACPC,QAAAA,EACAC,eAAAA,EACAC,KAAAA,EAAO,EACG,IAAM,CAChB,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAEtCC,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAI,CAACJ,EAAM,OAAOE,EAAQ,EAAK,EAE/B,MAAMG,EAAQC,sBAAsB,IAAMJ,EAAQ,EAAI,CAAC,EACvD,MAAO,IAAMK,qBAAqBF,CAAK,CACzC,EAAG,CAACL,CAAI,CAAC,EAGPQ,EAAAA,KAAC,OACC,YAAWX,IAAS,QAAU,YAAc,SAC5C,UAAWY,IAAGC,EAAOC,MAAOD,EAAOb,CAAI,EAAGI,GAAQS,EAAOE,MAAM,EAC/D,QAAAd,EACA,gBAAkBe,GAAU,CACtBb,GAAQa,EAAMC,eAAiB,WAAaD,EAAME,gBAAkBF,EAAMG,QAE9EjB,GAAAA,MAAAA,GACF,EAAE,iBAAA,QAEF,SAAA,CAAAkB,EAAAA,IAACC,EAAAA,KAAA,CAAK,KAAMrB,CAAAA,CAAK,EAChBD,CAAAA,EACH,CAEJ"}
@@ -1,33 +1,32 @@
1
- import { jsxs as _, jsx as u } from "react/jsx-runtime";
2
- import { t as f } from "../../classix-DG18itHa.js";
3
- import { useState as m, useEffect as v } from "react";
4
- import { Icon as d } from "../icon/index.js";
5
- import '../../assets/index43.css';const l = "_toast_tav58_1", h = "_active_tav58_18", T = "_error_tav58_24", g = "_info_tav58_28", j = "_success_tav58_33", o = {
6
- toast: l,
7
- active: h,
8
- error: T,
9
- info: g,
10
- success: j
11
- }, N = ({
12
- label: c,
13
- type: r = "success",
1
+ import { jsxs as u, jsx as m } from "react/jsx-runtime";
2
+ import { t as _ } from "../../classix-DG18itHa.js";
3
+ import { useState as f, useEffect as l } from "react";
4
+ import { Icon as q } from "../icon/index.js";
5
+ import '../../assets/index43.css';const v = "_toast_12yql_1", y = "_active_12yql_21", d = "_error_12yql_27", h = "_success_12yql_36", e = {
6
+ toast: v,
7
+ active: y,
8
+ error: d,
9
+ success: h
10
+ }, w = ({
11
+ label: o,
12
+ type: s = "success",
14
13
  onClick: n,
15
- onExitComplete: s,
14
+ onExitComplete: t,
16
15
  open: a = !0
17
16
  }) => {
18
- const [i, e] = m(!1);
19
- return v(() => {
20
- if (!a) return e(!1);
21
- const t = requestAnimationFrame(() => e(!0));
22
- return () => cancelAnimationFrame(t);
23
- }, [a]), /* @__PURE__ */ _("div", { "aria-live": r === "error" ? "assertive" : "polite", className: f(o.toast, o[r], i && o.active), onClick: n, onTransitionEnd: (t) => {
24
- a || t.propertyName !== "opacity" || t.currentTarget !== t.target || s == null || s();
17
+ const [i, c] = f(!1);
18
+ return l(() => {
19
+ if (!a) return c(!1);
20
+ const r = requestAnimationFrame(() => c(!0));
21
+ return () => cancelAnimationFrame(r);
22
+ }, [a]), /* @__PURE__ */ u("div", { "aria-live": s === "error" ? "assertive" : "polite", className: _(e.toast, e[s], i && e.active), onClick: n, onTransitionEnd: (r) => {
23
+ a || r.propertyName !== "opacity" || r.currentTarget !== r.target || t == null || t();
25
24
  }, "data-component": "toast", children: [
26
- /* @__PURE__ */ u(d, { name: r }),
27
- c
25
+ /* @__PURE__ */ m(q, { name: s }),
26
+ o
28
27
  ] });
29
28
  };
30
29
  export {
31
- N as Toast
30
+ w as Toast
32
31
  };
33
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/toast/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type ToastOptions = {\n durationMs?: number;\n label: string;\n type?: 'error' | 'info' | 'success';\n};\n\nexport type ToastProps = ToastOptions & {\n onClick?: () => void;\n onExitComplete?: () => void;\n open?: boolean;\n};\n\nexport const Toast = ({\n label,\n type = 'success',\n onClick,\n onExitComplete,\n open = true,\n}: ToastProps) => {\n const [show, setShow] = useState(false);\n\n useEffect(() => {\n if (!open) return setShow(false);\n\n const enter = requestAnimationFrame(() => setShow(true));\n return () => cancelAnimationFrame(enter);\n }, [open]);\n\n return (\n <div\n aria-live={type === 'error' ? 'assertive' : 'polite'}\n className={cx(styles.toast, styles[type], show && styles.active)}\n onClick={onClick}\n onTransitionEnd={(event) => {\n if (open || event.propertyName !== 'opacity' || event.currentTarget !== event.target)\n return;\n onExitComplete?.();\n }}\n >\n <Icon name={type} />\n {label}\n </div>\n );\n};\n"],"names":["Toast","label","type","onClick","onExitComplete","open","show","setShow","useState","useEffect","enter","requestAnimationFrame","cancelAnimationFrame","jsxs","cx","styles","toast","active","event","propertyName","currentTarget","target","jsx","Icon"],"mappings":";;;;;;;;;;GAkBaA,IAAQA,CAAC;AAAA,EACpBC,OAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,SAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,MAAAA,IAAO;AACG,MAAM;AAChB,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAS,EAAK;AAEtCC,SAAAA,EAAU,MAAM;AACd,QAAI,CAACJ,EAAM,QAAOE,EAAQ,EAAK;AAE/B,UAAMG,IAAQC,sBAAsB,MAAMJ,EAAQ,EAAI,CAAC;AACvD,WAAO,MAAMK,qBAAqBF,CAAK;AAAA,EACzC,GAAG,CAACL,CAAI,CAAC,GAGP,gBAAAQ,EAAC,SACC,aAAWX,MAAS,UAAU,cAAc,UAC5C,WAAWY,EAAGC,EAAOC,OAAOD,EAAOb,CAAI,GAAGI,KAAQS,EAAOE,MAAM,GAC/D,SAAAd,GACA,iBAAkBe,CAAAA,MAAU;AAC1B,IAAIb,KAAQa,EAAMC,iBAAiB,aAAaD,EAAME,kBAAkBF,EAAMG,UAE9EjB,KAAAA,QAAAA;AAAAA,EACF,GAAE,kBAAA,SAEF,UAAA;AAAA,IAAA,gBAAAkB,EAACC,GAAA,EAAK,MAAMrB,EAAAA,CAAK;AAAA,IAChBD;AAAAA,EAAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/toast/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type ToastOptions = {\n durationMs?: number;\n label: string;\n type?: 'error' | 'success';\n};\n\nexport type ToastProps = ToastOptions & {\n onClick?: () => void;\n onExitComplete?: () => void;\n open?: boolean;\n};\n\nexport const Toast = ({\n label,\n type = 'success',\n onClick,\n onExitComplete,\n open = true,\n}: ToastProps) => {\n const [show, setShow] = useState(false);\n\n useEffect(() => {\n if (!open) return setShow(false);\n\n const enter = requestAnimationFrame(() => setShow(true));\n return () => cancelAnimationFrame(enter);\n }, [open]);\n\n return (\n <div\n aria-live={type === 'error' ? 'assertive' : 'polite'}\n className={cx(styles.toast, styles[type], show && styles.active)}\n onClick={onClick}\n onTransitionEnd={(event) => {\n if (open || event.propertyName !== 'opacity' || event.currentTarget !== event.target)\n return;\n onExitComplete?.();\n }}\n >\n <Icon name={type} />\n {label}\n </div>\n );\n};\n"],"names":["Toast","label","type","onClick","onExitComplete","open","show","setShow","useState","useEffect","enter","requestAnimationFrame","cancelAnimationFrame","jsxs","cx","styles","toast","active","event","propertyName","currentTarget","target","jsx","Icon"],"mappings":";;;;;;;;;GAkBaA,IAAQA,CAAC;AAAA,EACpBC,OAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,SAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,MAAAA,IAAO;AACG,MAAM;AAChB,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAS,EAAK;AAEtCC,SAAAA,EAAU,MAAM;AACd,QAAI,CAACJ,EAAM,QAAOE,EAAQ,EAAK;AAE/B,UAAMG,IAAQC,sBAAsB,MAAMJ,EAAQ,EAAI,CAAC;AACvD,WAAO,MAAMK,qBAAqBF,CAAK;AAAA,EACzC,GAAG,CAACL,CAAI,CAAC,GAGP,gBAAAQ,EAAC,SACC,aAAWX,MAAS,UAAU,cAAc,UAC5C,WAAWY,EAAGC,EAAOC,OAAOD,EAAOb,CAAI,GAAGI,KAAQS,EAAOE,MAAM,GAC/D,SAAAd,GACA,iBAAkBe,CAAAA,MAAU;AAC1B,IAAIb,KAAQa,EAAMC,iBAAiB,aAAaD,EAAME,kBAAkBF,EAAMG,UAE9EjB,KAAAA,QAAAA;AAAAA,EACF,GAAE,kBAAA,SAEF,UAAA;AAAA,IAAA,gBAAAkB,EAACC,GAAA,EAAK,MAAMrB,EAAAA,CAAK;AAAA,IAChBD;AAAAA,EAAAA,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index2.css');const t=require("react/jsx-runtime"),g=require("../loading/index.cjs"),i="_toggle_1rg2x_1",d="_thumb_1rg2x_15",u="_track_1rg2x_25",e={toggle:i,thumb:d,track:u},m=({checked:s,disabled:c,isLoading:o,label:n,onChange:a})=>{const l=s!==void 0&&a===void 0;return t.jsxs("label",{className:e.toggle,onClick:r=>r.stopPropagation(),"data-component":"toggle",children:[t.jsx("input",{checked:s,disabled:c||o,onChange:a,readOnly:l,type:"checkbox"}),t.jsx("span",{"aria-hidden":"true",className:e.track,children:o?t.jsx(g.Loading,{size:24}):t.jsx("span",{className:e.thumb})}),n&&t.jsx("span",{className:"toggle",children:n})]})};exports.Toggle=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index2.css');const t=require("react/jsx-runtime"),i=require("../loading/index.cjs"),g="_toggle_81frv_1",d="_thumb_81frv_15",u="_track_81frv_26",e={toggle:g,thumb:d,track:u},m=({checked:s,disabled:c,isLoading:o,label:n,onChange:a})=>{const l=s!==void 0&&a===void 0;return t.jsxs("label",{className:e.toggle,onClick:r=>r.stopPropagation(),"data-component":"toggle",children:[t.jsx("input",{checked:s,disabled:c||o,onChange:a,readOnly:l,type:"checkbox"}),t.jsx("span",{"aria-hidden":"true",className:e.track,children:o?t.jsx(i.Loading,{size:24}):t.jsx("span",{className:e.thumb})}),n&&t.jsx("span",{className:"toggle",children:n})]})};exports.Toggle=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
2
  import { Loading as i } from "../loading/index.js";
3
- import '../../assets/index2.css';const m = "_toggle_1rg2x_1", d = "_thumb_1rg2x_15", p = "_track_1rg2x_25", o = {
3
+ import '../../assets/index2.css';const m = "_toggle_81frv_1", d = "_thumb_81frv_15", p = "_track_81frv_26", o = {
4
4
  toggle: m,
5
5
  thumb: d,
6
6
  track: p
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index44.css');const a=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),s="_toolbar_kuorz_1",n="_editor_kuorz_33",o={toolbar:s,default:"_default_kuorz_26",editor:n},i=({children:t,variant:r="default"})=>a.jsx("div",{className:l.t(o.toolbar,o[r]),onClick:e=>e.stopPropagation(),"data-component":"toolbar",children:t});exports.Toolbar=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index44.css');const s=require("react/jsx-runtime"),a=require("../../classix-5H4IWnMA.cjs"),l="_toolbar_ju6sc_1",c="_editor_ju6sc_33",o={toolbar:l,default:"_default_ju6sc_26",editor:c},n=({children:t,variant:e="default"})=>s.jsx("div",{className:a.t(o.toolbar,o[e]),onClick:r=>r.stopPropagation(),"data-component":"toolbar",children:t});exports.Toolbar=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,14 +1,14 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { t as e } from "../../classix-DG18itHa.js";
3
- import '../../assets/index44.css';const s = "_toolbar_kuorz_1", n = "_editor_kuorz_33", o = {
4
- toolbar: s,
5
- default: "_default_kuorz_26",
6
- editor: n
7
- }, i = ({
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { t as l } from "../../classix-DG18itHa.js";
3
+ import '../../assets/index44.css';const e = "_toolbar_ju6sc_1", c = "_editor_ju6sc_33", o = {
4
+ toolbar: e,
5
+ default: "_default_ju6sc_26",
6
+ editor: c
7
+ }, d = ({
8
8
  children: t,
9
9
  variant: r = "default"
10
- }) => /* @__PURE__ */ l("div", { className: e(o.toolbar, o[r]), onClick: (a) => a.stopPropagation(), "data-component": "toolbar", children: t });
10
+ }) => /* @__PURE__ */ s("div", { className: l(o.toolbar, o[r]), onClick: (a) => a.stopPropagation(), "data-component": "toolbar", children: t });
11
11
  export {
12
- i as Toolbar
12
+ d as Toolbar
13
13
  };
14
14
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,42 @@
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { t as l } from "./classix-DG18itHa.js";
3
+ import { i as b } from "./icons-DfmpRbxE.js";
4
+ import { u as _, r as f } from "./utils--n2yqjCy.js";
5
+ import './assets/index41.css';const v = /* @__PURE__ */ new Set(["aria-activedescendant", "aria-autocomplete", "aria-busy", "aria-controls", "aria-describedby", "aria-details", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-required", "aria-roledescription", "autoComplete", "autoFocus", "className", "defaultValue", "dir", "disabled", "form", "id", "multiple", "name", "onBlur", "onChange", "onClick", "onFocus", "onInput", "onInvalid", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", "required", "role", "size", "style", "tabIndex", "title", "value"]);
6
+ function y(r) {
7
+ return Object.fromEntries(Object.entries(r).filter(([e]) => e.startsWith("data-") || e.startsWith("aria-") || v.has(e)));
8
+ }
9
+ const q = "_select_8a7r8_1", w = "_touched_8a7r8_25", S = "_label_8a7r8_31", x = "_required_8a7r8_35", a = {
10
+ select: q,
11
+ touched: w,
12
+ label: S,
13
+ required: x
14
+ }, D = ({
15
+ children: r,
16
+ label: e,
17
+ placeholder: o,
18
+ ...t
19
+ }) => {
20
+ const {
21
+ touched: c,
22
+ onBlur: d
23
+ } = _(t.value === ""), u = y(t), {
24
+ style: m,
25
+ ...h
26
+ } = u, p = {
27
+ ...m,
28
+ "--icon-svg": b("chevron").replace("currentColor", f("--colors-semantic-content-secondary"))
29
+ }, s = /* @__PURE__ */ i("select", { className: l(a.select, c && a.touched), onBlur: d, style: p, ...h, children: [
30
+ o && /* @__PURE__ */ n("option", { value: "", hidden: !0, children: o }, "placeholder"),
31
+ r
32
+ ] });
33
+ return e ? /* @__PURE__ */ i("label", { "data-component": "select", children: [
34
+ /* @__PURE__ */ n("span", { className: l(a.label, t.required && a.required), children: e }),
35
+ s
36
+ ] }) : s;
37
+ };
38
+ export {
39
+ D as S,
40
+ y as s
41
+ };
42
+ //# sourceMappingURL=index-CiEbbnD6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CiEbbnD6.js","sources":["../src/components/select/sanitizeSelectProps.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor, useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('chevron').replace(\n 'currentColor',\n resolveColor('--colors-semantic-content-secondary')\n ),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && styles.touched)}\n onBlur={onBlur}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","style","restSelectProps","withVars","iconSVG","replace","resolveColor","selectElement","jsxs","cx","styles","select","jsx","required"],"mappings":";;;;AAAA,MAAMA,IAAa,oBAAIC,IAAI,CACzB,yBACA,qBACA,aACA,iBACA,oBACA,gBACA,iBACA,qBACA,iBACA,iBACA,eACA,gBACA,qBACA,cACA,mBACA,aACA,aACA,iBACA,wBACA,gBACA,aACA,aACA,gBACA,OACA,YACA,QACA,MACA,YACA,QACA,UACA,YACA,WACA,WACA,WACA,aACA,aACA,WACA,eACA,aACA,iBACA,eACA,YACA,QACA,QACA,SACA,YACA,SACA,OAAO,CACR;AAEM,SAASC,EAAuDC,GAAU;AAC/E,SAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,MAAMA,EAAIC,WAAW,OAAO,KAAKD,EAAIC,WAAW,OAAO,KAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF;AACF;;;;;;GCvCaG,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAAOC,aAAAA;AAAAA,EAAa,GAAGX;AAAmB,MAAM;AACjF,QAAM;AAAA,IAAEY,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWd,EAAMe,UAAU,EAAE,GACnDC,IAAcjB,EAAoBC,CAAK,GACvC;AAAA,IAAEiB,OAAAA;AAAAA,IAAO,GAAGC;AAAAA,EAAAA,IAAoBF,GAChCG,IAAW;AAAA,IACf,GAAGF;AAAAA,IACH,cAAcG,EAAQ,SAAS,EAAEC,QAC/B,gBACAC,EAAa,qCAAqC,CACpD;AAAA,EAAA,GAGIC,IACJ,gBAAAC,EAAC,UAAA,EACC,WAAWC,EAAGC,EAAOC,QAAQf,KAAWc,EAAOd,OAAO,GACtD,QAAAC,GACA,OAAOM,GACP,GAAID,GAEHP,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EAEC,OAAO,IACP,QAAM,IAELA,eAJG,aAKN;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAc,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWH,EAAGC,EAAOhB,OAAOV,EAAM6B,YAAYH,EAAOG,QAAQ,GAAInB,UAAAA,EAAAA,CAAM;AAAA,IAC5Ea;AAAAA,EAAAA,GACH,IAPOA;AASX;"}
@@ -0,0 +1,2 @@
1
+ "use strict";require('./assets/index41.css');const t=require("react/jsx-runtime"),n=require("./classix-5H4IWnMA.cjs"),_=require("./icons-C_cX1FYp.cjs"),c=require("./utils-DBzf7CFq.cjs"),q=new Set(["aria-activedescendant","aria-autocomplete","aria-busy","aria-controls","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-required","aria-roledescription","autoComplete","autoFocus","className","defaultValue","dir","disabled","form","id","multiple","name","onBlur","onChange","onClick","onFocus","onInput","onInvalid","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onPointerDown","onPointerUp","required","role","size","style","tabIndex","title","value"]);function l(r){return Object.fromEntries(Object.entries(r).filter(([e])=>e.startsWith("data-")||e.startsWith("aria-")||q.has(e)))}const v="_select_8a7r8_1",y="_touched_8a7r8_25",x="_label_8a7r8_31",j="_required_8a7r8_35",a={select:v,touched:y,label:x,required:j},S=({children:r,label:e,placeholder:o,...s})=>{const{touched:u,onBlur:d}=c.useTouched(s.value===""),h=l(s),{style:p,...b}=h,m={...p,"--icon-svg":_.iconSVG("chevron").replace("currentColor",c.resolveColor("--colors-semantic-content-secondary"))},i=t.jsxs("select",{className:n.t(a.select,u&&a.touched),onBlur:d,style:m,...b,children:[o&&t.jsx("option",{value:"",hidden:!0,children:o},"placeholder"),r]});return e?t.jsxs("label",{"data-component":"select",children:[t.jsx("span",{className:n.t(a.label,s.required&&a.required),children:e}),i]}):i};exports.Select=S;exports.sanitizeSelectProps=l;
2
+ //# sourceMappingURL=index-ClrKYsAQ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ClrKYsAQ.cjs","sources":["../src/components/select/sanitizeSelectProps.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor, useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('chevron').replace(\n 'currentColor',\n resolveColor('--colors-semantic-content-secondary')\n ),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && styles.touched)}\n onBlur={onBlur}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","style","restSelectProps","withVars","iconSVG","replace","resolveColor","selectElement","jsxs","cx","styles","select","jsx","required"],"mappings":"0JAAMA,EAAa,IAAIC,IAAI,CACzB,wBACA,oBACA,YACA,gBACA,mBACA,eACA,gBACA,oBACA,gBACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,uBACA,eACA,YACA,YACA,eACA,MACA,WACA,OACA,KACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,UACA,cACA,YACA,gBACA,cACA,WACA,OACA,OACA,QACA,WACA,QACA,OAAO,CACR,EAEM,SAASC,EAAuDC,EAAU,CAC/E,OAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,IAAMA,EAAIC,WAAW,OAAO,GAAKD,EAAIC,WAAW,OAAO,GAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF,CACF,sICvCaG,EAASA,CAAC,CAAEC,SAAAA,EAAUC,MAAAA,EAAOC,YAAAA,EAAa,GAAGX,CAAmB,IAAM,CACjF,KAAM,CAAEY,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,aAAWd,EAAMe,QAAU,EAAE,EACnDC,EAAcjB,EAAoBC,CAAK,EACvC,CAAEiB,MAAAA,EAAO,GAAGC,CAAAA,EAAoBF,EAChCG,EAAW,CACf,GAAGF,EACH,aAAcG,EAAAA,QAAQ,SAAS,EAAEC,QAC/B,eACAC,EAAAA,aAAa,qCAAqC,CACpD,CAAA,EAGIC,EACJC,EAAAA,KAAC,SAAA,CACC,UAAWC,EAAAA,EAAGC,EAAOC,OAAQf,GAAWc,EAAOd,OAAO,EACtD,OAAAC,EACA,MAAOM,EACP,GAAID,EAEHP,SAAAA,CAAAA,SACE,SAAA,CAEC,MAAO,GACP,OAAM,GAELA,YAJG,aAKN,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHc,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAI,EAAAA,IAAC,OAAA,CAAK,UAAWH,EAAAA,EAAGC,EAAOhB,MAAOV,EAAM6B,UAAYH,EAAOG,QAAQ,EAAInB,SAAAA,CAAAA,CAAM,EAC5Ea,CAAAA,EACH,EAPOA,CASX"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components/_avatar/index.cjs"),n=require("./components/_card/index.cjs"),o=require("./components/_collapsible/index.cjs"),r=require("./components/_croppable/index.cjs"),t=require("./components/_dropdown/index.cjs"),i=require("./components/_dropzone/index.cjs"),s=require("./components/_editor/index.cjs"),c=require("./components/_messages/index.cjs"),_=require("./components/_portal/index.cjs"),a=require("./components/_sortable/index.cjs"),d=require("./components/_toasts/index.cjs"),p=require("./components/_widget/index.cjs"),u=require("./components/accordion/index.cjs"),m=require("./components/app-link/index.cjs"),x=require("./components/aside/index.cjs"),l=require("./components/badge/index.cjs"),q=require("./components/banner/index.cjs"),g=require("./components/branding/index.cjs"),b=require("./components/button/index.cjs"),T=require("./components/checkbox/index.cjs"),L=require("./components/controls/index.cjs"),C=require("./components/dialog/index.cjs"),k=require("./components/figure/index.cjs"),A=require("./components/file/index.cjs"),B=require("./components/footer/index.cjs"),F=require("./components/form/index.cjs"),h=require("./components/graph/index.cjs"),v=require("./components/group/index.cjs"),D=require("./components/header/index.cjs"),I=require("./components/icon/index.cjs"),S=require("./components/image/index.cjs"),f=require("./components/input/index.cjs"),y=require("./components/layout/index.cjs"),M=require("./components/link/index.cjs"),w=require("./components/list/index.cjs"),G=require("./components/loading/index.cjs"),z=require("./components/message/index.cjs"),P=require("./components/nav/index.cjs"),E=require("./index-BpUboRfJ.cjs"),H=require("./components/table/index.cjs"),N=require("./components/textarea/index.cjs"),W=require("./components/toast/index.cjs"),j=require("./components/toggle/index.cjs"),O=require("./components/toolbar/index.cjs");exports.Avatar=e.Avatar;exports.Card=n.Card;exports.Collapsible=o.Collapsible;exports.Croppable=r.Croppable;exports.Dropdown=t.Dropdown;exports.Dropzone=i.Dropzone;exports.Editor=s.Editor;exports.Messages=c.Messages;exports.Portal=_.Portal;exports.Sortable=a.Sortable;exports.Toasts=d.Toasts;exports.Widget=p.Widget;exports.Accordion=u.Accordion;exports.AppLink=m.AppLink;exports.Aside=x.Aside;exports.Badge=l.Badge;exports.Banner=q.Banner;exports.Branding=g.Branding;exports.Button=b.Button;exports.Checkbox=T.Checkbox;exports.Controls=L.Controls;exports.Dialog=C.Dialog;exports.Figure=k.Figure;exports.File=A.File;exports.Footer=B.Footer;exports.Form=F.Form;exports.Graph=h.Graph;exports.Group=v.Group;exports.Header=D.Header;exports.Icon=I.Icon;exports.Image=S.Image;exports.Input=f.Input;exports.Layout=y.Layout;exports.Link=M.Link;exports.List=w.List;exports.Loading=G.Loading;exports.Message=z.Message;exports.Nav=P.Nav;exports.Select=E.Select;exports.Table=H.Table;exports.Textarea=N.Textarea;exports.Toast=W.Toast;exports.Toggle=j.Toggle;exports.Toolbar=O.Toolbar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components/_avatar/index.cjs"),n=require("./components/_card/index.cjs"),o=require("./components/_collapsible/index.cjs"),r=require("./components/_croppable/index.cjs"),t=require("./components/_dropdown/index.cjs"),i=require("./components/_dropzone/index.cjs"),s=require("./components/_editor/index.cjs"),c=require("./components/_messages/index.cjs"),_=require("./components/_portal/index.cjs"),d=require("./components/_sortable/index.cjs"),a=require("./components/_toasts/index.cjs"),p=require("./components/_widget/index.cjs"),u=require("./components/accordion/index.cjs"),m=require("./components/app-link/index.cjs"),x=require("./components/aside/index.cjs"),l=require("./components/badge/index.cjs"),q=require("./components/banner/index.cjs"),g=require("./components/branding/index.cjs"),b=require("./components/button/index.cjs"),T=require("./components/checkbox/index.cjs"),C=require("./components/controls/index.cjs"),k=require("./components/dialog/index.cjs"),L=require("./components/figure/index.cjs"),A=require("./components/file/index.cjs"),B=require("./components/footer/index.cjs"),F=require("./components/form/index.cjs"),h=require("./components/graph/index.cjs"),v=require("./components/group/index.cjs"),D=require("./components/header/index.cjs"),I=require("./components/icon/index.cjs"),S=require("./components/image/index.cjs"),f=require("./components/input/index.cjs"),M=require("./components/link/index.cjs"),j=require("./components/list/index.cjs"),w=require("./components/loading/index.cjs"),G=require("./components/message/index.cjs"),z=require("./components/nav/index.cjs"),O=require("./components/object/index.cjs"),P=require("./index-ClrKYsAQ.cjs"),y=require("./components/table/index.cjs"),E=require("./components/textarea/index.cjs"),H=require("./components/toast/index.cjs"),N=require("./components/toggle/index.cjs"),W=require("./components/toolbar/index.cjs");exports.Avatar=e.Avatar;exports.Card=n.Card;exports.Collapsible=o.Collapsible;exports.Croppable=r.Croppable;exports.Dropdown=t.Dropdown;exports.Dropzone=i.Dropzone;exports.Editor=s.Editor;exports.Messages=c.Messages;exports.Portal=_.Portal;exports.Sortable=d.Sortable;exports.Toasts=a.Toasts;exports.Widget=p.Widget;exports.Accordion=u.Accordion;exports.AppLink=m.AppLink;exports.Aside=x.Aside;exports.Badge=l.Badge;exports.Banner=q.Banner;exports.Branding=g.Branding;exports.Button=b.Button;exports.Checkbox=T.Checkbox;exports.Controls=C.Controls;exports.Dialog=k.Dialog;exports.Figure=L.Figure;exports.File=A.File;exports.Footer=B.Footer;exports.Form=F.Form;exports.Graph=h.Graph;exports.Group=v.Group;exports.Header=D.Header;exports.Icon=I.Icon;exports.Image=S.Image;exports.Input=f.Input;exports.Link=M.Link;exports.List=j.List;exports.Loading=w.Loading;exports.Message=G.Message;exports.Nav=z.Nav;exports.Object=O.Object;exports.Select=P.Select;exports.Table=y.Table;exports.Textarea=E.Textarea;exports.Toast=H.Toast;exports.Toggle=N.Toggle;exports.Toolbar=W.Toolbar;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ChangeEvent } from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
2
3
  import { default as default_2 } from 'react';
3
4
  import { ImgHTMLAttributes } from 'react';
4
5
  import { JSX } from 'react/jsx-runtime';
@@ -29,18 +30,19 @@ declare type AsideProps = {
29
30
  variant?: keyof typeof variants;
30
31
  };
31
32
 
32
- export declare const Avatar: ({ imageUrl, label, link }: AvatarProps) => JSX.Element;
33
+ export declare const Avatar: ({ accessibleLabel, imageUrl, link }: AvatarProps) => JSX.Element;
33
34
 
34
35
  declare type AvatarProps = {
36
+ accessibleLabel?: string;
35
37
  imageUrl?: string;
36
- label?: string;
37
38
  link?: string;
38
39
  };
39
40
 
40
- export declare const Badge: ({ children, onDelete, variant }: BadgeProps) => JSX.Element;
41
+ export declare const Badge: ({ children, deleteAccessibleLabel, onDelete, variant, }: BadgeProps) => JSX.Element;
41
42
 
42
43
  declare type BadgeProps = {
43
44
  children?: React.ReactNode;
45
+ deleteAccessibleLabel?: string;
44
46
  onDelete?: () => void;
45
47
  variant?: keyof typeof variants_2;
46
48
  };
@@ -106,9 +108,11 @@ declare type CollapsibleProps = {
106
108
  label?: default_2.ReactNode;
107
109
  };
108
110
 
109
- export declare const Controls: ({ children, ...props }: ControlsProps) => JSX.Element;
111
+ export declare const Controls: ({ children, onSaveShortcut, ...props }: ControlsProps) => JSX.Element;
110
112
 
111
- declare type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {};
113
+ declare type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {
114
+ onSaveShortcut?: () => void;
115
+ };
112
116
 
113
117
  export declare const Croppable: ({ children, fill, height, image, label, onCroppableChange, onFileChange, onImageChange, onTransformChange, transform, standalone, }: CroppableProps) => JSX.Element;
114
118
 
@@ -174,19 +178,20 @@ declare type EditorProps = {
174
178
  onChange?: (html: string) => void;
175
179
  };
176
180
 
177
- export declare const Figure: ({ children, className, label, offset }: FigureProps) => JSX.Element;
181
+ export declare const Figure: ({ accessibleLabel, children, className, offset }: FigureProps) => JSX.Element;
178
182
 
179
183
  declare type FigureProps = {
184
+ accessibleLabel?: string;
180
185
  children?: React.ReactNode;
181
186
  className?: string;
182
- label?: string;
183
187
  offset?: 'left' | 'right';
184
188
  };
185
189
 
186
- declare const File_2: ({ name, onClick, onDelete, ref, url }: FileProps) => JSX.Element;
190
+ declare const File_2: ({ deleteAccessibleLabel, name, onClick, onDelete, ref, url }: FileProps) => JSX.Element;
187
191
  export { File_2 as File }
188
192
 
189
193
  declare type FileProps = React.ComponentPropsWithRef<'div'> & {
194
+ deleteAccessibleLabel?: string;
190
195
  name: string;
191
196
  onClick?: () => void;
192
197
  onDelete?: () => void;
@@ -209,7 +214,7 @@ declare type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {
209
214
  inline?: boolean;
210
215
  };
211
216
 
212
- export declare const Graph: ({ className, height, items, label, style, valueFormatter, ...props }: GraphProps) => JSX.Element;
217
+ export declare const Graph: ({ accessibleLabel, className, height, items, style, valueFormatter, ...props }: GraphProps) => JSX.Element;
213
218
 
214
219
  declare type GraphItem = {
215
220
  color?: string;
@@ -218,9 +223,9 @@ declare type GraphItem = {
218
223
  };
219
224
 
220
225
  declare type GraphProps = Omit<React.ComponentPropsWithoutRef<'figure'>, 'children'> & {
226
+ accessibleLabel?: string;
221
227
  height?: string;
222
228
  items?: GraphItem[];
223
- label?: string;
224
229
  valueFormatter?: (value: number) => string;
225
230
  };
226
231
 
@@ -301,7 +306,7 @@ declare type ImageProps = ImgHTMLAttributes<HTMLImageElement> & {
301
306
  showOnError?: boolean;
302
307
  };
303
308
 
304
- export declare function Input({ className, defaultCountryCode, disabled, icon, label, placeholder, ref, type, ...props }: InputProps): JSX.Element;
309
+ export declare function Input({ className, defaultCountryCode, disabled, icon, label, placeholder, ref, required, type, ...props }: InputProps): JSX.Element;
305
310
 
306
311
  declare type InputProps = React.ComponentPropsWithRef<'input'> & {
307
312
  defaultCountryCode?: string;
@@ -313,14 +318,6 @@ declare type InputProps = React.ComponentPropsWithRef<'input'> & {
313
318
  type?: 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'radio' | 'search' | 'tel' | 'text';
314
319
  };
315
320
 
316
- export declare const Layout: ({ children, isLoading, feature, ...props }: LayoutProps) => JSX.Element;
317
-
318
- declare type LayoutProps = {
319
- children: React.ReactNode;
320
- feature: string;
321
- isLoading?: boolean;
322
- };
323
-
324
321
  export declare const Link: ({ children, className, to, variant, ...props }: LinkProps) => JSX.Element;
325
322
 
326
323
  declare type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -389,9 +386,18 @@ declare type NavProps = React.HTMLAttributes<HTMLElement> & {
389
386
  variant?: keyof typeof variants_7;
390
387
  };
391
388
 
392
- export declare const Portal: ({ children, portals, open }: PortalProps) => JSX.Element;
389
+ declare const Object_2: ({ accessibleLabel, url, ...props }: ObjectProps) => JSX.Element;
390
+ export { Object_2 as Object }
391
+
392
+ declare type ObjectProps = Omit<ComponentPropsWithoutRef<'object'>, 'data' | 'type'> & {
393
+ accessibleLabel: string;
394
+ url: string;
395
+ };
396
+
397
+ export declare const Portal: ({ accessibleLabel, children, portals, open, }: PortalProps) => JSX.Element;
393
398
 
394
399
  declare type PortalProps = {
400
+ accessibleLabel?: string;
395
401
  children?: React.ReactNode;
396
402
  portals?: React.ReactNode;
397
403
  open?: boolean;
@@ -418,7 +424,7 @@ export declare function Sortable({ children, className, columns, onChangeOrder,
418
424
 
419
425
  declare type SortableProps = default_2.ComponentPropsWithoutRef<'ol'> & {
420
426
  columns?: number;
421
- onChangeOrder?: (order: SortItem[]) => void;
427
+ onChangeOrder: (order: SortItem[]) => void;
422
428
  };
423
429
 
424
430
  declare type SortItem = {
@@ -450,7 +456,7 @@ declare type ToastItem = ToastOptions & {
450
456
  export declare type ToastOptions = {
451
457
  durationMs?: number;
452
458
  label: string;
453
- type?: 'error' | 'info' | 'success';
459
+ type?: 'error' | 'success';
454
460
  };
455
461
 
456
462
  declare type ToastProps = ToastOptions & {