@hebium-ui/react 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (166) hide show
  1. package/dist/components/alert/alert.d.ts +3 -6
  2. package/dist/components/alert/alert.js +6 -14
  3. package/dist/components/alert/alert.js.map +1 -1
  4. package/dist/components/anchor/anchor.d.ts +1 -4
  5. package/dist/components/anchor/anchor.js +4 -5
  6. package/dist/components/anchor/anchor.js.map +1 -1
  7. package/dist/components/avatar/avatar.d.ts +1 -4
  8. package/dist/components/avatar/avatar.js +4 -5
  9. package/dist/components/avatar/avatar.js.map +1 -1
  10. package/dist/components/blockquote/blockquote.d.ts +1 -4
  11. package/dist/components/blockquote/blockquote.js +4 -5
  12. package/dist/components/blockquote/blockquote.js.map +1 -1
  13. package/dist/components/button/button.d.ts +12 -4
  14. package/dist/components/button/button.js +30 -11
  15. package/dist/components/button/button.js.map +1 -1
  16. package/dist/components/checkbox/checkbox.d.ts +2 -5
  17. package/dist/components/checkbox/checkbox.js +29 -16
  18. package/dist/components/checkbox/checkbox.js.map +1 -1
  19. package/dist/components/code/code.d.ts +1 -4
  20. package/dist/components/code/code.js +4 -5
  21. package/dist/components/code/code.js.map +1 -1
  22. package/dist/components/combobox/combobox-option.js +33 -0
  23. package/dist/components/combobox/combobox-option.js.map +1 -0
  24. package/dist/components/combobox/combobox.d.ts +61 -0
  25. package/dist/components/combobox/combobox.js +208 -0
  26. package/dist/components/combobox/combobox.js.map +1 -0
  27. package/dist/components/combobox/index.d.ts +2 -0
  28. package/dist/components/combobox/use-combobox-form.js +33 -0
  29. package/dist/components/combobox/use-combobox-form.js.map +1 -0
  30. package/dist/components/combobox/use-combobox-popover.js +66 -0
  31. package/dist/components/combobox/use-combobox-popover.js.map +1 -0
  32. package/dist/components/combobox/use-combobox-state.js +96 -0
  33. package/dist/components/combobox/use-combobox-state.js.map +1 -0
  34. package/dist/components/details/details.d.ts +1 -4
  35. package/dist/components/details/details.js +4 -5
  36. package/dist/components/details/details.js.map +1 -1
  37. package/dist/components/dialog/dialog.context.js +1 -2
  38. package/dist/components/dialog/dialog.d.ts +4 -7
  39. package/dist/components/dialog/dialog.js +29 -9
  40. package/dist/components/dialog/dialog.js.map +1 -1
  41. package/dist/components/dialog/index.d.ts +1 -2
  42. package/dist/components/dl/dl.d.ts +1 -4
  43. package/dist/components/dl/dl.js +10 -11
  44. package/dist/components/dl/dl.js.map +1 -1
  45. package/dist/components/drawer/drawer.context.js +1 -2
  46. package/dist/components/drawer/drawer.d.ts +4 -7
  47. package/dist/components/drawer/drawer.js +29 -9
  48. package/dist/components/drawer/drawer.js.map +1 -1
  49. package/dist/components/drawer/index.d.ts +1 -2
  50. package/dist/components/fieldset/fieldset.d.ts +1 -4
  51. package/dist/components/fieldset/fieldset.js +4 -5
  52. package/dist/components/fieldset/fieldset.js.map +1 -1
  53. package/dist/components/heading/heading.d.ts +1 -4
  54. package/dist/components/heading/heading.js +4 -5
  55. package/dist/components/heading/heading.js.map +1 -1
  56. package/dist/components/hr/hr.d.ts +1 -4
  57. package/dist/components/hr/hr.js +4 -5
  58. package/dist/components/hr/hr.js.map +1 -1
  59. package/dist/components/index.d.ts +35 -26
  60. package/dist/components/inline-feedback/index.d.ts +2 -0
  61. package/dist/components/inline-feedback/inline-feedback.d.ts +33 -0
  62. package/dist/components/inline-feedback/inline-feedback.js +30 -0
  63. package/dist/components/inline-feedback/inline-feedback.js.map +1 -0
  64. package/dist/components/input/input.d.ts +1 -4
  65. package/dist/components/input/input.js +4 -5
  66. package/dist/components/input/input.js.map +1 -1
  67. package/dist/components/label/label.d.ts +1 -4
  68. package/dist/components/label/label.js +6 -7
  69. package/dist/components/label/label.js.map +1 -1
  70. package/dist/components/menu/index.d.ts +1 -2
  71. package/dist/components/menu/menu.context.js +1 -2
  72. package/dist/components/menu/menu.d.ts +3 -6
  73. package/dist/components/menu/menu.js +23 -9
  74. package/dist/components/menu/menu.js.map +1 -1
  75. package/dist/components/multi-combobox/index.d.ts +2 -0
  76. package/dist/components/multi-combobox/multi-combobox-option.js +42 -0
  77. package/dist/components/multi-combobox/multi-combobox-option.js.map +1 -0
  78. package/dist/components/multi-combobox/multi-combobox-tag.js +54 -0
  79. package/dist/components/multi-combobox/multi-combobox-tag.js.map +1 -0
  80. package/dist/components/multi-combobox/multi-combobox.d.ts +72 -0
  81. package/dist/components/multi-combobox/multi-combobox.js +249 -0
  82. package/dist/components/multi-combobox/multi-combobox.js.map +1 -0
  83. package/dist/components/multi-combobox/use-multi-combobox-state.js +91 -0
  84. package/dist/components/multi-combobox/use-multi-combobox-state.js.map +1 -0
  85. package/dist/components/paragraph/paragraph.d.ts +1 -4
  86. package/dist/components/paragraph/paragraph.js +4 -5
  87. package/dist/components/paragraph/paragraph.js.map +1 -1
  88. package/dist/components/popover/index.d.ts +1 -2
  89. package/dist/components/popover/popover.context.js +1 -2
  90. package/dist/components/popover/popover.d.ts +3 -6
  91. package/dist/components/popover/popover.js +20 -6
  92. package/dist/components/popover/popover.js.map +1 -1
  93. package/dist/components/progress/progress.d.ts +1 -4
  94. package/dist/components/progress/progress.js +4 -5
  95. package/dist/components/progress/progress.js.map +1 -1
  96. package/dist/components/radio/radio.d.ts +1 -4
  97. package/dist/components/radio/radio.js +4 -5
  98. package/dist/components/radio/radio.js.map +1 -1
  99. package/dist/components/radiogroup/radiogroup.d.ts +1 -4
  100. package/dist/components/radiogroup/radiogroup.js +6 -6
  101. package/dist/components/radiogroup/radiogroup.js.map +1 -1
  102. package/dist/components/section/section.d.ts +1 -4
  103. package/dist/components/section/section.js +4 -5
  104. package/dist/components/section/section.js.map +1 -1
  105. package/dist/components/segmented-control/segmented-control.context.js +1 -2
  106. package/dist/components/segmented-control/segmented-control.d.ts +2 -5
  107. package/dist/components/segmented-control/segmented-control.js +13 -9
  108. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  109. package/dist/components/select/select.d.ts +1 -4
  110. package/dist/components/select/select.js +4 -5
  111. package/dist/components/select/select.js.map +1 -1
  112. package/dist/components/skip-link/index.d.ts +2 -0
  113. package/dist/components/skip-link/skip-link.d.ts +6 -0
  114. package/dist/components/skip-link/skip-link.js +20 -0
  115. package/dist/components/skip-link/skip-link.js.map +1 -0
  116. package/dist/components/status-icon/index.d.ts +2 -0
  117. package/dist/components/status-icon/status-icon.d.ts +19 -0
  118. package/dist/components/status-icon/status-icon.js +22 -0
  119. package/dist/components/status-icon/status-icon.js.map +1 -0
  120. package/dist/components/table/table.d.ts +4 -7
  121. package/dist/components/table/table.js +25 -26
  122. package/dist/components/table/table.js.map +1 -1
  123. package/dist/components/tabs/tabs.context.d.ts +1 -4
  124. package/dist/components/tabs/tabs.context.js +1 -2
  125. package/dist/components/tabs/tabs.d.ts +2 -5
  126. package/dist/components/tabs/tabs.js +13 -14
  127. package/dist/components/tabs/tabs.js.map +1 -1
  128. package/dist/components/tag/index.d.ts +2 -0
  129. package/dist/components/tag/tag.d.ts +39 -0
  130. package/dist/components/tag/tag.js +41 -0
  131. package/dist/components/tag/tag.js.map +1 -0
  132. package/dist/components/text/index.d.ts +2 -0
  133. package/dist/components/text/text.d.ts +22 -0
  134. package/dist/components/text/text.js +23 -0
  135. package/dist/components/text/text.js.map +1 -0
  136. package/dist/components/textarea/textarea.d.ts +1 -4
  137. package/dist/components/textarea/textarea.js +4 -5
  138. package/dist/components/textarea/textarea.js.map +1 -1
  139. package/dist/components/tooltip/index.d.ts +1 -2
  140. package/dist/components/tooltip/tooltip.context.js +1 -2
  141. package/dist/components/tooltip/tooltip.d.ts +3 -6
  142. package/dist/components/tooltip/tooltip.js +19 -5
  143. package/dist/components/tooltip/tooltip.js.map +1 -1
  144. package/dist/components/visually-hidden/visually-hidden.d.ts +3 -6
  145. package/dist/components/visually-hidden/visually-hidden.js +4 -5
  146. package/dist/components/visually-hidden/visually-hidden.js.map +1 -1
  147. package/dist/index.d.ts +9 -7
  148. package/dist/index.js +9 -7
  149. package/dist/provider/hui-provider.context.d.ts +34 -10
  150. package/dist/provider/hui-provider.context.js +23 -16
  151. package/dist/provider/hui-provider.context.js.map +1 -1
  152. package/dist/provider/hui-provider.d.ts +1 -4
  153. package/dist/provider/hui-provider.js +1 -2
  154. package/dist/provider/index.d.ts +1 -1
  155. package/dist/provider/merge-props.js +1 -2
  156. package/dist/types/distributive.d.ts +1 -0
  157. package/dist/types/hui-component.d.ts +11 -7
  158. package/dist/types/index.d.ts +3 -2
  159. package/dist/types/polymorphic.d.ts +4 -11
  160. package/dist/utils/attributes/normalize-attributes.js +1 -2
  161. package/package.json +9 -9
  162. package/dist/components/dialog/dialog.context.d.ts +0 -4
  163. package/dist/components/drawer/drawer.context.d.ts +0 -4
  164. package/dist/components/menu/menu.context.d.ts +0 -4
  165. package/dist/components/popover/popover.context.d.ts +0 -4
  166. package/dist/components/tooltip/tooltip.context.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/textarea/textarea.tsx"],"sourcesContent":["import { inputControl, inputRecipe, type InputSlots, type InputVariants, toBool, toStrbool } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement, type ReactNode, useId } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Label, type LabelProps } from \"../label\";\n\ntype HtmlTextareaProps = Omit<ComponentProps<\"textarea\">, \"children\" | \"color\">;\n\ninterface TextareaOwnProps extends HtmlTextareaProps {\n /**\n * The semantic color of the textarea.\n *\n * @default \"accent\"\n */\n color?: InputVariants[\"color\"] | undefined;\n /**\n * The label displayed above the textarea.\n */\n label?: ReactNode | undefined;\n /**\n * Additional props passed to the internal label component.\n */\n labelProps?: LabelProps | undefined;\n /**\n * The help text displayed below the label.\n */\n description?: ReactNode | undefined;\n /**\n * The validation error message displayed below the label.\n */\n error?: ReactNode | undefined;\n}\n\nexport type TextareaProps = HuiComponentProps<\n TextareaOwnProps,\n InputSlots\n>;\n\nexport function Textarea(rawProps: TextareaProps): ReactElement {\n const {\n id,\n classNames,\n styles,\n color,\n label,\n description,\n error,\n labelProps,\n ...restProps\n } = useHuiProps(\"Textarea\", rawProps);\n\n const tmpId = useId();\n\n const inputState = {\n id: id || tmpId,\n invalid: !!error,\n required: restProps.required ?? toBool(restProps[\"aria-required\"]),\n disabled: toBool(restProps.disabled) || toBool(restProps[\"aria-disabled\"]),\n readOnly: toBool(restProps.readOnly) || toBool(restProps[\"aria-readonly\"]),\n };\n const recipe = inputRecipe({\n color,\n height: \"auto\",\n error: toStrbool(inputState.invalid),\n });\n const cls = useHuiClassNames(\"Textarea\", recipe, classNames);\n const sls = useHuiStyles(\"Textarea\", styles);\n const hasLabel = !!label || !!description || !!error;\n const controlAttrs = normalizeAttributes(inputControl.getControlAttributes(inputState));\n const labelAttrs = normalizeAttributes(inputControl.getLabelAttributes(inputState));\n\n return (\n <div\n className={cls.root}\n style={sls.root}\n >\n {hasLabel\n && (\n <Label\n {...labelAttrs}\n description={description}\n error={error}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n <textarea\n className={cls.input}\n style={sls.input}\n {...controlAttrs}\n {...restProps}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAuCA,SAAgB,SAAS,UAAuC;CAC9D,MAAM,EACJ,IACA,YACA,QACA,OACA,OACA,aACA,OACA,YACA,GAAG,cACD,YAAY,YAAY,QAAQ;CAEpC,MAAM,QAAQ,MAAM;CAEpB,MAAM,aAAa;EACjB,IAAI,MAAM;EACV,SAAS,CAAC,CAAC;EACX,UAAU,UAAU,YAAY,OAAO,UAAU,gBAAgB;EACjE,UAAU,OAAO,UAAU,QAAQ,KAAK,OAAO,UAAU,gBAAgB;EACzE,UAAU,OAAO,UAAU,QAAQ,KAAK,OAAO,UAAU,gBAAgB;CAC3E;CACA,MAAM,SAAS,YAAY;EACzB;EACA,QAAQ;EACR,OAAO,UAAU,WAAW,OAAO;CACrC,CAAC;CACD,MAAM,MAAM,iBAAiB,YAAY,QAAQ,UAAU;CAC3D,MAAM,MAAM,aAAa,YAAY,MAAM;CAC3C,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;CAC/C,MAAM,eAAe,oBAAoB,aAAa,qBAAqB,UAAU,CAAC;CACtF,MAAM,aAAa,oBAAoB,aAAa,mBAAmB,UAAU,CAAC;CAElF,OACE,qBAAC,OAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EAFb,UAAA,CAIG,YAEG,oBAAC,OAAD;GACE,GAAI;GACS;GACN;GACP,GAAI;GAEH,UAAA;EACI,CAAA,GAEX,oBAAC,YAAD;GACE,WAAW,IAAI;GACf,OAAO,IAAI;GACX,GAAI;GACJ,GAAI;EACL,CAAA,CACE;;AAET"}
1
+ {"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/textarea/textarea.tsx"],"sourcesContent":["import { inputControl, inputRecipe, type InputSlots, type InputVariants, toBool, toStrbool } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement, type ReactNode, useId } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Label, type LabelProps } from \"../label\";\n\ntype HtmlTextareaProps = Omit<ComponentProps<\"textarea\">, \"children\" | \"color\">;\n\ninterface TextareaOwnProps extends HtmlTextareaProps {\n /**\n * The semantic color of the textarea.\n *\n * @default \"accent\"\n */\n color?: InputVariants[\"color\"] | undefined;\n /**\n * The label displayed above the textarea.\n */\n label?: ReactNode | undefined;\n /**\n * Additional props passed to the internal label component.\n */\n labelProps?: LabelProps | undefined;\n /**\n * The help text displayed below the label.\n */\n description?: ReactNode | undefined;\n /**\n * The validation error message displayed below the label.\n */\n error?: ReactNode | undefined;\n}\n\nexport type TextareaProps = HuiComponentProps<\n TextareaOwnProps,\n InputSlots\n>;\n\nexport function Textarea(rawProps: TextareaProps): ReactElement {\n const {\n id,\n color,\n label,\n description,\n error,\n labelProps,\n ...restProps\n } = useHuiProps(\"Textarea\", rawProps);\n\n const tmpId = useId();\n\n const inputState = {\n id: id || tmpId,\n invalid: !!error,\n required: restProps.required ?? toBool(restProps[\"aria-required\"]),\n disabled: toBool(restProps.disabled) || toBool(restProps[\"aria-disabled\"]),\n readOnly: toBool(restProps.readOnly) || toBool(restProps[\"aria-readonly\"]),\n };\n const recipe = inputRecipe({\n color,\n height: \"auto\",\n error: toStrbool(inputState.invalid),\n });\n const cls = useHuiClassNames(\"Textarea\", recipe, rawProps);\n const sls = useHuiStyles(\"Textarea\", rawProps);\n const hasLabel = !!label || !!description || !!error;\n const controlAttrs = normalizeAttributes(inputControl.getControlAttributes(inputState));\n const labelAttrs = normalizeAttributes(inputControl.getLabelAttributes(inputState));\n\n return (\n <div\n className={cls.root}\n style={sls.root}\n >\n {hasLabel\n && (\n <Label\n {...labelAttrs}\n description={description}\n error={error}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n <textarea\n className={cls.input}\n style={sls.input}\n {...controlAttrs}\n {...restProps}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAuCA,SAAgB,SAAS,UAAuC;CAC9D,MAAM,EACJ,IACA,OACA,OACA,aACA,OACA,YACA,GAAG,cACD,YAAY,YAAY,QAAQ;CAEpC,MAAM,QAAQ,MAAM;CAEpB,MAAM,aAAa;EACjB,IAAI,MAAM;EACV,SAAS,CAAC,CAAC;EACX,UAAU,UAAU,YAAY,OAAO,UAAU,gBAAgB;EACjE,UAAU,OAAO,UAAU,QAAQ,KAAK,OAAO,UAAU,gBAAgB;EACzE,UAAU,OAAO,UAAU,QAAQ,KAAK,OAAO,UAAU,gBAAgB;CAC3E;CACA,MAAM,SAAS,YAAY;EACzB;EACA,QAAQ;EACR,OAAO,UAAU,WAAW,OAAO;CACrC,CAAC;CACD,MAAM,MAAM,iBAAiB,YAAY,QAAQ,QAAQ;CACzD,MAAM,MAAM,aAAa,YAAY,QAAQ;CAC7C,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;CAC/C,MAAM,eAAe,oBAAoB,aAAa,qBAAqB,UAAU,CAAC;CACtF,MAAM,aAAa,oBAAoB,aAAa,mBAAmB,UAAU,CAAC;CAElF,OACE,qBAAC,OAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EAFb,UAAA,CAIG,YAEG,oBAAC,OAAD;GACE,GAAI;GACS;GACN;GACP,GAAI;GAEH,UAAA;EACI,CAAA,GAEX,oBAAC,YAAD;GACE,WAAW,IAAI;GACf,OAAO,IAAI;GACX,GAAI;GACJ,GAAI;EACL,CAAA,CACE;;AAET"}
@@ -1,3 +1,2 @@
1
1
  import { Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps } from "./tooltip.js";
2
- import { useTooltipId } from "./tooltip.context.js";
3
- export { Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps, useTooltipId };
2
+ export { Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps };
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from "react";
2
- //#region src/components/tooltip/tooltip.context.ts
2
+ // src/components/tooltip/tooltip.context.ts
3
3
  const TooltipContext = createContext(null);
4
4
  function useTooltipContext() {
5
5
  const context = useContext(TooltipContext);
@@ -9,7 +9,6 @@ function useTooltipContext() {
9
9
  function useTooltipId() {
10
10
  return useTooltipContext().tooltipId;
11
11
  }
12
- //#endregion
13
12
  export { TooltipContext, useTooltipContext, useTooltipId };
14
13
 
15
14
  //# sourceMappingURL=tooltip.context.js.map
@@ -4,7 +4,6 @@ import { Button } from "../button/button.js";
4
4
  import "../button/index.js";
5
5
  import { ButtonSlots, PopoverSlots, PopoverVariants } from "@hebium-ui/core";
6
6
  import { ElementType, ReactElement, ReactNode } from "react";
7
- //#region src/components/tooltip/tooltip.d.ts
8
7
  export interface TooltipProps {
9
8
  /**
10
9
  * The id of the tooltip content element.
@@ -13,8 +12,8 @@ export interface TooltipProps {
13
12
  children?: ReactNode | undefined;
14
13
  }
15
14
  declare function TooltipRoot(rawProps: TooltipProps): ReactElement;
16
- export type TooltipTriggerProps<E extends ElementType = typeof Button> = HuiPolymorphicProps<E, {}, ButtonSlots>;
17
- declare function Trigger<E extends ElementType = typeof Button>(rawProps: TooltipTriggerProps<E>): ReactNode;
15
+ export type TooltipTriggerProps<E extends ElementType = typeof Button<"button">> = HuiPolymorphicProps<E, {}, ButtonSlots>;
16
+ declare function Trigger<E extends ElementType = typeof Button<"button">>(rawProps: TooltipTriggerProps<E>): ReactNode;
18
17
  interface TooltipContentOwnProps {
19
18
  /**
20
19
  * The preferred anchor position of the tooltip.
@@ -48,6 +47,4 @@ export declare const Tooltip: typeof TooltipRoot & {
48
47
  Trigger: typeof Trigger;
49
48
  Content: typeof Content;
50
49
  };
51
- //#endregion
52
- export {};
53
- //# sourceMappingURL=tooltip.d.ts.map
50
+ export {};
@@ -4,7 +4,13 @@ import { TooltipContext, useTooltipId } from "./tooltip.context.js";
4
4
  import { popoverRecipe, tooltipControl } from "@hebium-ui/core";
5
5
  import { useCallback, useId, useMemo } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
- //#region src/components/tooltip/tooltip.tsx
7
+ // src/components/tooltip/tooltip.tsx
8
+ const BUTTON_CLASSES = {
9
+ root: "",
10
+ content: "",
11
+ spinner: "",
12
+ status: ""
13
+ };
8
14
  function TooltipRoot(rawProps) {
9
15
  const { id, children } = useHuiProps("Tooltip", rawProps);
10
16
  const tmpId = useId();
@@ -20,6 +26,8 @@ function TooltipRoot(rawProps) {
20
26
  function Trigger(rawProps) {
21
27
  const { as, onPointerEnter, onPointerLeave, onFocus, onBlur, ...restProps } = useHuiProps("TooltipTrigger", rawProps);
22
28
  const Component = as ?? Button;
29
+ const cls = useHuiClassNames("TooltipTrigger", BUTTON_CLASSES, rawProps);
30
+ const sls = useHuiStyles("TooltipTrigger", rawProps);
23
31
  const tooltipId = useTooltipId();
24
32
  const attrs = tooltipControl.getTriggerAttributes({ tooltipId }, { isButtonElement: as === void 0 });
25
33
  const handlePointerEnter = useCallback((e) => {
@@ -40,6 +48,13 @@ function Trigger(rawProps) {
40
48
  }, [onBlur, tooltipId]);
41
49
  return /* @__PURE__ */ jsx(Component, {
42
50
  ...attrs,
51
+ ...Component === Button ? {
52
+ classNames: cls,
53
+ styles: sls
54
+ } : {
55
+ className: cls.root,
56
+ style: sls.root
57
+ },
43
58
  onPointerEnter: handlePointerEnter,
44
59
  onPointerLeave: handlePointerLeave,
45
60
  onFocus: handleFocus,
@@ -48,7 +63,7 @@ function Trigger(rawProps) {
48
63
  });
49
64
  }
50
65
  function Content(rawProps) {
51
- const { as, position, fallbacks, visibility, padding, className, style, children, onPointerLeave, ...restProps } = useHuiProps("TooltipContent", rawProps);
66
+ const { as, position, fallbacks, visibility, padding, children, onPointerLeave, ...restProps } = useHuiProps("TooltipContent", rawProps);
52
67
  const Component = as ?? "div";
53
68
  const tooltipId = useTooltipId();
54
69
  const recipe = popoverRecipe({
@@ -57,8 +72,8 @@ function Content(rawProps) {
57
72
  visibility,
58
73
  padding
59
74
  });
60
- const cls = useHuiClassNames("TooltipContent", recipe, { root: className });
61
- const sls = useHuiStyles("TooltipContent", { root: style });
75
+ const cls = useHuiClassNames("TooltipContent", recipe, rawProps);
76
+ const sls = useHuiStyles("TooltipContent", rawProps);
62
77
  const attrs = tooltipControl.getContentAttributes({ tooltipId });
63
78
  const handlePointerLeave = useCallback((e) => {
64
79
  onPointerLeave?.(e);
@@ -77,7 +92,6 @@ const Tooltip = Object.assign(TooltipRoot, {
77
92
  Trigger,
78
93
  Content
79
94
  });
80
- //#endregion
81
95
  export { Tooltip };
82
96
 
83
97
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import {\n type ButtonSlots,\n popoverRecipe,\n type PopoverSlots,\n type PopoverVariants,\n tooltipControl,\n} from \"@hebium-ui/core\";\nimport {\n type ElementType,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useId,\n useMemo,\n} from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\nimport { Button } from \"../button\";\nimport { TooltipContext, type TooltipContextValue, useTooltipId } from \"./tooltip.context\";\n\nexport interface TooltipProps {\n /**\n * The id of the tooltip content element.\n */\n id?: string | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction TooltipRoot(rawProps: TooltipProps): ReactElement {\n const {\n id,\n children,\n } = useHuiProps(\"Tooltip\", rawProps);\n\n const tmpId = useId();\n const tooltipId = id || tmpId;\n\n const contextValue = useMemo<TooltipContextValue>(() => {\n return {\n tooltipId,\n };\n }, [tooltipId]);\n\n return (\n <TooltipContext.Provider\n value={contextValue}\n >\n {children}\n </TooltipContext.Provider>\n );\n}\n\nexport type TooltipTriggerProps<E extends ElementType = typeof Button> = HuiPolymorphicProps<\n E,\n {},\n ButtonSlots\n>;\n\nfunction Trigger<E extends ElementType = typeof Button>(rawProps: TooltipTriggerProps<E>): ReactNode {\n const {\n as,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...restProps\n } = useHuiProps(\"TooltipTrigger\", rawProps);\n\n const Component = as ?? Button;\n\n const tooltipId = useTooltipId();\n const attrs = tooltipControl.getTriggerAttributes(\n { tooltipId },\n { isButtonElement: as === undefined },\n );\n\n const handlePointerEnter = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerEnter?.(e);\n tooltipControl.showTooltip(tooltipId, e.currentTarget);\n }, [onPointerEnter, tooltipId]);\n\n const handlePointerLeave = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerLeave?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onPointerLeave, tooltipId]);\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLElement>): void => {\n onFocus?.(e);\n tooltipControl.showTooltip(tooltipId, e.currentTarget);\n }, [onFocus, tooltipId]);\n\n const handleBlur = useCallback((e: React.FocusEvent<HTMLElement>): void => {\n onBlur?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onBlur, tooltipId]);\n\n return (\n <Component\n {...attrs}\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...restProps}\n />\n );\n}\n\ninterface TooltipContentOwnProps {\n /**\n * The preferred anchor position of the tooltip.\n *\n * @default \"block-start\"\n */\n position?: PopoverVariants[\"position\"] | undefined;\n /**\n * The fallback strategy used when the preferred position overflows.\n *\n * @default \"flip\"\n */\n fallbacks?: PopoverVariants[\"fallbacks\"] | undefined;\n /**\n * The visibility behavior when the anchor is off-screen or overflows.\n *\n * @default \"anchors-visible\"\n * @see This setting depends on browser support for {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-visibility | MDN: position-visibility}.\n */\n visibility?: PopoverVariants[\"visibility\"] | undefined;\n /**\n * The padding size of the tooltip content.\n *\n * @default \"md\"\n */\n padding?: PopoverVariants[\"padding\"] | undefined;\n}\nexport type TooltipContentProps<E extends ElementType = \"div\"> = HuiPolymorphicProps<\n E,\n TooltipContentOwnProps,\n PopoverSlots\n>;\n\nfunction Content<E extends ElementType = \"div\">(rawProps: TooltipContentProps<E>): ReactElement {\n const {\n as,\n position,\n fallbacks,\n visibility,\n padding,\n className,\n style,\n children,\n onPointerLeave,\n ...restProps\n } = useHuiProps(\"TooltipContent\", rawProps);\n const Component = as ?? \"div\";\n\n const tooltipId = useTooltipId();\n const recipe = popoverRecipe({ position, fallbacks, visibility, padding });\n const cls = useHuiClassNames(\"TooltipContent\", recipe, { root: className });\n const sls = useHuiStyles(\"TooltipContent\", { root: style });\n const attrs = tooltipControl.getContentAttributes({ tooltipId });\n\n const handlePointerLeave = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerLeave?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onPointerLeave, tooltipId]);\n\n return (\n <Component\n {...attrs}\n className={cls.root}\n style={sls.root}\n onPointerLeave={handlePointerLeave}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n\nexport const Tooltip = Object.assign(TooltipRoot, {\n Trigger,\n Content,\n});\n"],"mappings":";;;;;;;AA6BA,SAAS,YAAY,UAAsC;CACzD,MAAM,EACJ,IACA,aACE,YAAY,WAAW,QAAQ;CAEnC,MAAM,QAAQ,MAAM;CACpB,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,cAAmC;EACtD,OAAO,EACL,UACF;CACF,GAAG,CAAC,SAAS,CAAC;CAEd,OACE,oBAAC,eAAe,UAAhB;EACE,OAAO;EAEN;CACsB,CAAA;AAE7B;AAQA,SAAS,QAA+C,UAA6C;CACnG,MAAM,EACJ,IACA,gBACA,gBACA,SACA,QACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAE1C,MAAM,YAAY,MAAM;CAExB,MAAM,YAAY,aAAa;CAC/B,MAAM,QAAQ,eAAe,qBAC3B,EAAE,UAAU,GACZ,EAAE,iBAAiB,OAAO,KAAA,EAAU,CACtC;CAEA,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,WAAW,EAAE,aAAa;CACvD,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,MAAM,cAAc,aAAa,MAA2C;EAC1E,UAAU,CAAC;EACX,eAAe,YAAY,WAAW,EAAE,aAAa;CACvD,GAAG,CAAC,SAAS,SAAS,CAAC;CAEvB,MAAM,aAAa,aAAa,MAA2C;EACzE,SAAS,CAAC;EACV,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,QAAQ,SAAS,CAAC;CAEtB,OACE,oBAAC,WAAD;EACE,GAAI;EACJ,gBAAgB;EAChB,gBAAgB;EAChB,SAAS;EACT,QAAQ;EACR,GAAI;CACL,CAAA;AAEL;AAmCA,SAAS,QAAuC,UAAgD;CAC9F,MAAM,EACJ,IACA,UACA,WACA,YACA,SACA,WACA,OACA,UACA,gBACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAC1C,MAAM,YAAY,MAAM;CAExB,MAAM,YAAY,aAAa;CAC/B,MAAM,SAAS,cAAc;EAAE;EAAU;EAAW;EAAY;CAAQ,CAAC;CACzE,MAAM,MAAM,iBAAiB,kBAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;CAC1E,MAAM,MAAM,aAAa,kBAAkB,EAAE,MAAM,MAAM,CAAC;CAC1D,MAAM,QAAQ,eAAe,qBAAqB,EAAE,UAAU,CAAC;CAE/D,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,OACE,oBAAC,WAAD;EACE,GAAI;EACJ,WAAW,IAAI;EACf,OAAO,IAAI;EACX,gBAAgB;EAChB,GAAI;EAEH;CACQ,CAAA;AAEf;AAEA,MAAa,UAAU,OAAO,OAAO,aAAa;CAChD;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import {\n type ButtonSlots,\n popoverRecipe,\n type PopoverSlots,\n type PopoverVariants,\n tooltipControl,\n} from \"@hebium-ui/core\";\nimport {\n type ElementType,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useId,\n useMemo,\n} from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\nimport { Button } from \"../button\";\nimport { TooltipContext, type TooltipContextValue, useTooltipId } from \"./tooltip.context\";\n\nconst BUTTON_CLASSES = { root: \"\", content: \"\", spinner: \"\", status: \"\" } satisfies Record<ButtonSlots, string>;\n\nexport interface TooltipProps {\n /**\n * The id of the tooltip content element.\n */\n id?: string | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction TooltipRoot(rawProps: TooltipProps): ReactElement {\n const {\n id,\n children,\n } = useHuiProps(\"Tooltip\", rawProps);\n\n const tmpId = useId();\n const tooltipId = id || tmpId;\n\n const contextValue = useMemo<TooltipContextValue>(() => {\n return {\n tooltipId,\n };\n }, [tooltipId]);\n\n return (\n <TooltipContext.Provider\n value={contextValue}\n >\n {children}\n </TooltipContext.Provider>\n );\n}\n\nexport type TooltipTriggerProps<E extends ElementType = typeof Button<\"button\">> = HuiPolymorphicProps<\n E,\n {},\n ButtonSlots\n>;\n\nfunction Trigger<E extends ElementType = typeof Button<\"button\">>(rawProps: TooltipTriggerProps<E>): ReactNode {\n const {\n as,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...restProps\n } = useHuiProps(\"TooltipTrigger\", rawProps);\n\n const Component = as ?? Button;\n const cls = useHuiClassNames(\"TooltipTrigger\", BUTTON_CLASSES, rawProps);\n const sls = useHuiStyles(\"TooltipTrigger\", rawProps);\n\n const tooltipId = useTooltipId();\n const attrs = tooltipControl.getTriggerAttributes(\n { tooltipId },\n { isButtonElement: as === undefined },\n );\n\n const handlePointerEnter = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerEnter?.(e);\n tooltipControl.showTooltip(tooltipId, e.currentTarget);\n }, [onPointerEnter, tooltipId]);\n\n const handlePointerLeave = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerLeave?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onPointerLeave, tooltipId]);\n\n const handleFocus = useCallback((e: React.FocusEvent<HTMLElement>): void => {\n onFocus?.(e);\n tooltipControl.showTooltip(tooltipId, e.currentTarget);\n }, [onFocus, tooltipId]);\n\n const handleBlur = useCallback((e: React.FocusEvent<HTMLElement>): void => {\n onBlur?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onBlur, tooltipId]);\n\n return (\n <Component\n {...attrs}\n {...(Component === Button\n ? { classNames: cls, styles: sls }\n : { className: cls.root, style: sls.root })}\n onPointerEnter={handlePointerEnter}\n onPointerLeave={handlePointerLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...restProps}\n />\n );\n}\n\ninterface TooltipContentOwnProps {\n /**\n * The preferred anchor position of the tooltip.\n *\n * @default \"block-start\"\n */\n position?: PopoverVariants[\"position\"] | undefined;\n /**\n * The fallback strategy used when the preferred position overflows.\n *\n * @default \"flip\"\n */\n fallbacks?: PopoverVariants[\"fallbacks\"] | undefined;\n /**\n * The visibility behavior when the anchor is off-screen or overflows.\n *\n * @default \"anchors-visible\"\n * @see This setting depends on browser support for {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-visibility | MDN: position-visibility}.\n */\n visibility?: PopoverVariants[\"visibility\"] | undefined;\n /**\n * The padding size of the tooltip content.\n *\n * @default \"md\"\n */\n padding?: PopoverVariants[\"padding\"] | undefined;\n}\nexport type TooltipContentProps<E extends ElementType = \"div\"> = HuiPolymorphicProps<\n E,\n TooltipContentOwnProps,\n PopoverSlots\n>;\n\nfunction Content<E extends ElementType = \"div\">(rawProps: TooltipContentProps<E>): ReactElement {\n const {\n as,\n position,\n fallbacks,\n visibility,\n padding,\n children,\n onPointerLeave,\n ...restProps\n } = useHuiProps(\"TooltipContent\", rawProps);\n const Component = as ?? \"div\";\n\n const tooltipId = useTooltipId();\n const recipe = popoverRecipe({ position, fallbacks, visibility, padding });\n const cls = useHuiClassNames(\"TooltipContent\", recipe, rawProps);\n const sls = useHuiStyles(\"TooltipContent\", rawProps);\n const attrs = tooltipControl.getContentAttributes({ tooltipId });\n\n const handlePointerLeave = useCallback((e: PointerEvent<HTMLElement>): void => {\n onPointerLeave?.(e);\n tooltipControl.hideTooltip(tooltipId);\n }, [onPointerLeave, tooltipId]);\n\n return (\n <Component\n {...attrs}\n className={cls.root}\n style={sls.root}\n onPointerLeave={handlePointerLeave}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n\nexport const Tooltip = Object.assign(TooltipRoot, {\n Trigger,\n Content,\n});\n"],"mappings":";;;;;;;AAqBA,MAAM,iBAAiB;CAAE,MAAM;CAAI,SAAS;CAAI,SAAS;CAAI,QAAQ;AAAG;AAUxE,SAAS,YAAY,UAAsC;CACzD,MAAM,EACJ,IACA,aACE,YAAY,WAAW,QAAQ;CAEnC,MAAM,QAAQ,MAAM;CACpB,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,cAAmC;EACtD,OAAO,EACL,UACF;CACF,GAAG,CAAC,SAAS,CAAC;CAEd,OACE,oBAAC,eAAe,UAAhB;EACE,OAAO;EAEN;CACsB,CAAA;AAE7B;AAQA,SAAS,QAAyD,UAA6C;CAC7G,MAAM,EACJ,IACA,gBACA,gBACA,SACA,QACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAE1C,MAAM,YAAY,MAAM;CACxB,MAAM,MAAM,iBAAiB,kBAAkB,gBAAgB,QAAQ;CACvE,MAAM,MAAM,aAAa,kBAAkB,QAAQ;CAEnD,MAAM,YAAY,aAAa;CAC/B,MAAM,QAAQ,eAAe,qBAC3B,EAAE,UAAU,GACZ,EAAE,iBAAiB,OAAO,KAAA,EAAU,CACtC;CAEA,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,WAAW,EAAE,aAAa;CACvD,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,MAAM,cAAc,aAAa,MAA2C;EAC1E,UAAU,CAAC;EACX,eAAe,YAAY,WAAW,EAAE,aAAa;CACvD,GAAG,CAAC,SAAS,SAAS,CAAC;CAEvB,MAAM,aAAa,aAAa,MAA2C;EACzE,SAAS,CAAC;EACV,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,QAAQ,SAAS,CAAC;CAEtB,OACE,oBAAC,WAAD;EACE,GAAI;EACJ,GAAK,cAAc,SACf;GAAE,YAAY;GAAK,QAAQ;EAAI,IAC/B;GAAE,WAAW,IAAI;GAAM,OAAO,IAAI;EAAK;EAC3C,gBAAgB;EAChB,gBAAgB;EAChB,SAAS;EACT,QAAQ;EACR,GAAI;CACL,CAAA;AAEL;AAmCA,SAAS,QAAuC,UAAgD;CAC9F,MAAM,EACJ,IACA,UACA,WACA,YACA,SACA,UACA,gBACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAC1C,MAAM,YAAY,MAAM;CAExB,MAAM,YAAY,aAAa;CAC/B,MAAM,SAAS,cAAc;EAAE;EAAU;EAAW;EAAY;CAAQ,CAAC;CACzE,MAAM,MAAM,iBAAiB,kBAAkB,QAAQ,QAAQ;CAC/D,MAAM,MAAM,aAAa,kBAAkB,QAAQ;CACnD,MAAM,QAAQ,eAAe,qBAAqB,EAAE,UAAU,CAAC;CAE/D,MAAM,qBAAqB,aAAa,MAAuC;EAC7E,iBAAiB,CAAC;EAClB,eAAe,YAAY,SAAS;CACtC,GAAG,CAAC,gBAAgB,SAAS,CAAC;CAE9B,OACE,oBAAC,WAAD;EACE,GAAI;EACJ,WAAW,IAAI;EACf,OAAO,IAAI;EACX,gBAAgB;EAChB,GAAI;EAEH;CACQ,CAAA;AAEf;AAEA,MAAa,UAAU,OAAO,OAAO,aAAa;CAChD;CACA;AACF,CAAC"}
@@ -1,9 +1,6 @@
1
1
  import { HuiPolymorphicProps } from "../../types/polymorphic.js";
2
2
  import "../../types/index.js";
3
- import { ParagraphSlots } from "@hebium-ui/core";
3
+ import { VisuallyHiddenSlots } from "@hebium-ui/core";
4
4
  import { ElementType, ReactElement } from "react";
5
- //#region src/components/visually-hidden/visually-hidden.d.ts
6
- export type VisuallyHiddenProps<E extends ElementType = "span"> = HuiPolymorphicProps<E, {}, ParagraphSlots>;
7
- export declare function VisuallyHidden<E extends ElementType = "span">(rawProps: VisuallyHiddenProps<E>): ReactElement;
8
- //#endregion
9
- //# sourceMappingURL=visually-hidden.d.ts.map
5
+ export type VisuallyHiddenProps<E extends ElementType = "span"> = HuiPolymorphicProps<E, {}, VisuallyHiddenSlots>;
6
+ export declare function VisuallyHidden<E extends ElementType = "span">(rawProps: VisuallyHiddenProps<E>): ReactElement;
@@ -1,13 +1,13 @@
1
1
  import { useHuiClassNames, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
2
2
  import { visuallyHiddenRecipe } from "@hebium-ui/core";
3
3
  import { jsx } from "react/jsx-runtime";
4
- //#region src/components/visually-hidden/visually-hidden.tsx
4
+ // src/components/visually-hidden/visually-hidden.tsx
5
5
  function VisuallyHidden(rawProps) {
6
- const { as, className, style, children, ...restProps } = useHuiProps("VisuallyHidden", rawProps);
6
+ const { as, children, ...restProps } = useHuiProps("VisuallyHidden", rawProps);
7
7
  const Component = as ?? "span";
8
8
  const recipe = visuallyHiddenRecipe({});
9
- const cls = useHuiClassNames("VisuallyHidden", recipe, { root: className });
10
- const sls = useHuiStyles("VisuallyHidden", { root: style });
9
+ const cls = useHuiClassNames("VisuallyHidden", recipe, rawProps);
10
+ const sls = useHuiStyles("VisuallyHidden", rawProps);
11
11
  return /* @__PURE__ */ jsx(Component, {
12
12
  className: cls.root,
13
13
  style: sls.root,
@@ -15,7 +15,6 @@ function VisuallyHidden(rawProps) {
15
15
  children
16
16
  });
17
17
  }
18
- //#endregion
19
18
  export { VisuallyHidden };
20
19
 
21
20
  //# sourceMappingURL=visually-hidden.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visually-hidden.js","names":[],"sources":["../../../src/components/visually-hidden/visually-hidden.tsx"],"sourcesContent":["import { type ParagraphSlots, visuallyHiddenRecipe } from \"@hebium-ui/core\";\nimport { type ElementType, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\n\nexport type VisuallyHiddenProps<E extends ElementType = \"span\"> = HuiPolymorphicProps<\n E,\n {},\n ParagraphSlots\n>;\n\nexport function VisuallyHidden<E extends ElementType = \"span\">(rawProps: VisuallyHiddenProps<E>): ReactElement {\n const {\n as,\n className,\n style,\n children,\n ...restProps\n } = useHuiProps(\"VisuallyHidden\", rawProps);\n\n const Component = as ?? \"span\";\n const recipe = visuallyHiddenRecipe({});\n const cls = useHuiClassNames(\"VisuallyHidden\", recipe, { root: className });\n const sls = useHuiStyles(\"VisuallyHidden\", { root: style });\n\n return (\n <Component\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n"],"mappings":";;;;AAWA,SAAgB,eAA+C,UAAgD;CAC7G,MAAM,EACJ,IACA,WACA,OACA,UACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAE1C,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,qBAAqB,CAAC,CAAC;CACtC,MAAM,MAAM,iBAAiB,kBAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;CAC1E,MAAM,MAAM,aAAa,kBAAkB,EAAE,MAAM,MAAM,CAAC;CAE1D,OACE,oBAAC,WAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACQ,CAAA;AAEf"}
1
+ {"version":3,"file":"visually-hidden.js","names":[],"sources":["../../../src/components/visually-hidden/visually-hidden.tsx"],"sourcesContent":["import { visuallyHiddenRecipe, type VisuallyHiddenSlots } from \"@hebium-ui/core\";\nimport { type ElementType, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\n\nexport type VisuallyHiddenProps<E extends ElementType = \"span\"> = HuiPolymorphicProps<\n E,\n {},\n VisuallyHiddenSlots\n>;\n\nexport function VisuallyHidden<E extends ElementType = \"span\">(rawProps: VisuallyHiddenProps<E>): ReactElement {\n const {\n as,\n children,\n ...restProps\n } = useHuiProps(\"VisuallyHidden\", rawProps);\n\n const Component = as ?? \"span\";\n const recipe = visuallyHiddenRecipe({});\n const cls = useHuiClassNames(\"VisuallyHidden\", recipe, rawProps);\n const sls = useHuiStyles(\"VisuallyHidden\", rawProps);\n\n return (\n <Component\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n"],"mappings":";;;;AAWA,SAAgB,eAA+C,UAAgD;CAC7G,MAAM,EACJ,IACA,UACA,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAE1C,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,qBAAqB,CAAC,CAAC;CACtC,MAAM,MAAM,iBAAiB,kBAAkB,QAAQ,QAAQ;CAC/D,MAAM,MAAM,aAAa,kBAAkB,QAAQ;CAEnD,OACE,oBAAC,WAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACQ,CAAA;AAEf"}
package/dist/index.d.ts CHANGED
@@ -5,36 +5,38 @@ import { Blockquote, BlockquoteProps } from "./components/blockquote/blockquote.
5
5
  import { Button, ButtonProps } from "./components/button/button.js";
6
6
  import { Checkbox, CheckboxProps } from "./components/checkbox/checkbox.js";
7
7
  import { Code, CodeProps } from "./components/code/code.js";
8
+ import { Label, LabelProps } from "./components/label/label.js";
9
+ import { Combobox, ComboboxFormValueProps, ComboboxProps, ComboboxSelectOption, ComboboxTextOption } from "./components/combobox/combobox.js";
8
10
  import { Details, DetailsProps } from "./components/details/details.js";
9
11
  import { Heading, HeadingProps } from "./components/heading/heading.js";
10
12
  import { Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps } from "./components/dialog/dialog.js";
11
- import { useDialogId } from "./components/dialog/dialog.context.js";
12
13
  import { DdProps, Dl, DlProps, DtProps } from "./components/dl/dl.js";
13
14
  import { Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps } from "./components/drawer/drawer.js";
14
- import { useDrawerId } from "./components/drawer/drawer.context.js";
15
15
  import { Fieldset, FieldsetProps } from "./components/fieldset/fieldset.js";
16
16
  import { Hr, HrProps } from "./components/hr/hr.js";
17
- import { Label, LabelProps } from "./components/label/label.js";
17
+ import { InlineFeedback, InlineFeedbackProps } from "./components/inline-feedback/inline-feedback.js";
18
18
  import { Input, InputProps } from "./components/input/input.js";
19
19
  import { Menu, MenuContentProps, MenuItemProps, MenuProps, MenuTriggerProps } from "./components/menu/menu.js";
20
- import { useMenuId } from "./components/menu/menu.context.js";
20
+ import { Tag, TagProps } from "./components/tag/tag.js";
21
+ import { MultiCombobox, MultiComboboxFormValueProps, MultiComboboxItemState, MultiComboboxProps, MultiComboboxTagContext, MultiComboboxTagProps } from "./components/multi-combobox/multi-combobox.js";
21
22
  import { Paragraph, ParagraphProps } from "./components/paragraph/paragraph.js";
22
23
  import { Popover, PopoverContentProps, PopoverProps, PopoverTriggerProps } from "./components/popover/popover.js";
23
- import { usePopoverId } from "./components/popover/popover.context.js";
24
24
  import { Progress, ProgressProps } from "./components/progress/progress.js";
25
25
  import { Radio, RadioProps } from "./components/radio/radio.js";
26
26
  import { Radiogroup, RadiogroupProps } from "./components/radiogroup/radiogroup.js";
27
27
  import { Section, SectionProps } from "./components/section/section.js";
28
28
  import { SegmentedControl, SegmentedControlItemProps, SegmentedControlProps } from "./components/segmented-control/segmented-control.js";
29
29
  import { Select, SelectProps } from "./components/select/select.js";
30
+ import { SkipLink, SkipLinkProps } from "./components/skip-link/skip-link.js";
31
+ import { StatusIcon, StatusIconProps } from "./components/status-icon/status-icon.js";
30
32
  import { CaptionProps, Table, TableProps, TbodyProps, TdProps, TfootProps, ThProps, TheadProps, TrProps } from "./components/table/table.js";
31
33
  import { Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTabProps } from "./components/tabs/tabs.js";
34
+ import { Text, TextProps } from "./components/text/text.js";
32
35
  import { Textarea, TextareaProps } from "./components/textarea/textarea.js";
33
36
  import { Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps } from "./components/tooltip/tooltip.js";
34
- import { useTooltipId } from "./components/tooltip/tooltip.context.js";
35
37
  import { VisuallyHidden, VisuallyHiddenProps } from "./components/visually-hidden/visually-hidden.js";
36
38
  import "./components/index.js";
37
39
  import { HuiComponentPropsMap, HuiProviderContext, HuiProviderContextValue, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles } from "./provider/hui-provider.context.js";
38
40
  import { HuiProvider } from "./provider/hui-provider.js";
39
41
  import "./provider/index.js";
40
- export { Alert, AlertProps, Anchor, AnchorProps, Avatar, AvatarProps, Blockquote, BlockquoteProps, Button, ButtonProps, CaptionProps, Checkbox, CheckboxProps, Code, CodeProps, DdProps, Details, DetailsProps, Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps, Dl, DlProps, Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps, DtProps, Fieldset, FieldsetProps, Heading, HeadingProps, Hr, HrProps, HuiComponentPropsMap, HuiProvider, HuiProviderContext, HuiProviderContextValue, Input, InputProps, Label, LabelProps, Menu, MenuContentProps, MenuItemProps, MenuProps, MenuTriggerProps, Paragraph, ParagraphProps, Popover, PopoverContentProps, PopoverProps, PopoverTriggerProps, Progress, ProgressProps, Radio, RadioProps, Radiogroup, RadiogroupProps, Section, SectionProps, SegmentedControl, SegmentedControlItemProps, SegmentedControlProps, Select, SelectProps, Table, TableProps, Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTabProps, TbodyProps, TdProps, Textarea, TextareaProps, TfootProps, ThProps, TheadProps, Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps, TrProps, VisuallyHidden, VisuallyHiddenProps, useDialogId, useDrawerId, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles, useMenuId, usePopoverId, useTooltipId };
42
+ export { Alert, AlertProps, Anchor, AnchorProps, Avatar, AvatarProps, Blockquote, BlockquoteProps, Button, ButtonProps, CaptionProps, Checkbox, CheckboxProps, Code, CodeProps, Combobox, type ComboboxFormValueProps, ComboboxProps, type ComboboxSelectOption, type ComboboxTextOption, DdProps, Details, DetailsProps, Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps, Dl, DlProps, Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps, DtProps, Fieldset, FieldsetProps, Heading, HeadingProps, Hr, HrProps, HuiComponentPropsMap, HuiProvider, HuiProviderContext, HuiProviderContextValue, InlineFeedback, InlineFeedbackProps, Input, InputProps, Label, LabelProps, Menu, MenuContentProps, MenuItemProps, MenuProps, MenuTriggerProps, MultiCombobox, type MultiComboboxFormValueProps, type MultiComboboxItemState, MultiComboboxProps, MultiComboboxTagContext, MultiComboboxTagProps, Paragraph, ParagraphProps, Popover, PopoverContentProps, PopoverProps, PopoverTriggerProps, Progress, ProgressProps, Radio, RadioProps, Radiogroup, RadiogroupProps, Section, SectionProps, SegmentedControl, SegmentedControlItemProps, SegmentedControlProps, Select, SelectProps, SkipLink, SkipLinkProps, StatusIcon, StatusIconProps, Table, TableProps, Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTabProps, Tag, TagProps, TbodyProps, TdProps, Text, TextProps, Textarea, TextareaProps, TfootProps, ThProps, TheadProps, Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps, TrProps, VisuallyHidden, VisuallyHiddenProps, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { HuiProviderContext, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles } from "./provider/hui-provider.context.js";
2
2
  import { HuiProvider } from "./provider/hui-provider.js";
3
+ import { StatusIcon } from "./components/status-icon/status-icon.js";
3
4
  import { Alert } from "./components/alert/alert.js";
4
5
  import { Anchor } from "./components/anchor/anchor.js";
5
6
  import { Avatar } from "./components/avatar/avatar.js";
@@ -7,21 +8,21 @@ import { Blockquote } from "./components/blockquote/blockquote.js";
7
8
  import { Button } from "./components/button/button.js";
8
9
  import { Checkbox } from "./components/checkbox/checkbox.js";
9
10
  import { Code } from "./components/code/code.js";
11
+ import { Label } from "./components/label/label.js";
12
+ import { Combobox } from "./components/combobox/combobox.js";
10
13
  import { Details } from "./components/details/details.js";
11
14
  import { Heading } from "./components/heading/heading.js";
12
- import { useDialogId } from "./components/dialog/dialog.context.js";
13
15
  import { Dialog } from "./components/dialog/dialog.js";
14
16
  import { Dl } from "./components/dl/dl.js";
15
- import { useDrawerId } from "./components/drawer/drawer.context.js";
16
17
  import { Drawer } from "./components/drawer/drawer.js";
17
18
  import { Fieldset } from "./components/fieldset/fieldset.js";
18
19
  import { Hr } from "./components/hr/hr.js";
19
- import { Label } from "./components/label/label.js";
20
+ import { InlineFeedback } from "./components/inline-feedback/inline-feedback.js";
20
21
  import { Input } from "./components/input/input.js";
21
- import { useMenuId } from "./components/menu/menu.context.js";
22
22
  import { Menu } from "./components/menu/menu.js";
23
+ import { Tag } from "./components/tag/tag.js";
24
+ import { MultiCombobox } from "./components/multi-combobox/multi-combobox.js";
23
25
  import { Paragraph } from "./components/paragraph/paragraph.js";
24
- import { usePopoverId } from "./components/popover/popover.context.js";
25
26
  import { Popover } from "./components/popover/popover.js";
26
27
  import { Progress } from "./components/progress/progress.js";
27
28
  import { Radio } from "./components/radio/radio.js";
@@ -29,10 +30,11 @@ import { Radiogroup } from "./components/radiogroup/radiogroup.js";
29
30
  import { Section } from "./components/section/section.js";
30
31
  import { SegmentedControl } from "./components/segmented-control/segmented-control.js";
31
32
  import { Select } from "./components/select/select.js";
33
+ import { SkipLink } from "./components/skip-link/skip-link.js";
32
34
  import { Table } from "./components/table/table.js";
33
35
  import { Tabs } from "./components/tabs/tabs.js";
36
+ import { Text } from "./components/text/text.js";
34
37
  import { Textarea } from "./components/textarea/textarea.js";
35
- import { useTooltipId } from "./components/tooltip/tooltip.context.js";
36
38
  import { Tooltip } from "./components/tooltip/tooltip.js";
37
39
  import { VisuallyHidden } from "./components/visually-hidden/visually-hidden.js";
38
- export { Alert, Anchor, Avatar, Blockquote, Button, Checkbox, Code, Details, Dialog, Dl, Drawer, Fieldset, Heading, Hr, HuiProvider, HuiProviderContext, Input, Label, Menu, Paragraph, Popover, Progress, Radio, Radiogroup, Section, SegmentedControl, Select, Table, Tabs, Textarea, Tooltip, VisuallyHidden, useDialogId, useDrawerId, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles, useMenuId, usePopoverId, useTooltipId };
40
+ export { Alert, Anchor, Avatar, Blockquote, Button, Checkbox, Code, Combobox, Details, Dialog, Dl, Drawer, Fieldset, Heading, Hr, HuiProvider, HuiProviderContext, InlineFeedback, Input, Label, Menu, MultiCombobox, Paragraph, Popover, Progress, Radio, Radiogroup, Section, SegmentedControl, Select, SkipLink, StatusIcon, Table, Tabs, Tag, Text, Textarea, Tooltip, VisuallyHidden, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles };
@@ -1,3 +1,6 @@
1
+ import { DistributiveOmit } from "../types/distributive.js";
2
+ import { HuiStyleProps } from "../types/hui-component.js";
3
+ import "../components/index.js";
1
4
  import { AlertProps } from "../components/alert/alert.js";
2
5
  import { AnchorProps } from "../components/anchor/anchor.js";
3
6
  import { AvatarProps } from "../components/avatar/avatar.js";
@@ -5,6 +8,8 @@ import { BlockquoteProps } from "../components/blockquote/blockquote.js";
5
8
  import { ButtonProps } from "../components/button/button.js";
6
9
  import { CheckboxProps } from "../components/checkbox/checkbox.js";
7
10
  import { CodeProps } from "../components/code/code.js";
11
+ import { LabelProps } from "../components/label/label.js";
12
+ import { ComboboxProps } from "../components/combobox/combobox.js";
8
13
  import { DetailsProps } from "../components/details/details.js";
9
14
  import { HeadingProps } from "../components/heading/heading.js";
10
15
  import { DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps } from "../components/dialog/dialog.js";
@@ -12,9 +17,11 @@ import { DdProps, DlProps, DtProps } from "../components/dl/dl.js";
12
17
  import { DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps } from "../components/drawer/drawer.js";
13
18
  import { FieldsetProps } from "../components/fieldset/fieldset.js";
14
19
  import { HrProps } from "../components/hr/hr.js";
15
- import { LabelProps } from "../components/label/label.js";
20
+ import { InlineFeedbackProps } from "../components/inline-feedback/inline-feedback.js";
16
21
  import { InputProps } from "../components/input/input.js";
17
22
  import { MenuContentProps, MenuItemProps, MenuProps, MenuTriggerProps } from "../components/menu/menu.js";
23
+ import { TagProps } from "../components/tag/tag.js";
24
+ import { MultiComboboxProps } from "../components/multi-combobox/multi-combobox.js";
18
25
  import { ParagraphProps } from "../components/paragraph/paragraph.js";
19
26
  import { PopoverContentProps, PopoverProps, PopoverTriggerProps } from "../components/popover/popover.js";
20
27
  import { ProgressProps } from "../components/progress/progress.js";
@@ -23,14 +30,16 @@ import { RadiogroupProps } from "../components/radiogroup/radiogroup.js";
23
30
  import { SectionProps } from "../components/section/section.js";
24
31
  import { SegmentedControlItemProps, SegmentedControlProps } from "../components/segmented-control/segmented-control.js";
25
32
  import { SelectProps } from "../components/select/select.js";
33
+ import { SkipLinkProps } from "../components/skip-link/skip-link.js";
34
+ import { StatusIconProps } from "../components/status-icon/status-icon.js";
26
35
  import { CaptionProps, TableProps, TbodyProps, TdProps, TfootProps, ThProps, TheadProps, TrProps } from "../components/table/table.js";
27
36
  import { TabsListProps, TabsPanelProps, TabsProps, TabsTabProps } from "../components/tabs/tabs.js";
37
+ import { TextProps } from "../components/text/text.js";
28
38
  import { TextareaProps } from "../components/textarea/textarea.js";
29
39
  import { TooltipContentProps, TooltipProps, TooltipTriggerProps } from "../components/tooltip/tooltip.js";
30
40
  import { VisuallyHiddenProps } from "../components/visually-hidden/visually-hidden.js";
31
- import "../components/index.js";
32
- import { CSSProperties } from "react";
33
- //#region src/provider/hui-provider.context.d.ts
41
+ import "../types/index.js";
42
+ import { CSSProperties, ElementType } from "react";
34
43
  export interface HuiComponentPropsMap {
35
44
  Alert: Partial<AlertProps>;
36
45
  Anchor: Partial<AnchorProps>;
@@ -39,6 +48,7 @@ export interface HuiComponentPropsMap {
39
48
  Button: Partial<ButtonProps>;
40
49
  Checkbox: Partial<CheckboxProps>;
41
50
  Code: Partial<CodeProps>;
51
+ Combobox: Partial<ComboboxProps>;
42
52
  Details: Partial<DetailsProps>;
43
53
  Dialog: Partial<DialogProps>;
44
54
  DialogTrigger: Partial<DialogTriggerProps>;
@@ -54,12 +64,14 @@ export interface HuiComponentPropsMap {
54
64
  Fieldset: Partial<FieldsetProps>;
55
65
  Heading: Partial<HeadingProps>;
56
66
  Hr: Partial<HrProps>;
67
+ InlineFeedback: Partial<InlineFeedbackProps>;
57
68
  Input: Partial<InputProps>;
58
69
  Label: Partial<LabelProps>;
59
70
  Menu: Partial<MenuProps>;
60
71
  MenuContent: Partial<MenuContentProps>;
61
72
  MenuItem: Partial<MenuItemProps>;
62
73
  MenuTrigger: Partial<MenuTriggerProps>;
74
+ MultiCombobox: Partial<MultiComboboxProps>;
63
75
  Paragraph: Partial<ParagraphProps>;
64
76
  Popover: Partial<PopoverProps>;
65
77
  PopoverTrigger: Partial<PopoverTriggerProps>;
@@ -71,6 +83,8 @@ export interface HuiComponentPropsMap {
71
83
  Select: Partial<SelectProps>;
72
84
  SegmentedControlItem: Partial<SegmentedControlItemProps>;
73
85
  SegmentedControl: Partial<SegmentedControlProps<string>>;
86
+ SkipLink: Partial<SkipLinkProps>;
87
+ StatusIcon: Partial<StatusIconProps>;
74
88
  Table: Partial<TableProps>;
75
89
  TableCaption: Partial<CaptionProps>;
76
90
  TableThead: Partial<TheadProps>;
@@ -83,6 +97,8 @@ export interface HuiComponentPropsMap {
83
97
  TabsList: Partial<TabsListProps>;
84
98
  TabsTab: Partial<TabsTabProps>;
85
99
  TabsPanel: Partial<TabsPanelProps>;
100
+ Tag: Partial<TagProps>;
101
+ Text: Partial<TextProps>;
86
102
  Textarea: Partial<TextareaProps>;
87
103
  Tooltip: Partial<TooltipProps>;
88
104
  TooltipTrigger: Partial<TooltipTriggerProps>;
@@ -91,14 +107,22 @@ export interface HuiComponentPropsMap {
91
107
  }
92
108
  type HuiComponentName = keyof HuiComponentPropsMap;
93
109
  type HuiDefaultProps = Partial<HuiComponentPropsMap>;
110
+ type HuiComponentSlots<K extends HuiComponentName> = { [P in HuiComponentName]: HuiComponentPropsMap[P] extends {
111
+ classNames?: infer C;
112
+ } ? Extract<keyof NonNullable<C>, string> : never; }[K];
113
+ type HuiStyledComponentName = { [K in HuiComponentName]: [HuiComponentSlots<K>] extends [never] ? never : K; }[HuiComponentName];
94
114
  export interface HuiProviderContextValue {
95
115
  defaultProps: HuiDefaultProps;
96
116
  }
97
117
  export declare const HuiProviderContext: import("react").Context<HuiProviderContextValue | null>;
98
118
  export declare function useHuiProviderContext(): HuiProviderContextValue;
99
- export declare function useHuiProps<K extends HuiComponentName, P extends object>(key: K, rawProps: P): P;
100
- export declare function useHuiClassNames<K extends HuiComponentName, S extends string>(key: K, recipe: Record<S, string>, rawClassNames?: Partial<Record<S, string | undefined>>): Record<S, string>;
101
- export declare function useHuiStyles<K extends HuiComponentName, S extends string>(key: K, rawStyles?: Partial<Record<S, CSSProperties | undefined>>): Partial<Record<S, CSSProperties>>;
102
- //#endregion
103
- export {};
104
- //# sourceMappingURL=hui-provider.context.d.ts.map
119
+ declare const STYLING_PROPS: readonly ["className", "style", "classNames", "styles"];
120
+ type HuiProps<P extends object, E extends ElementType> = DistributiveOmit<P, typeof STYLING_PROPS[number] | "as"> & Pick<{
121
+ as?: E | undefined;
122
+ }, "as" & keyof P>;
123
+ export declare function useHuiProps<K extends HuiComponentName, P extends object, E extends ElementType = Extract<P["as" & keyof P], ElementType>>(key: K, rawProps: P & {
124
+ as?: E | undefined;
125
+ }): HuiProps<P, E>;
126
+ export declare function useHuiClassNames<K extends HuiStyledComponentName>(key: K, recipe: Record<HuiComponentSlots<NoInfer<K>>, string>, rawProps?: Pick<HuiStyleProps<HuiComponentSlots<NoInfer<K>>>, "className" | "classNames">): Record<HuiComponentSlots<K>, string>;
127
+ export declare function useHuiStyles<K extends HuiStyledComponentName>(key: K, rawProps?: Pick<HuiStyleProps<HuiComponentSlots<NoInfer<K>>>, "style" | "styles">): Partial<Record<HuiComponentSlots<K>, CSSProperties>>;
128
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { mergeProps } from "./merge-props.js";
2
2
  import { ccAll, msAll } from "@hebium-ui/core";
3
3
  import { createContext, useContext, useMemo } from "react";
4
- //#region src/provider/hui-provider.context.ts
4
+ // src/provider/hui-provider.context.ts
5
5
  const HuiProviderContext = createContext(null);
6
6
  function useHuiProviderContext() {
7
7
  return useContext(HuiProviderContext) ?? { defaultProps: {} };
@@ -9,28 +9,35 @@ function useHuiProviderContext() {
9
9
  function useHuiDefaultProps(key) {
10
10
  return useHuiProviderContext().defaultProps[key];
11
11
  }
12
+ function useHuiStyleDefaultProps(key) {
13
+ return useHuiDefaultProps(key);
14
+ }
15
+ const STYLING_PROPS = [
16
+ "className",
17
+ "style",
18
+ "classNames",
19
+ "styles"
20
+ ];
12
21
  function useHuiProps(key, rawProps) {
13
22
  const defaultProps = useHuiDefaultProps(key);
14
23
  return useMemo(() => {
15
- if (typeof defaultProps === "undefined") return rawProps;
16
- return mergeProps(defaultProps, rawProps);
24
+ const props = mergeProps(defaultProps ?? {}, rawProps);
25
+ for (const prop of STYLING_PROPS) delete props[prop];
26
+ return props;
17
27
  }, [defaultProps, rawProps]);
18
28
  }
19
- function useHuiClassNames(key, recipe, rawClassNames = {}) {
20
- const defaultProps = useHuiDefaultProps(key);
21
- if (!defaultProps) return ccAll(recipe, rawClassNames);
22
- if ("classNames" in defaultProps && defaultProps.classNames) return ccAll(recipe, defaultProps.classNames, rawClassNames);
23
- else if ("className" in defaultProps && defaultProps.className) return ccAll(recipe, { root: defaultProps.className }, rawClassNames);
24
- else return ccAll(recipe, rawClassNames);
29
+ function useHuiClassNames(key, recipe, rawProps = {}) {
30
+ const defaultProps = useHuiStyleDefaultProps(key);
31
+ const emptyClassNames = {};
32
+ return ccAll(recipe, { root: defaultProps?.className }, defaultProps?.classNames ?? emptyClassNames, { root: rawProps.className }, rawProps.classNames ?? emptyClassNames);
25
33
  }
26
- function useHuiStyles(key, rawStyles = {}) {
27
- const defaultProps = useHuiDefaultProps(key);
28
- if (!defaultProps) return rawStyles ?? {};
29
- if ("styles" in defaultProps && defaultProps.styles) return msAll(defaultProps.styles, rawStyles);
30
- else if ("style" in defaultProps && defaultProps.style) return msAll({ root: defaultProps.style }, rawStyles);
31
- else return rawStyles ?? {};
34
+ function resolveStyles(props = {}) {
35
+ return msAll({ root: props.style }, props.styles ?? {});
36
+ }
37
+ function useHuiStyles(key, rawProps = {}) {
38
+ const defaultProps = useHuiStyleDefaultProps(key);
39
+ return msAll(resolveStyles(defaultProps), resolveStyles(rawProps));
32
40
  }
33
- //#endregion
34
41
  export { HuiProviderContext, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles };
35
42
 
36
43
  //# sourceMappingURL=hui-provider.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hui-provider.context.js","names":[],"sources":["../../src/provider/hui-provider.context.ts"],"sourcesContent":["import { ccAll, msAll } from \"@hebium-ui/core\";\nimport { createContext, type CSSProperties, useContext, useMemo } from \"react\";\nimport type {\n AlertProps,\n AnchorProps,\n AvatarProps,\n BlockquoteProps,\n ButtonProps,\n CaptionProps,\n CheckboxProps,\n CodeProps,\n DdProps,\n DetailsProps,\n DialogCloseProps,\n DialogContentProps,\n DialogProps,\n DialogTriggerProps,\n DlProps,\n DrawerCloseProps,\n DrawerContentProps,\n DrawerProps,\n DrawerTriggerProps,\n DtProps,\n FieldsetProps,\n HeadingProps,\n HrProps,\n InputProps,\n LabelProps,\n MenuContentProps,\n MenuItemProps,\n MenuProps,\n MenuTriggerProps,\n ParagraphProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTriggerProps,\n ProgressProps,\n RadiogroupProps,\n RadioProps,\n SectionProps,\n SegmentedControlItemProps,\n SegmentedControlProps,\n SelectProps,\n TableProps,\n TabsListProps,\n TabsPanelProps,\n TabsProps,\n TabsTabProps,\n TbodyProps,\n TdProps,\n TextareaProps,\n TfootProps,\n TheadProps,\n ThProps,\n TooltipContentProps,\n TooltipProps,\n TooltipTriggerProps,\n TrProps,\n VisuallyHiddenProps,\n} from \"~/components\";\nimport { mergeProps } from \"./merge-props\";\n\nexport interface HuiComponentPropsMap {\n Alert: Partial<AlertProps>;\n Anchor: Partial<AnchorProps>;\n Avatar: Partial<AvatarProps>;\n Blockquote: Partial<BlockquoteProps>;\n Button: Partial<ButtonProps>;\n Checkbox: Partial<CheckboxProps>;\n Code: Partial<CodeProps>;\n Details: Partial<DetailsProps>;\n Dialog: Partial<DialogProps>;\n DialogTrigger: Partial<DialogTriggerProps>;\n DialogContent: Partial<DialogContentProps>;\n DialogClose: Partial<DialogCloseProps>;\n Drawer: Partial<DrawerProps>;\n DrawerTrigger: Partial<DrawerTriggerProps>;\n DrawerContent: Partial<DrawerContentProps>;\n DrawerClose: Partial<DrawerCloseProps>;\n Dl: Partial<DlProps>;\n DlDt: Partial<DtProps>;\n DlDd: Partial<DdProps>;\n Fieldset: Partial<FieldsetProps>;\n Heading: Partial<HeadingProps>;\n Hr: Partial<HrProps>;\n Input: Partial<InputProps>;\n Label: Partial<LabelProps>;\n Menu: Partial<MenuProps>;\n MenuContent: Partial<MenuContentProps>;\n MenuItem: Partial<MenuItemProps>;\n MenuTrigger: Partial<MenuTriggerProps>;\n Paragraph: Partial<ParagraphProps>;\n Popover: Partial<PopoverProps>;\n PopoverTrigger: Partial<PopoverTriggerProps>;\n PopoverContent: Partial<PopoverContentProps>;\n Progress: Partial<ProgressProps>;\n Radio: Partial<RadioProps>;\n Radiogroup: Partial<RadiogroupProps>;\n Section: Partial<SectionProps>;\n Select: Partial<SelectProps>;\n SegmentedControlItem: Partial<SegmentedControlItemProps>;\n SegmentedControl: Partial<SegmentedControlProps<string>>;\n Table: Partial<TableProps>;\n TableCaption: Partial<CaptionProps>;\n TableThead: Partial<TheadProps>;\n TableTbody: Partial<TbodyProps>;\n TableTfoot: Partial<TfootProps>;\n TableTr: Partial<TrProps>;\n TableTh: Partial<ThProps>;\n TableTd: Partial<TdProps>;\n Tabs: Partial<TabsProps<string>>;\n TabsList: Partial<TabsListProps>;\n TabsTab: Partial<TabsTabProps>;\n TabsPanel: Partial<TabsPanelProps>;\n Textarea: Partial<TextareaProps>;\n Tooltip: Partial<TooltipProps>;\n TooltipTrigger: Partial<TooltipTriggerProps>;\n TooltipContent: Partial<TooltipContentProps>;\n VisuallyHidden: Partial<VisuallyHiddenProps>;\n}\n\ntype HuiComponentName = keyof HuiComponentPropsMap;\ntype HuiDefaultProps = Partial<HuiComponentPropsMap>;\n\nexport interface HuiProviderContextValue {\n defaultProps: HuiDefaultProps;\n}\n\nexport const HuiProviderContext = createContext<HuiProviderContextValue | null>(null);\n\nexport function useHuiProviderContext(): HuiProviderContextValue {\n const context = useContext(HuiProviderContext);\n return context ?? { defaultProps: {} };\n}\n\nfunction useHuiDefaultProps<K extends HuiComponentName>(key: K): HuiDefaultProps[K] {\n const ctx = useHuiProviderContext();\n return ctx.defaultProps[key];\n}\n\nexport function useHuiProps<K extends HuiComponentName, P extends object>(\n key: K,\n rawProps: P,\n): P {\n const defaultProps = useHuiDefaultProps(key);\n const props = useMemo(() => {\n if (typeof defaultProps === \"undefined\") {\n return rawProps;\n }\n\n return mergeProps(defaultProps as Partial<P>, rawProps);\n }, [defaultProps, rawProps]);\n return props as P;\n}\n\nexport function useHuiClassNames<K extends HuiComponentName, S extends string>(\n key: K,\n recipe: Record<S, string>,\n rawClassNames: Partial<Record<S, string | undefined>> = {},\n): Record<S, string> {\n const defaultProps = useHuiDefaultProps(key);\n if (!defaultProps) return ccAll(recipe, rawClassNames);\n\n if (\"classNames\" in defaultProps && defaultProps.classNames) {\n return ccAll(recipe, defaultProps.classNames as Record<S, string>, rawClassNames);\n } else if (\"className\" in defaultProps && defaultProps.className) {\n return ccAll(recipe, { root: defaultProps.className } as Record<S, string>, rawClassNames);\n } else {\n return ccAll(recipe, rawClassNames);\n }\n}\n\nexport function useHuiStyles<K extends HuiComponentName, S extends string>(\n key: K,\n rawStyles: Partial<Record<S, CSSProperties | undefined>> = {},\n): Partial<Record<S, CSSProperties>> {\n const defaultProps = useHuiDefaultProps(key);\n if (!defaultProps) return rawStyles ?? {};\n\n if (\"styles\" in defaultProps && defaultProps.styles) {\n return msAll(defaultProps.styles as Partial<Record<S, CSSProperties>>, rawStyles);\n } else if (\"style\" in defaultProps && defaultProps.style) {\n return msAll({ root: defaultProps.style } as Partial<Record<S, CSSProperties>>, rawStyles);\n } else {\n return rawStyles ?? {};\n }\n}\n"],"mappings":";;;;AAgIA,MAAa,qBAAqB,cAA8C,IAAI;AAEpF,SAAgB,wBAAiD;CAE/D,OADgB,WAAW,kBACd,KAAK,EAAE,cAAc,CAAC,EAAE;AACvC;AAEA,SAAS,mBAA+C,KAA4B;CAElF,OADY,sBACH,CAAC,CAAC,aAAa;AAC1B;AAEA,SAAgB,YACd,KACA,UACG;CACH,MAAM,eAAe,mBAAmB,GAAG;CAQ3C,OAPc,cAAc;EAC1B,IAAI,OAAO,iBAAiB,aAC1B,OAAO;EAGT,OAAO,WAAW,cAA4B,QAAQ;CACxD,GAAG,CAAC,cAAc,QAAQ,CACf;AACb;AAEA,SAAgB,iBACd,KACA,QACA,gBAAwD,CAAC,GACtC;CACnB,MAAM,eAAe,mBAAmB,GAAG;CAC3C,IAAI,CAAC,cAAc,OAAO,MAAM,QAAQ,aAAa;CAErD,IAAI,gBAAgB,gBAAgB,aAAa,YAC/C,OAAO,MAAM,QAAQ,aAAa,YAAiC,aAAa;MAC3E,IAAI,eAAe,gBAAgB,aAAa,WACrD,OAAO,MAAM,QAAQ,EAAE,MAAM,aAAa,UAAU,GAAwB,aAAa;MAEzF,OAAO,MAAM,QAAQ,aAAa;AAEtC;AAEA,SAAgB,aACd,KACA,YAA2D,CAAC,GACzB;CACnC,MAAM,eAAe,mBAAmB,GAAG;CAC3C,IAAI,CAAC,cAAc,OAAO,aAAa,CAAC;CAExC,IAAI,YAAY,gBAAgB,aAAa,QAC3C,OAAO,MAAM,aAAa,QAA6C,SAAS;MAC3E,IAAI,WAAW,gBAAgB,aAAa,OACjD,OAAO,MAAM,EAAE,MAAM,aAAa,MAAM,GAAwC,SAAS;MAEzF,OAAO,aAAa,CAAC;AAEzB"}
1
+ {"version":3,"file":"hui-provider.context.js","names":[],"sources":["../../src/provider/hui-provider.context.ts"],"sourcesContent":["import { ccAll, msAll } from \"@hebium-ui/core\";\nimport { createContext, type CSSProperties, type ElementType, useContext, useMemo } from \"react\";\nimport type {\n AlertProps,\n AnchorProps,\n AvatarProps,\n BlockquoteProps,\n ButtonProps,\n CaptionProps,\n CheckboxProps,\n CodeProps,\n ComboboxProps,\n DdProps,\n DetailsProps,\n DialogCloseProps,\n DialogContentProps,\n DialogProps,\n DialogTriggerProps,\n DlProps,\n DrawerCloseProps,\n DrawerContentProps,\n DrawerProps,\n DrawerTriggerProps,\n DtProps,\n FieldsetProps,\n HeadingProps,\n HrProps,\n InlineFeedbackProps,\n InputProps,\n LabelProps,\n MenuContentProps,\n MenuItemProps,\n MenuProps,\n MenuTriggerProps,\n MultiComboboxProps,\n ParagraphProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTriggerProps,\n ProgressProps,\n RadiogroupProps,\n RadioProps,\n SectionProps,\n SegmentedControlItemProps,\n SegmentedControlProps,\n SelectProps,\n SkipLinkProps,\n StatusIconProps,\n TableProps,\n TabsListProps,\n TabsPanelProps,\n TabsProps,\n TabsTabProps,\n TagProps,\n TbodyProps,\n TdProps,\n TextareaProps,\n TextProps,\n TfootProps,\n TheadProps,\n ThProps,\n TooltipContentProps,\n TooltipProps,\n TooltipTriggerProps,\n TrProps,\n VisuallyHiddenProps,\n} from \"~/components\";\nimport { type DistributiveOmit, type HuiStyleProps } from \"~/types\";\nimport { mergeProps } from \"./merge-props\";\n\nexport interface HuiComponentPropsMap {\n Alert: Partial<AlertProps>;\n Anchor: Partial<AnchorProps>;\n Avatar: Partial<AvatarProps>;\n Blockquote: Partial<BlockquoteProps>;\n Button: Partial<ButtonProps>;\n Checkbox: Partial<CheckboxProps>;\n Code: Partial<CodeProps>;\n Combobox: Partial<ComboboxProps>;\n Details: Partial<DetailsProps>;\n Dialog: Partial<DialogProps>;\n DialogTrigger: Partial<DialogTriggerProps>;\n DialogContent: Partial<DialogContentProps>;\n DialogClose: Partial<DialogCloseProps>;\n Drawer: Partial<DrawerProps>;\n DrawerTrigger: Partial<DrawerTriggerProps>;\n DrawerContent: Partial<DrawerContentProps>;\n DrawerClose: Partial<DrawerCloseProps>;\n Dl: Partial<DlProps>;\n DlDt: Partial<DtProps>;\n DlDd: Partial<DdProps>;\n Fieldset: Partial<FieldsetProps>;\n Heading: Partial<HeadingProps>;\n Hr: Partial<HrProps>;\n InlineFeedback: Partial<InlineFeedbackProps>;\n Input: Partial<InputProps>;\n Label: Partial<LabelProps>;\n Menu: Partial<MenuProps>;\n MenuContent: Partial<MenuContentProps>;\n MenuItem: Partial<MenuItemProps>;\n MenuTrigger: Partial<MenuTriggerProps>;\n MultiCombobox: Partial<MultiComboboxProps>;\n Paragraph: Partial<ParagraphProps>;\n Popover: Partial<PopoverProps>;\n PopoverTrigger: Partial<PopoverTriggerProps>;\n PopoverContent: Partial<PopoverContentProps>;\n Progress: Partial<ProgressProps>;\n Radio: Partial<RadioProps>;\n Radiogroup: Partial<RadiogroupProps>;\n Section: Partial<SectionProps>;\n Select: Partial<SelectProps>;\n SegmentedControlItem: Partial<SegmentedControlItemProps>;\n SegmentedControl: Partial<SegmentedControlProps<string>>;\n SkipLink: Partial<SkipLinkProps>;\n StatusIcon: Partial<StatusIconProps>;\n Table: Partial<TableProps>;\n TableCaption: Partial<CaptionProps>;\n TableThead: Partial<TheadProps>;\n TableTbody: Partial<TbodyProps>;\n TableTfoot: Partial<TfootProps>;\n TableTr: Partial<TrProps>;\n TableTh: Partial<ThProps>;\n TableTd: Partial<TdProps>;\n Tabs: Partial<TabsProps<string>>;\n TabsList: Partial<TabsListProps>;\n TabsTab: Partial<TabsTabProps>;\n TabsPanel: Partial<TabsPanelProps>;\n Tag: Partial<TagProps>;\n Text: Partial<TextProps>;\n Textarea: Partial<TextareaProps>;\n Tooltip: Partial<TooltipProps>;\n TooltipTrigger: Partial<TooltipTriggerProps>;\n TooltipContent: Partial<TooltipContentProps>;\n VisuallyHidden: Partial<VisuallyHiddenProps>;\n}\n\ntype HuiComponentName = keyof HuiComponentPropsMap;\ntype HuiDefaultProps = Partial<HuiComponentPropsMap>;\n\ntype HuiComponentSlots<K extends HuiComponentName> = {\n [P in HuiComponentName]: HuiComponentPropsMap[P] extends { classNames?: infer C }\n ? Extract<keyof NonNullable<C>, string>\n : never;\n}[K];\n\ntype HuiStyledComponentName = {\n [K in HuiComponentName]: [HuiComponentSlots<K>] extends [never] ? never : K;\n}[HuiComponentName];\n\nexport interface HuiProviderContextValue {\n defaultProps: HuiDefaultProps;\n}\n\nexport const HuiProviderContext = createContext<HuiProviderContextValue | null>(null);\n\nexport function useHuiProviderContext(): HuiProviderContextValue {\n const context = useContext(HuiProviderContext);\n return context ?? { defaultProps: {} };\n}\n\nfunction useHuiDefaultProps<K extends HuiComponentName>(key: K): HuiDefaultProps[K] {\n const ctx = useHuiProviderContext();\n return ctx.defaultProps[key];\n}\n\nfunction useHuiStyleDefaultProps<K extends HuiStyledComponentName>(\n key: K,\n): HuiStyleProps<HuiComponentSlots<K>> | undefined {\n return useHuiDefaultProps(key);\n}\n\nconst STYLING_PROPS = [\"className\", \"style\", \"classNames\", \"styles\"] as const;\n\n// Keep `as` explicit so JSX element inference survives omission of generic props.\ntype HuiProps<P extends object, E extends ElementType> =\n & DistributiveOmit<P, typeof STYLING_PROPS[number] | \"as\">\n & Pick<{ as?: E | undefined }, \"as\" & keyof P>;\n\nexport function useHuiProps<\n K extends HuiComponentName,\n P extends object,\n E extends ElementType = Extract<P[\"as\" & keyof P], ElementType>,\n>(\n key: K,\n rawProps: P & { as?: E | undefined },\n): HuiProps<P, E> {\n const defaultProps = useHuiDefaultProps(key);\n return useMemo(() => {\n const props = mergeProps((defaultProps ?? {}) as Partial<P>, rawProps);\n // Styling helpers resolve Provider and local values separately from rawProps.\n for (const prop of STYLING_PROPS) {\n delete props[prop as keyof P];\n }\n // Runtime removal establishes the distributive shape, which TypeScript cannot infer for generic P.\n return props as unknown as HuiProps<P, E>;\n }, [defaultProps, rawProps]);\n}\n\nexport function useHuiClassNames<K extends HuiStyledComponentName>(\n key: K,\n recipe: Record<HuiComponentSlots<NoInfer<K>>, string>,\n rawProps: Pick<HuiStyleProps<HuiComponentSlots<NoInfer<K>>>, \"className\" | \"classNames\"> = {},\n): Record<HuiComponentSlots<K>, string> {\n const defaultProps = useHuiStyleDefaultProps(key);\n const emptyClassNames: Partial<Record<HuiComponentSlots<K>, string | undefined>> = {};\n return ccAll<HuiComponentSlots<K>>(\n recipe,\n { root: defaultProps?.className } as Partial<Record<HuiComponentSlots<K>, string | undefined>>,\n defaultProps?.classNames ?? emptyClassNames,\n { root: rawProps.className } as Partial<Record<HuiComponentSlots<K>, string | undefined>>,\n rawProps.classNames ?? emptyClassNames,\n );\n}\n\nfunction resolveStyles<S extends string>(\n props: Pick<HuiStyleProps<S>, \"style\" | \"styles\"> = {},\n): Partial<Record<S, CSSProperties>> {\n return msAll(\n { root: props.style } as Partial<Record<S, CSSProperties | undefined>>,\n props.styles ?? {},\n );\n}\n\nexport function useHuiStyles<K extends HuiStyledComponentName>(\n key: K,\n rawProps: Pick<HuiStyleProps<HuiComponentSlots<NoInfer<K>>>, \"style\" | \"styles\"> = {},\n): Partial<Record<HuiComponentSlots<K>, CSSProperties>> {\n const defaultProps = useHuiStyleDefaultProps(key);\n return msAll(resolveStyles<HuiComponentSlots<K>>(defaultProps), resolveStyles<HuiComponentSlots<K>>(rawProps));\n}\n"],"mappings":";;;;AAyJA,MAAa,qBAAqB,cAA8C,IAAI;AAEpF,SAAgB,wBAAiD;CAE/D,OADgB,WAAW,kBACd,KAAK,EAAE,cAAc,CAAC,EAAE;AACvC;AAEA,SAAS,mBAA+C,KAA4B;CAElF,OADY,sBACH,CAAC,CAAC,aAAa;AAC1B;AAEA,SAAS,wBACP,KACiD;CACjD,OAAO,mBAAmB,GAAG;AAC/B;AAEA,MAAM,gBAAgB;CAAC;CAAa;CAAS;CAAc;AAAQ;AAOnE,SAAgB,YAKd,KACA,UACgB;CAChB,MAAM,eAAe,mBAAmB,GAAG;CAC3C,OAAO,cAAc;EACnB,MAAM,QAAQ,WAAY,gBAAgB,CAAC,GAAkB,QAAQ;EAErE,KAAK,MAAM,QAAQ,eACjB,OAAO,MAAM;EAGf,OAAO;CACT,GAAG,CAAC,cAAc,QAAQ,CAAC;AAC7B;AAEA,SAAgB,iBACd,KACA,QACA,WAA2F,CAAC,GACtD;CACtC,MAAM,eAAe,wBAAwB,GAAG;CAChD,MAAM,kBAA6E,CAAC;CACpF,OAAO,MACL,QACA,EAAE,MAAM,cAAc,UAAU,GAChC,cAAc,cAAc,iBAC5B,EAAE,MAAM,SAAS,UAAU,GAC3B,SAAS,cAAc,eACzB;AACF;AAEA,SAAS,cACP,QAAoD,CAAC,GAClB;CACnC,OAAO,MACL,EAAE,MAAM,MAAM,MAAM,GACpB,MAAM,UAAU,CAAC,CACnB;AACF;AAEA,SAAgB,aACd,KACA,WAAmF,CAAC,GAC9B;CACtD,MAAM,eAAe,wBAAwB,GAAG;CAChD,OAAO,MAAM,cAAoC,YAAY,GAAG,cAAoC,QAAQ,CAAC;AAC/G"}
@@ -1,8 +1,5 @@
1
1
  import { HuiProviderContextValue } from "./hui-provider.context.js";
2
2
  import { PropsWithChildren, ReactElement } from "react";
3
- //#region src/provider/hui-provider.d.ts
4
3
  interface HuiProviderProps extends Partial<HuiProviderContextValue>, PropsWithChildren {}
5
4
  export declare function HuiProvider({ defaultProps, children }: HuiProviderProps): ReactElement;
6
- //#endregion
7
- export {};
8
- //# sourceMappingURL=hui-provider.d.ts.map
5
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { HuiProviderContext } from "./hui-provider.context.js";
2
2
  import { useMemo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
- //#region src/provider/hui-provider.tsx
4
+ // src/provider/hui-provider.tsx
5
5
  function HuiProvider({ defaultProps, children }) {
6
6
  const context = useMemo(() => {
7
7
  return { defaultProps: defaultProps ?? {} };
@@ -11,7 +11,6 @@ function HuiProvider({ defaultProps, children }) {
11
11
  children
12
12
  });
13
13
  }
14
- //#endregion
15
14
  export { HuiProvider };
16
15
 
17
16
  //# sourceMappingURL=hui-provider.js.map
@@ -1,3 +1,3 @@
1
- import { HuiComponentPropsMap, HuiProviderContext, HuiProviderContextValue, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles } from "./hui-provider.context.js";
2
1
  import { HuiProvider } from "./hui-provider.js";
2
+ import { HuiComponentPropsMap, HuiProviderContext, HuiProviderContextValue, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles } from "./hui-provider.context.js";
3
3
  export { HuiComponentPropsMap, HuiProvider, HuiProviderContext, HuiProviderContextValue, useHuiClassNames, useHuiProps, useHuiProviderContext, useHuiStyles };
@@ -1,4 +1,4 @@
1
- //#region src/provider/merge-props.ts
1
+ // src/provider/merge-props.ts
2
2
  function mergeProps(defaultProps, rawProps) {
3
3
  const filteredProps = {};
4
4
  for (const key of Object.keys(rawProps)) {
@@ -10,7 +10,6 @@ function mergeProps(defaultProps, rawProps) {
10
10
  ...filteredProps
11
11
  };
12
12
  }
13
- //#endregion
14
13
  export { mergeProps };
15
14
 
16
15
  //# sourceMappingURL=merge-props.js.map
@@ -0,0 +1 @@
1
+ export type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;