@hebium-ui/react 0.1.0-alpha.3 → 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.
- package/dist/components/alert/alert.d.ts +3 -4
- package/dist/components/alert/alert.js +4 -11
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/anchor/anchor.d.ts +1 -2
- package/dist/components/anchor/anchor.js +2 -2
- package/dist/components/anchor/anchor.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.js +2 -2
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/blockquote/blockquote.d.ts +1 -2
- package/dist/components/blockquote/blockquote.js +2 -2
- package/dist/components/blockquote/blockquote.js.map +1 -1
- package/dist/components/button/button.d.ts +12 -2
- package/dist/components/button/button.js +29 -9
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -2
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code/code.d.ts +1 -2
- package/dist/components/code/code.js +2 -2
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/combobox/combobox-option.js +33 -0
- package/dist/components/combobox/combobox-option.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +61 -0
- package/dist/components/combobox/combobox.js +208 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/use-combobox-form.js +33 -0
- package/dist/components/combobox/use-combobox-form.js.map +1 -0
- package/dist/components/combobox/use-combobox-popover.js +66 -0
- package/dist/components/combobox/use-combobox-popover.js.map +1 -0
- package/dist/components/combobox/use-combobox-state.js +96 -0
- package/dist/components/combobox/use-combobox-state.js.map +1 -0
- package/dist/components/details/details.d.ts +1 -2
- package/dist/components/details/details.js +2 -2
- package/dist/components/details/details.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +4 -5
- package/dist/components/dialog/dialog.js +26 -13
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/index.d.ts +1 -2
- package/dist/components/dl/dl.d.ts +1 -2
- package/dist/components/dl/dl.js +6 -6
- package/dist/components/dl/dl.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +4 -5
- package/dist/components/drawer/drawer.js +26 -13
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -2
- package/dist/components/fieldset/fieldset.d.ts +1 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/fieldset/fieldset.js.map +1 -1
- package/dist/components/heading/heading.d.ts +1 -2
- package/dist/components/heading/heading.js +2 -2
- package/dist/components/heading/heading.js.map +1 -1
- package/dist/components/hr/hr.d.ts +1 -2
- package/dist/components/hr/hr.js +2 -2
- package/dist/components/hr/hr.js.map +1 -1
- package/dist/components/index.d.ts +32 -27
- package/dist/components/inline-feedback/index.d.ts +2 -0
- package/dist/components/inline-feedback/inline-feedback.d.ts +33 -0
- package/dist/components/inline-feedback/inline-feedback.js +30 -0
- package/dist/components/inline-feedback/inline-feedback.js.map +1 -0
- package/dist/components/input/input.d.ts +1 -2
- package/dist/components/input/input.js +2 -2
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/label/label.d.ts +1 -2
- package/dist/components/label/label.js +4 -4
- package/dist/components/label/label.js.map +1 -1
- package/dist/components/menu/index.d.ts +1 -2
- package/dist/components/menu/menu.d.ts +3 -4
- package/dist/components/menu/menu.js +20 -9
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/multi-combobox/index.d.ts +2 -0
- package/dist/components/multi-combobox/multi-combobox-option.js +42 -0
- package/dist/components/multi-combobox/multi-combobox-option.js.map +1 -0
- package/dist/components/multi-combobox/multi-combobox-tag.js +54 -0
- package/dist/components/multi-combobox/multi-combobox-tag.js.map +1 -0
- package/dist/components/multi-combobox/multi-combobox.d.ts +72 -0
- package/dist/components/multi-combobox/multi-combobox.js +249 -0
- package/dist/components/multi-combobox/multi-combobox.js.map +1 -0
- package/dist/components/multi-combobox/use-multi-combobox-state.js +91 -0
- package/dist/components/multi-combobox/use-multi-combobox-state.js.map +1 -0
- package/dist/components/paragraph/paragraph.d.ts +1 -2
- package/dist/components/paragraph/paragraph.js +2 -2
- package/dist/components/paragraph/paragraph.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -2
- package/dist/components/popover/popover.d.ts +3 -4
- package/dist/components/popover/popover.js +18 -7
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.d.ts +1 -2
- package/dist/components/progress/progress.js +2 -2
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/radio/radio.d.ts +1 -2
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radiogroup/radiogroup.d.ts +1 -2
- package/dist/components/radiogroup/radiogroup.js +5 -4
- package/dist/components/radiogroup/radiogroup.js.map +1 -1
- package/dist/components/section/section.d.ts +1 -2
- package/dist/components/section/section.js +2 -2
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +1 -2
- package/dist/components/segmented-control/segmented-control.js +10 -5
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.d.ts +1 -2
- package/dist/components/select/select.js +2 -2
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/skip-link/skip-link.d.ts +1 -2
- package/dist/components/skip-link/skip-link.js +2 -2
- package/dist/components/skip-link/skip-link.js.map +1 -1
- package/dist/components/status-icon/index.d.ts +2 -0
- package/dist/components/status-icon/status-icon.d.ts +19 -0
- package/dist/components/status-icon/status-icon.js +22 -0
- package/dist/components/status-icon/status-icon.js.map +1 -0
- package/dist/components/table/table.d.ts +4 -5
- package/dist/components/table/table.js +16 -16
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.context.d.ts +1 -2
- package/dist/components/tabs/tabs.d.ts +1 -2
- package/dist/components/tabs/tabs.js +8 -8
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/tag.d.ts +39 -0
- package/dist/components/tag/tag.js +41 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/text/text.d.ts +1 -2
- package/dist/components/text/text.js +2 -2
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -2
- package/dist/components/textarea/textarea.js +2 -2
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +1 -2
- package/dist/components/tooltip/tooltip.d.ts +3 -4
- package/dist/components/tooltip/tooltip.js +17 -6
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.d.ts +1 -2
- package/dist/components/visually-hidden/visually-hidden.js +2 -2
- package/dist/components/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/provider/hui-provider.context.d.ts +23 -7
- package/dist/provider/hui-provider.context.js +13 -12
- package/dist/provider/hui-provider.context.js.map +1 -1
- package/dist/provider/hui-provider.d.ts +1 -2
- package/dist/provider/index.d.ts +1 -1
- package/dist/types/distributive.d.ts +1 -0
- package/dist/types/hui-component.d.ts +11 -5
- package/dist/types/index.d.ts +3 -2
- package/dist/types/polymorphic.d.ts +4 -9
- package/package.json +9 -9
- package/dist/components/dialog/dialog.context.d.ts +0 -2
- package/dist/components/drawer/drawer.context.d.ts +0 -2
- package/dist/components/menu/menu.context.d.ts +0 -2
- package/dist/components/popover/popover.context.d.ts +0 -2
- package/dist/components/tooltip/tooltip.context.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["import { type ButtonSlots, dialogControl, dialogRecipe, type DialogSlots, toStrbool } from \"@hebium-ui/core\";\nimport {\n type ComponentProps,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useId,\n useMemo,\n} from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps, type HuiPolymorphicProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Heading, type HeadingProps } from \"../heading\";\nimport { DialogContext, type DialogContextValue, useDialogContext, useDialogId } from \"./dialog.context\";\n\nexport interface DialogProps {\n /**\n * The id of the dialog content element.\n */\n id?: string | undefined;\n /**\n * Whether the dialog should open as a modal dialog.\n *\n * @default false\n */\n modal?: boolean | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction DialogRoot(rawProps: DialogProps): ReactElement {\n const {\n id,\n modal = false,\n children,\n } = useHuiProps(\"Dialog\", rawProps);\n\n const tmpId = useId();\n const dialogId = id || tmpId;\n const open = useCallback((): void => {\n dialogControl.openDialog(dialogId, modal);\n }, [dialogId, modal]);\n\n const contextValue = useMemo<DialogContextValue>(() => ({\n dialogId,\n modal,\n open,\n }), [dialogId, modal, open]);\n\n return (\n <DialogContext.Provider value={contextValue}>\n {children}\n </DialogContext.Provider>\n );\n}\n\nexport type DialogTriggerProps<E extends ElementType = typeof Button> = HuiPolymorphicProps<\n E,\n {},\n ButtonSlots\n>;\n\nfunction Trigger<E extends ElementType = typeof Button>(rawProps: DialogTriggerProps<E>): ReactNode {\n const {\n as,\n children,\n onClick,\n ...restProps\n } = useHuiProps(\"DialogTrigger\", rawProps);\n\n const Component = as ?? Button;\n const cls = useHuiClassNames(\"DialogTrigger\", { root: \"\" }, { root: rawProps[\"className\"] });\n const sls = useHuiStyles(\"DialogTrigger\", { root: rawProps[\"style\"] });\n const {\n dialogId,\n modal,\n open,\n } = useDialogContext();\n const attrs = normalizeAttributes(\n dialogControl.getTriggerAttributes(\n { id: dialogId },\n {\n modal,\n isButtonElement: as === undefined,\n },\n ),\n );\n\n const handleClick = useCallback((e: MouseEvent<HTMLElement>): void => {\n onClick?.(e);\n if (modal || e.defaultPrevented) return;\n\n open();\n }, [modal, onClick, open]);\n\n return (\n <Component\n {...attrs}\n className={cls.root}\n style={sls.root}\n onClick={handleClick}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n\ntype HtmlDialogProps = Omit<ComponentProps<\"dialog\">, \"children\" | \"id\" | \"open\">;\n\ninterface DialogContentOwnProps extends HtmlDialogProps {\n /**\n * The heading rendered at the top of the dialog content.\n */\n heading?: ReactNode | undefined;\n /**\n * Additional props passed to the internal heading component.\n */\n headingProps?: Omit<HeadingProps, \"children\" | \"id\" | \"className\" | \"style\"> | undefined;\n /**\n * The content rendered inside the internal close button. Set to `null` or `false` to hide the button.\n *\n * @default close icon\n */\n closeButton?: ReactNode | undefined;\n /**\n * Additional props passed to the internal close button.\n */\n closeButtonProps?: Omit<DialogCloseProps, \"children\" | \"className\" | \"style\"> | undefined;\n children?: ReactNode | undefined;\n}\nexport type DialogContentProps = HuiComponentProps<DialogContentOwnProps, DialogSlots>;\n\nfunction Content(rawProps: DialogContentProps): ReactElement {\n const {\n children,\n heading,\n headingProps,\n closeButton,\n closeButtonProps,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...restProps\n } = useHuiProps(\"DialogContent\", rawProps);\n\n const {\n dialogId,\n modal,\n } = useDialogContext();\n\n const resolvedHeading = heading !== undefined && heading !== null && heading !== false\n ? heading\n : undefined;\n const state = { id: dialogId };\n const attrs = normalizeAttributes(\n dialogControl.getContentAttributes(\n state,\n {\n hasHeading: resolvedHeading !== undefined,\n ariaLabel,\n ariaLabelledBy,\n },\n ),\n );\n const headingAttrs = normalizeAttributes(dialogControl.getHeadingAttributes(state));\n const headingId = resolvedHeading !== undefined ? headingAttrs.id : undefined;\n const headingLevel = headingProps?.level ?? 2;\n\n const recipe = dialogRecipe({ modal: toStrbool(modal) });\n const cls = useHuiClassNames(\"DialogContent\", recipe, rawProps.classNames);\n const sls = useHuiStyles(\"DialogContent\", rawProps.styles);\n\n const shouldRenderCloseButton = closeButton !== null && closeButton !== false;\n const shouldRenderHeader = headingId !== undefined || shouldRenderCloseButton;\n const closeButtonContent = closeButton === undefined\n ? <span aria-hidden className={cls.closeButtonIcon} style={sls.closeButtonIcon} />\n : closeButton;\n\n return (\n <dialog\n {...attrs}\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {shouldRenderHeader && (\n <div className={cls.header} style={sls.header}>\n {headingId && (\n <Heading\n margin=\"none\"\n {...headingProps}\n {...headingAttrs}\n className={cls.heading}\n style={sls.heading}\n level={headingLevel}\n >\n {resolvedHeading}\n </Heading>\n )}\n {shouldRenderCloseButton && (\n <Close\n className={cls.closeButton}\n style={sls.closeButton}\n aria-label=\"Close Dialog\"\n variant=\"ghost\"\n color=\"neutral\"\n shape=\"square\"\n {...closeButtonProps}\n >\n {closeButtonContent}\n </Close>\n )}\n </div>\n )}\n {children}\n </dialog>\n );\n}\n\nexport interface DialogCloseProps extends Omit<ButtonProps, \"as\"> {\n /**\n * The command used to close the dialog.\n *\n * @default \"request-close\"\n */\n command?: \"close\" | \"request-close\" | undefined;\n}\n\nfunction Close(rawProps: DialogCloseProps): ReactNode {\n const props = useHuiProps(\"DialogClose\", rawProps);\n const cls = useHuiClassNames(\"DialogClose\", { root: \"\" }, { root: rawProps.className });\n const sls = useHuiStyles(\"DialogClose\", { root: rawProps.style });\n const dialogId = useDialogId();\n const attrs = normalizeAttributes(dialogControl.getCloseAttributes({ id: dialogId }));\n\n return (\n <Button\n {...attrs}\n {...props}\n className={cls.root}\n style={sls.root}\n />\n );\n}\n\nexport const Dialog = Object.assign(DialogRoot, {\n Trigger,\n Content,\n Close,\n});\n"],"mappings":";;;;;;;;;AAgCA,SAAS,WAAW,UAAqC;CACvD,MAAM,EACJ,IACA,QAAQ,OACR,aACE,YAAY,UAAU,QAAQ;CAElC,MAAM,QAAQ,MAAM;CACpB,MAAM,WAAW,MAAM;CACvB,MAAM,OAAO,kBAAwB;EACnC,cAAc,WAAW,UAAU,KAAK;CAC1C,GAA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AoB,cAAc,mBAAmB,EAAE,IAAI,SAAS,CAAC,CAAC;CAEpF,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,GAAI;EACJ,WAAW,IAAI;EACf,OAAO,IAAI;CACZ,CAAA;AAEL;AAEA,MAAa,SAAS,OAAO,OAAO,YAAY;CAC9C;CACA;CACA;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["import { type ButtonSlots, dialogControl, dialogRecipe, type DialogSlots, toStrbool } from \"@hebium-ui/core\";\nimport {\n type ComponentProps,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useId,\n useMemo,\n} from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps, type HuiPolymorphicProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Heading, type HeadingProps } from \"../heading\";\nimport { DialogContext, type DialogContextValue, useDialogContext, useDialogId } from \"./dialog.context\";\n\nconst BUTTON_CLASSES = { root: \"\", content: \"\", spinner: \"\", status: \"\" } satisfies Record<ButtonSlots, string>;\n\nexport interface DialogProps {\n /**\n * The id of the dialog content element.\n */\n id?: string | undefined;\n /**\n * Whether the dialog should open as a modal dialog.\n *\n * @default false\n */\n modal?: boolean | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction DialogRoot(rawProps: DialogProps): ReactElement {\n const {\n id,\n modal = false,\n children,\n } = useHuiProps(\"Dialog\", rawProps);\n\n const tmpId = useId();\n const dialogId = id || tmpId;\n const open = useCallback((): void => {\n dialogControl.openDialog(dialogId, modal);\n }, [dialogId, modal]);\n\n const contextValue = useMemo<DialogContextValue>(() => ({\n dialogId,\n modal,\n open,\n }), [dialogId, modal, open]);\n\n return (\n <DialogContext.Provider value={contextValue}>\n {children}\n </DialogContext.Provider>\n );\n}\n\nexport type DialogTriggerProps<E extends ElementType = typeof Button<\"button\">> = HuiPolymorphicProps<\n E,\n {},\n ButtonSlots\n>;\n\nfunction Trigger<E extends ElementType = typeof Button<\"button\">>(rawProps: DialogTriggerProps<E>): ReactNode {\n const {\n as,\n children,\n onClick,\n ...restProps\n } = useHuiProps(\"DialogTrigger\", rawProps);\n\n const Component = as ?? Button;\n const cls = useHuiClassNames(\"DialogTrigger\", BUTTON_CLASSES, rawProps);\n const sls = useHuiStyles(\"DialogTrigger\", rawProps);\n const {\n dialogId,\n modal,\n open,\n } = useDialogContext();\n const attrs = normalizeAttributes(\n dialogControl.getTriggerAttributes(\n { id: dialogId },\n {\n modal,\n isButtonElement: as === undefined,\n },\n ),\n );\n\n const handleClick = useCallback((e: MouseEvent<HTMLElement>): void => {\n onClick?.(e);\n if (modal || e.defaultPrevented) return;\n\n open();\n }, [modal, onClick, open]);\n\n return (\n <Component\n {...attrs}\n {...(Component === Button\n ? { classNames: cls, styles: sls }\n : { className: cls.root, style: sls.root })}\n onClick={handleClick}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n\ntype HtmlDialogProps = Omit<ComponentProps<\"dialog\">, \"children\" | \"id\" | \"open\">;\n\ninterface DialogContentOwnProps extends HtmlDialogProps {\n /**\n * The heading rendered at the top of the dialog content.\n */\n heading?: ReactNode | undefined;\n /**\n * Additional props passed to the internal heading component.\n */\n headingProps?: Omit<HeadingProps, \"children\" | \"id\" | \"className\" | \"style\"> | undefined;\n /**\n * The content rendered inside the internal close button. Set to `null` or `false` to hide the button.\n *\n * @default close icon\n */\n closeButton?: ReactNode | undefined;\n /**\n * Additional props passed to the internal close button.\n */\n closeButtonProps?: Omit<DialogCloseProps, \"children\" | \"classNames\" | \"styles\"> | undefined;\n children?: ReactNode | undefined;\n}\nexport type DialogContentProps = HuiComponentProps<DialogContentOwnProps, DialogSlots>;\n\nfunction Content(rawProps: DialogContentProps): ReactElement {\n const {\n children,\n heading,\n headingProps,\n closeButton,\n closeButtonProps,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...restProps\n } = useHuiProps(\"DialogContent\", rawProps);\n\n const {\n dialogId,\n modal,\n } = useDialogContext();\n\n const resolvedHeading = heading !== undefined && heading !== null && heading !== false\n ? heading\n : undefined;\n const state = { id: dialogId };\n const attrs = normalizeAttributes(\n dialogControl.getContentAttributes(\n state,\n {\n hasHeading: resolvedHeading !== undefined,\n ariaLabel,\n ariaLabelledBy,\n },\n ),\n );\n const headingAttrs = normalizeAttributes(dialogControl.getHeadingAttributes(state));\n const headingId = resolvedHeading !== undefined ? headingAttrs.id : undefined;\n const headingLevel = headingProps?.level ?? 2;\n\n const recipe = dialogRecipe({ modal: toStrbool(modal) });\n const cls = useHuiClassNames(\"DialogContent\", recipe, rawProps);\n const sls = useHuiStyles(\"DialogContent\", rawProps);\n const closeButtonClassNames = useMemo(() => ({ root: cls.closeButton }), [cls.closeButton]);\n const closeButtonStyles = useMemo(() => ({ root: sls.closeButton }), [sls.closeButton]);\n\n const shouldRenderCloseButton = closeButton !== null && closeButton !== false;\n const shouldRenderHeader = headingId !== undefined || shouldRenderCloseButton;\n const closeButtonContent = closeButton === undefined\n ? <span aria-hidden className={cls.closeButtonIcon} style={sls.closeButtonIcon} />\n : closeButton;\n\n return (\n <dialog\n {...attrs}\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {shouldRenderHeader && (\n <div className={cls.header} style={sls.header}>\n {headingId && (\n <Heading\n margin=\"none\"\n {...headingProps}\n {...headingAttrs}\n className={cls.heading}\n style={sls.heading}\n level={headingLevel}\n >\n {resolvedHeading}\n </Heading>\n )}\n {shouldRenderCloseButton && (\n <Close\n classNames={closeButtonClassNames}\n styles={closeButtonStyles}\n aria-label=\"Close Dialog\"\n variant=\"ghost\"\n color=\"neutral\"\n shape=\"square\"\n {...closeButtonProps}\n >\n {closeButtonContent}\n </Close>\n )}\n </div>\n )}\n {children}\n </dialog>\n );\n}\n\nexport interface DialogCloseProps extends Omit<ButtonProps, \"as\"> {\n /**\n * The command used to close the dialog.\n *\n * @default \"request-close\"\n */\n command?: \"close\" | \"request-close\" | undefined;\n}\n\nfunction Close(rawProps: DialogCloseProps): ReactNode {\n const props = useHuiProps(\"DialogClose\", rawProps);\n const cls = useHuiClassNames(\"DialogClose\", BUTTON_CLASSES, rawProps);\n const sls = useHuiStyles(\"DialogClose\", rawProps);\n const dialogId = useDialogId();\n const attrs = normalizeAttributes(dialogControl.getCloseAttributes({ id: dialogId }));\n\n return (\n <Button\n {...attrs}\n {...props}\n classNames={cls}\n styles={sls}\n />\n );\n}\n\nexport const Dialog = Object.assign(DialogRoot, {\n Trigger,\n Content,\n Close,\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAM,iBAAiB;CAAE,MAAM;CAAI,SAAS;CAAI,SAAS;CAAI,QAAQ;AAAG;AAgBxE,SAAS,WAAW,UAAqC;CACvD,MAAM,EACJ,IACA,QAAQ,OACR,aACE,YAAY,UAAU,QAAQ;CAElC,MAAM,QAAQ,MAAM;CACpB,MAAM,WAAW,MAAM;CACvB,MAAM,OAAO,kBAAwB;EACnC,cAAc,WAAW,UAAU,KAAK;CAC1C,GAAG,CAAC,UAAU,KAAK,CAAC;CAEpB,MAAM,eAAe,eAAmC;EACtD;EACA;EACA;CACF,IAAI;EAAC;EAAU;EAAO;CAAI,CAAC;CAE3B,OACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;EAC5B;CACqB,CAAA;AAE5B;AAQA,SAAS,QAAyD,UAA4C;CAC5G,MAAM,EACJ,IACA,UACA,SACA,GAAG,cACD,YAAY,iBAAiB,QAAQ;CAEzC,MAAM,YAAY,MAAM;CACxB,MAAM,MAAM,iBAAiB,iBAAiB,gBAAgB,QAAQ;CACtE,MAAM,MAAM,aAAa,iBAAiB,QAAQ;CAClD,MAAM,EACJ,UACA,OACA,SACE,iBAAiB;CACrB,MAAM,QAAQ,oBACZ,cAAc,qBACZ,EAAE,IAAI,SAAS,GACf;EACE;EACA,iBAAiB,OAAO,KAAA;CAC1B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Ac,KAAA,KAAa;CACtD,MAAM,qBAAqB,gBAAgB,KAAA,IACvC,oBAAC,QAAD;EAAM,eAAA;EAAY,WAAW,IAAI;EAAiB,OAAO,IAAI;CAAkB,CAAA,IAC/E;CAEJ,OACE,qBAAC,UAAD;EACE,GAAI;EACJ,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAJN,UAAA,CAMG,sBACC,qBAAC,OAAD;GAAK,WAAW,IAAI;GAAQ,OAAO,IAAI;GAAvC,UAAA,CACG,aACC,oBAAC,SAAD;IACE,QAAO;IACP,GAAI;IACJ,GAAI;IACJ,WAAW,IAAI;IACf,OAAO,IAAI;IACX,OAAO;IAEN,UAAA;GACM,CAAA,GAEV,2BACC,oBAAC,OAAD;IACE,YAAY;IACZ,QAAQ;IACR,cAAW;IACX,SAAQ;IACR,OAAM;IACN,OAAM;IACN,GAAI;IAEH,UAAA;GACI,CAAA,CAEN;EAEN,CAAA,GAAA,QACK;;AAEZ;AAWA,SAAS,MAAM,UAAuC;CACpD,MAAM,QAAQ,YAAY,eAAe,QAAQ;CACjD,MAAM,MAAM,iBAAiB,eAAe,gBAAgB,QAAQ;CACpE,MAAM,MAAM,aAAa,eAAe,QAAQ;CAChD,MAAM,WAAW,YAAY;CAC7B,MAAM,QAAQ,oBAAoB,cAAc,mBAAmB,EAAE,IAAI,SAAS,CAAC,CAAC;CAEpF,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,GAAI;EACJ,YAAY;EACZ,QAAQ;CACT,CAAA;AAEL;AAEA,MAAa,SAAS,OAAO,OAAO,YAAY;CAC9C;CACA;CACA;AACF,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps } from "./dialog.js";
|
|
2
|
-
|
|
3
|
-
export { Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps, useDialogId };
|
|
2
|
+
export { Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps };
|
package/dist/components/dl/dl.js
CHANGED
|
@@ -5,8 +5,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function DlRoot(rawProps) {
|
|
6
6
|
const { children, ...restProps } = useHuiProps("Dl", rawProps);
|
|
7
7
|
const recipe = dlRecipe({});
|
|
8
|
-
const cls = useHuiClassNames("Dl", recipe,
|
|
9
|
-
const sls = useHuiStyles("Dl",
|
|
8
|
+
const cls = useHuiClassNames("Dl", recipe, rawProps);
|
|
9
|
+
const sls = useHuiStyles("Dl", rawProps);
|
|
10
10
|
return /* @__PURE__ */ jsx("dl", {
|
|
11
11
|
className: cls.root,
|
|
12
12
|
style: sls.root,
|
|
@@ -17,8 +17,8 @@ function DlRoot(rawProps) {
|
|
|
17
17
|
function Dt(rawProps) {
|
|
18
18
|
const { children, ...restProps } = useHuiProps("DlDt", rawProps);
|
|
19
19
|
const recipe = dtRecipe({});
|
|
20
|
-
const cls = useHuiClassNames("DlDt", recipe,
|
|
21
|
-
const sls = useHuiStyles("DlDt",
|
|
20
|
+
const cls = useHuiClassNames("DlDt", recipe, rawProps);
|
|
21
|
+
const sls = useHuiStyles("DlDt", rawProps);
|
|
22
22
|
return /* @__PURE__ */ jsx("dt", {
|
|
23
23
|
className: cls.root,
|
|
24
24
|
style: sls.root,
|
|
@@ -29,8 +29,8 @@ function Dt(rawProps) {
|
|
|
29
29
|
function Dd(rawProps) {
|
|
30
30
|
const { children, ...restProps } = useHuiProps("DlDd", rawProps);
|
|
31
31
|
const recipe = ddRecipe({});
|
|
32
|
-
const cls = useHuiClassNames("DlDd", recipe,
|
|
33
|
-
const sls = useHuiStyles("DlDd",
|
|
32
|
+
const cls = useHuiClassNames("DlDd", recipe, rawProps);
|
|
33
|
+
const sls = useHuiStyles("DlDd", rawProps);
|
|
34
34
|
return /* @__PURE__ */ jsx("dd", {
|
|
35
35
|
className: cls.root,
|
|
36
36
|
style: sls.root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dl.js","names":[],"sources":["../../../src/components/dl/dl.tsx"],"sourcesContent":["import { ddRecipe, type DdSlots, dlRecipe, type DlSlots, dtRecipe, type DtSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport interface DlProps extends HuiComponentProps<ComponentProps<\"dl\">, DlSlots> {}\n\nfunction DlRoot(rawProps: DlProps): ReactElement {\n const { children, ...restProps } = useHuiProps(\"Dl\", rawProps);\n\n const recipe = dlRecipe({});\n const cls = useHuiClassNames(\"Dl\", recipe,
|
|
1
|
+
{"version":3,"file":"dl.js","names":[],"sources":["../../../src/components/dl/dl.tsx"],"sourcesContent":["import { ddRecipe, type DdSlots, dlRecipe, type DlSlots, dtRecipe, type DtSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport interface DlProps extends HuiComponentProps<ComponentProps<\"dl\">, DlSlots> {}\n\nfunction DlRoot(rawProps: DlProps): ReactElement {\n const { children, ...restProps } = useHuiProps(\"Dl\", rawProps);\n\n const recipe = dlRecipe({});\n const cls = useHuiClassNames(\"Dl\", recipe, rawProps);\n const sls = useHuiStyles(\"Dl\", rawProps);\n return (\n <dl\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </dl>\n );\n}\n\nexport interface DtProps extends HuiComponentProps<ComponentProps<\"dt\">, DtSlots> {}\n\nfunction Dt(rawProps: DtProps): ReactElement {\n const { children, ...restProps } = useHuiProps(\"DlDt\", rawProps);\n const recipe = dtRecipe({});\n\n const cls = useHuiClassNames(\"DlDt\", recipe, rawProps);\n const sls = useHuiStyles(\"DlDt\", rawProps);\n return (\n <dt\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </dt>\n );\n}\n\nexport interface DdProps extends HuiComponentProps<ComponentProps<\"dd\">, DdSlots> {}\n\nfunction Dd(rawProps: DdProps): ReactElement {\n const { children, ...restProps } = useHuiProps(\"DlDd\", rawProps);\n\n const recipe = ddRecipe({});\n const cls = useHuiClassNames(\"DlDd\", recipe, rawProps);\n const sls = useHuiStyles(\"DlDd\", rawProps);\n\n return (\n <dd\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </dd>\n );\n}\n\nexport const Dl = Object.assign(DlRoot, {\n Dt,\n Dd,\n});\n"],"mappings":";;;;AAOA,SAAS,OAAO,UAAiC;CAC/C,MAAM,EAAE,UAAU,GAAG,cAAc,YAAY,MAAM,QAAQ;CAE7D,MAAM,SAAS,SAAS,CAAC,CAAC;CAC1B,MAAM,MAAM,iBAAiB,MAAM,QAAQ,QAAQ;CACnD,MAAM,MAAM,aAAa,MAAM,QAAQ;CACvC,OACE,oBAAC,MAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACC,CAAA;AAER;AAIA,SAAS,GAAG,UAAiC;CAC3C,MAAM,EAAE,UAAU,GAAG,cAAc,YAAY,QAAQ,QAAQ;CAC/D,MAAM,SAAS,SAAS,CAAC,CAAC;CAE1B,MAAM,MAAM,iBAAiB,QAAQ,QAAQ,QAAQ;CACrD,MAAM,MAAM,aAAa,QAAQ,QAAQ;CACzC,OACE,oBAAC,MAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACC,CAAA;AAER;AAIA,SAAS,GAAG,UAAiC;CAC3C,MAAM,EAAE,UAAU,GAAG,cAAc,YAAY,QAAQ,QAAQ;CAE/D,MAAM,SAAS,SAAS,CAAC,CAAC;CAC1B,MAAM,MAAM,iBAAiB,QAAQ,QAAQ,QAAQ;CACrD,MAAM,MAAM,aAAa,QAAQ,QAAQ;CAEzC,OACE,oBAAC,MAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACC,CAAA;AAER;AAEA,MAAa,KAAK,OAAO,OAAO,QAAQ;CACtC;CACA;AACF,CAAC"}
|
|
@@ -15,8 +15,8 @@ export interface DrawerProps {
|
|
|
15
15
|
children?: ReactNode | undefined;
|
|
16
16
|
}
|
|
17
17
|
declare function DrawerRoot(rawProps: DrawerProps): ReactElement;
|
|
18
|
-
export type DrawerTriggerProps<E extends ElementType = typeof Button
|
|
19
|
-
declare function Trigger<E extends ElementType = typeof Button
|
|
18
|
+
export type DrawerTriggerProps<E extends ElementType = typeof Button<"button">> = HuiPolymorphicProps<E, {}, ButtonSlots>;
|
|
19
|
+
declare function Trigger<E extends ElementType = typeof Button<"button">>(rawProps: DrawerTriggerProps<E>): ReactNode;
|
|
20
20
|
type HtmlDialogProps = Omit<ComponentProps<"dialog">, "children" | "id" | "open">;
|
|
21
21
|
interface DrawerContentOwnProps extends HtmlDialogProps {
|
|
22
22
|
/**
|
|
@@ -42,7 +42,7 @@ interface DrawerContentOwnProps extends HtmlDialogProps {
|
|
|
42
42
|
/**
|
|
43
43
|
* Additional props passed to the internal close button.
|
|
44
44
|
*/
|
|
45
|
-
closeButtonProps?: Omit<DrawerCloseProps, "children" | "
|
|
45
|
+
closeButtonProps?: Omit<DrawerCloseProps, "children" | "classNames" | "styles"> | undefined;
|
|
46
46
|
children?: ReactNode | undefined;
|
|
47
47
|
}
|
|
48
48
|
export type DrawerContentProps = HuiComponentProps<DrawerContentOwnProps, DrawerSlots>;
|
|
@@ -61,5 +61,4 @@ export declare const Drawer: typeof DrawerRoot & {
|
|
|
61
61
|
Content: typeof Content;
|
|
62
62
|
Close: typeof Close;
|
|
63
63
|
};
|
|
64
|
-
export {};
|
|
65
|
-
//# sourceMappingURL=drawer.d.ts.map
|
|
64
|
+
export {};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { useHuiClassNames, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
-
import { Button } from "../button/button.js";
|
|
3
2
|
import { normalizeAttributes } from "../../utils/attributes/normalize-attributes.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
4
|
import { Heading } from "../heading/heading.js";
|
|
5
5
|
import { DrawerContext, useDrawerContext, useDrawerId } from "./drawer.context.js";
|
|
6
6
|
import { dialogControl, drawerRecipe } from "@hebium-ui/core";
|
|
7
7
|
import { useId, useMemo } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
// src/components/drawer/drawer.tsx
|
|
10
|
+
const BUTTON_CLASSES = {
|
|
11
|
+
root: "",
|
|
12
|
+
content: "",
|
|
13
|
+
spinner: "",
|
|
14
|
+
status: ""
|
|
15
|
+
};
|
|
10
16
|
function DrawerRoot(rawProps) {
|
|
11
17
|
const { id, children } = useHuiProps("Drawer", rawProps);
|
|
12
18
|
const tmpId = useId();
|
|
@@ -20,8 +26,8 @@ function DrawerRoot(rawProps) {
|
|
|
20
26
|
function Trigger(rawProps) {
|
|
21
27
|
const { as, children, onClick, ...restProps } = useHuiProps("DrawerTrigger", rawProps);
|
|
22
28
|
const Component = as ?? Button;
|
|
23
|
-
const cls = useHuiClassNames("DrawerTrigger",
|
|
24
|
-
const sls = useHuiStyles("DrawerTrigger",
|
|
29
|
+
const cls = useHuiClassNames("DrawerTrigger", BUTTON_CLASSES, rawProps);
|
|
30
|
+
const sls = useHuiStyles("DrawerTrigger", rawProps);
|
|
25
31
|
const { drawerId } = useDrawerContext();
|
|
26
32
|
const attrs = normalizeAttributes(dialogControl.getTriggerAttributes({ id: drawerId }, {
|
|
27
33
|
modal: true,
|
|
@@ -29,8 +35,13 @@ function Trigger(rawProps) {
|
|
|
29
35
|
}));
|
|
30
36
|
return /* @__PURE__ */ jsx(Component, {
|
|
31
37
|
...attrs,
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
...Component === Button ? {
|
|
39
|
+
classNames: cls,
|
|
40
|
+
styles: sls
|
|
41
|
+
} : {
|
|
42
|
+
className: cls.root,
|
|
43
|
+
style: sls.root
|
|
44
|
+
},
|
|
34
45
|
onClick,
|
|
35
46
|
...restProps,
|
|
36
47
|
children
|
|
@@ -50,8 +61,10 @@ function Content(rawProps) {
|
|
|
50
61
|
const headingId = resolvedHeading !== void 0 ? headingAttrs.id : void 0;
|
|
51
62
|
const headingLevel = headingProps?.level ?? 2;
|
|
52
63
|
const recipe = drawerRecipe({ placement });
|
|
53
|
-
const cls = useHuiClassNames("DrawerContent", recipe, rawProps
|
|
54
|
-
const sls = useHuiStyles("DrawerContent", rawProps
|
|
64
|
+
const cls = useHuiClassNames("DrawerContent", recipe, rawProps);
|
|
65
|
+
const sls = useHuiStyles("DrawerContent", rawProps);
|
|
66
|
+
const closeButtonClassNames = useMemo(() => ({ root: cls.closeButton }), [cls.closeButton]);
|
|
67
|
+
const closeButtonStyles = useMemo(() => ({ root: sls.closeButton }), [sls.closeButton]);
|
|
55
68
|
const shouldRenderCloseButton = closeButton !== null && closeButton !== false;
|
|
56
69
|
const shouldRenderHeader = headingId !== void 0 || shouldRenderCloseButton;
|
|
57
70
|
const closeButtonContent = closeButton === void 0 ? /* @__PURE__ */ jsx("span", {
|
|
@@ -76,8 +89,8 @@ function Content(rawProps) {
|
|
|
76
89
|
level: headingLevel,
|
|
77
90
|
children: resolvedHeading
|
|
78
91
|
}), shouldRenderCloseButton && /* @__PURE__ */ jsx(Close, {
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
classNames: closeButtonClassNames,
|
|
93
|
+
styles: closeButtonStyles,
|
|
81
94
|
"aria-label": "Close Drawer",
|
|
82
95
|
variant: "ghost",
|
|
83
96
|
color: "neutral",
|
|
@@ -90,15 +103,15 @@ function Content(rawProps) {
|
|
|
90
103
|
}
|
|
91
104
|
function Close(rawProps) {
|
|
92
105
|
const props = useHuiProps("DrawerClose", rawProps);
|
|
93
|
-
const cls = useHuiClassNames("DrawerClose",
|
|
94
|
-
const sls = useHuiStyles("DrawerClose",
|
|
106
|
+
const cls = useHuiClassNames("DrawerClose", BUTTON_CLASSES, rawProps);
|
|
107
|
+
const sls = useHuiStyles("DrawerClose", rawProps);
|
|
95
108
|
const drawerId = useDrawerId();
|
|
96
109
|
const attrs = normalizeAttributes(dialogControl.getCloseAttributes({ id: drawerId }));
|
|
97
110
|
return /* @__PURE__ */ jsx(Button, {
|
|
98
111
|
...attrs,
|
|
99
112
|
...props,
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
classNames: cls,
|
|
114
|
+
styles: sls
|
|
102
115
|
});
|
|
103
116
|
}
|
|
104
117
|
const Drawer = Object.assign(DrawerRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ButtonSlots, dialogControl, drawerRecipe, type DrawerSlots, type DrawerVariants } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ElementType, type ReactElement, type ReactNode, useId, useMemo } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps, type HuiPolymorphicProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Heading, type HeadingProps } from \"../heading\";\nimport { DrawerContext, type DrawerContextValue, useDrawerContext, useDrawerId } from \"./drawer.context\";\n\nexport interface DrawerProps {\n /**\n * The id of the drawer content element.\n */\n id?: string | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction DrawerRoot(rawProps: DrawerProps): ReactElement {\n const {\n id,\n children,\n } = useHuiProps(\"Drawer\", rawProps);\n\n const tmpId = useId();\n const drawerId = id || tmpId;\n\n const contextValue = useMemo<DrawerContextValue>(() => ({\n drawerId,\n }), [drawerId]);\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n );\n}\n\nexport type DrawerTriggerProps<E extends ElementType = typeof Button
|
|
1
|
+
{"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ButtonSlots, dialogControl, drawerRecipe, type DrawerSlots, type DrawerVariants } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ElementType, type ReactElement, type ReactNode, useId, useMemo } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps, type HuiPolymorphicProps } from \"~/types\";\nimport { normalizeAttributes } from \"~/utils\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Heading, type HeadingProps } from \"../heading\";\nimport { DrawerContext, type DrawerContextValue, useDrawerContext, useDrawerId } from \"./drawer.context\";\n\nconst BUTTON_CLASSES = { root: \"\", content: \"\", spinner: \"\", status: \"\" } satisfies Record<ButtonSlots, string>;\n\nexport interface DrawerProps {\n /**\n * The id of the drawer content element.\n */\n id?: string | undefined;\n children?: ReactNode | undefined;\n}\n\nfunction DrawerRoot(rawProps: DrawerProps): ReactElement {\n const {\n id,\n children,\n } = useHuiProps(\"Drawer\", rawProps);\n\n const tmpId = useId();\n const drawerId = id || tmpId;\n\n const contextValue = useMemo<DrawerContextValue>(() => ({\n drawerId,\n }), [drawerId]);\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n );\n}\n\nexport type DrawerTriggerProps<E extends ElementType = typeof Button<\"button\">> = HuiPolymorphicProps<\n E,\n {},\n ButtonSlots\n>;\n\nfunction Trigger<E extends ElementType = typeof Button<\"button\">>(rawProps: DrawerTriggerProps<E>): ReactNode {\n const {\n as,\n children,\n onClick,\n ...restProps\n } = useHuiProps(\"DrawerTrigger\", rawProps);\n\n const Component = as ?? Button;\n const cls = useHuiClassNames(\"DrawerTrigger\", BUTTON_CLASSES, rawProps);\n const sls = useHuiStyles(\"DrawerTrigger\", rawProps);\n const {\n drawerId,\n } = useDrawerContext();\n const attrs = normalizeAttributes(\n dialogControl.getTriggerAttributes(\n { id: drawerId },\n {\n modal: true,\n isButtonElement: as === undefined,\n },\n ),\n );\n\n return (\n <Component\n {...attrs}\n {...(Component === Button\n ? { classNames: cls, styles: sls }\n : { className: cls.root, style: sls.root })}\n onClick={onClick}\n {...restProps}\n >\n {children}\n </Component>\n );\n}\n\ntype HtmlDialogProps = Omit<ComponentProps<\"dialog\">, \"children\" | \"id\" | \"open\">;\ninterface DrawerContentOwnProps extends HtmlDialogProps {\n /**\n * The edge from which the drawer enters.\n *\n * @default \"inline-end\"\n */\n placement?: DrawerVariants[\"placement\"] | undefined;\n /**\n * The heading rendered at the top of the drawer content.\n */\n heading?: ReactNode | undefined;\n /**\n * Additional props passed to the internal heading component.\n */\n headingProps?: Omit<HeadingProps, \"children\" | \"id\" | \"className\" | \"style\"> | undefined;\n /**\n * The content rendered inside the internal close button. Set to `null` or `false` to hide the button.\n *\n * @default close icon\n */\n closeButton?: ReactNode | undefined;\n /**\n * Additional props passed to the internal close button.\n */\n closeButtonProps?: Omit<DrawerCloseProps, \"children\" | \"classNames\" | \"styles\"> | undefined;\n children?: ReactNode | undefined;\n}\nexport type DrawerContentProps = HuiComponentProps<DrawerContentOwnProps, DrawerSlots>;\n\nfunction Content(rawProps: DrawerContentProps): ReactElement {\n const {\n placement,\n children,\n heading,\n headingProps,\n closeButton,\n closeButtonProps,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...restProps\n } = useHuiProps(\"DrawerContent\", rawProps);\n\n const {\n drawerId,\n } = useDrawerContext();\n\n const resolvedHeading = heading !== undefined && heading !== null && heading !== false\n ? heading\n : undefined;\n const state = { id: drawerId };\n const attrs = normalizeAttributes(\n dialogControl.getContentAttributes(\n state,\n {\n hasHeading: resolvedHeading !== undefined,\n ariaLabel,\n ariaLabelledBy,\n },\n ),\n );\n const headingAttrs = normalizeAttributes(dialogControl.getHeadingAttributes(state));\n const headingId = resolvedHeading !== undefined ? headingAttrs.id : undefined;\n const headingLevel = headingProps?.level ?? 2;\n const recipe = drawerRecipe({ placement });\n const cls = useHuiClassNames(\"DrawerContent\", recipe, rawProps);\n const sls = useHuiStyles(\"DrawerContent\", rawProps);\n const closeButtonClassNames = useMemo(() => ({ root: cls.closeButton }), [cls.closeButton]);\n const closeButtonStyles = useMemo(() => ({ root: sls.closeButton }), [sls.closeButton]);\n\n const shouldRenderCloseButton = closeButton !== null && closeButton !== false;\n const shouldRenderHeader = headingId !== undefined || shouldRenderCloseButton;\n const closeButtonContent = closeButton === undefined\n ? <span aria-hidden className={cls.closeButtonIcon} style={sls.closeButtonIcon} />\n : closeButton;\n\n return (\n <dialog\n {...attrs}\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {shouldRenderHeader && (\n <div className={cls.header} style={sls.header}>\n {headingId && (\n <Heading\n margin=\"none\"\n {...headingProps}\n {...headingAttrs}\n className={cls.heading}\n style={sls.heading}\n level={headingLevel}\n >\n {resolvedHeading}\n </Heading>\n )}\n {shouldRenderCloseButton && (\n <Close\n classNames={closeButtonClassNames}\n styles={closeButtonStyles}\n aria-label=\"Close Drawer\"\n variant=\"ghost\"\n color=\"neutral\"\n shape=\"square\"\n {...closeButtonProps}\n >\n {closeButtonContent}\n </Close>\n )}\n </div>\n )}\n {children}\n </dialog>\n );\n}\n\nexport interface DrawerCloseProps extends Omit<ButtonProps, \"as\"> {\n /**\n * The command used to close the drawer.\n *\n * @default \"request-close\"\n */\n command?: \"close\" | \"request-close\" | undefined;\n}\n\nfunction Close(rawProps: DrawerCloseProps): ReactNode {\n const props = useHuiProps(\"DrawerClose\", rawProps);\n const cls = useHuiClassNames(\"DrawerClose\", BUTTON_CLASSES, rawProps);\n const sls = useHuiStyles(\"DrawerClose\", rawProps);\n const drawerId = useDrawerId();\n const attrs = normalizeAttributes(dialogControl.getCloseAttributes({ id: drawerId }));\n\n return (\n <Button\n {...attrs}\n {...props}\n classNames={cls}\n styles={sls}\n />\n );\n}\n\nexport const Drawer = Object.assign(DrawerRoot, {\n Trigger,\n Content,\n Close,\n});\n"],"mappings":";;;;;;;;;AASA,MAAM,iBAAiB;CAAE,MAAM;CAAI,SAAS;CAAI,SAAS;CAAI,QAAQ;AA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,oBAAoB,cAAc,mBAAmB,EAAE,IAAI,SAAS,CAAC,CAAC;CAEpF,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,GAAI;EACJ,YAAY;EACZ,QAAQ;CACT,CAAA;AAEL;AAEA,MAAa,SAAS,OAAO,OAAO,YAAY;CAC9C;CACA;CACA;AACF,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps } from "./drawer.js";
|
|
2
|
-
|
|
3
|
-
export { Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps, useDrawerId };
|
|
2
|
+
export { Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps };
|
|
@@ -3,5 +3,4 @@ import "../../types/index.js";
|
|
|
3
3
|
import { FieldsetSlots } from "@hebium-ui/core";
|
|
4
4
|
import { ComponentProps, ReactElement } from "react";
|
|
5
5
|
export type FieldsetProps = HuiComponentProps<ComponentProps<"fieldset">, FieldsetSlots>;
|
|
6
|
-
export declare function Fieldset(rawProps: FieldsetProps): ReactElement;
|
|
7
|
-
//# sourceMappingURL=fieldset.d.ts.map
|
|
6
|
+
export declare function Fieldset(rawProps: FieldsetProps): ReactElement;
|
|
@@ -5,8 +5,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function Fieldset(rawProps) {
|
|
6
6
|
const { children, ...restProps } = useHuiProps("Fieldset", rawProps);
|
|
7
7
|
const recipe = fieldsetRecipe({});
|
|
8
|
-
const cls = useHuiClassNames("Fieldset", recipe,
|
|
9
|
-
const sls = useHuiStyles("Fieldset",
|
|
8
|
+
const cls = useHuiClassNames("Fieldset", recipe, rawProps);
|
|
9
|
+
const sls = useHuiStyles("Fieldset", rawProps);
|
|
10
10
|
return /* @__PURE__ */ jsx("fieldset", {
|
|
11
11
|
className: cls.root,
|
|
12
12
|
style: sls.root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldset.js","names":[],"sources":["../../../src/components/fieldset/fieldset.tsx"],"sourcesContent":["import { fieldsetRecipe, type FieldsetSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport type FieldsetProps = HuiComponentProps<\n ComponentProps<\"fieldset\">,\n FieldsetSlots\n>;\n\nexport function Fieldset(rawProps: FieldsetProps): ReactElement {\n const {\n children,\n ...restProps\n } = useHuiProps(\"Fieldset\", rawProps);\n\n const recipe = fieldsetRecipe({});\n const cls = useHuiClassNames(\"Fieldset\", recipe,
|
|
1
|
+
{"version":3,"file":"fieldset.js","names":[],"sources":["../../../src/components/fieldset/fieldset.tsx"],"sourcesContent":["import { fieldsetRecipe, type FieldsetSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport type FieldsetProps = HuiComponentProps<\n ComponentProps<\"fieldset\">,\n FieldsetSlots\n>;\n\nexport function Fieldset(rawProps: FieldsetProps): ReactElement {\n const {\n children,\n ...restProps\n } = useHuiProps(\"Fieldset\", rawProps);\n\n const recipe = fieldsetRecipe({});\n const cls = useHuiClassNames(\"Fieldset\", recipe, rawProps);\n const sls = useHuiStyles(\"Fieldset\", rawProps);\n\n return (\n <fieldset\n className={cls.root}\n style={sls.root}\n {...restProps}\n >\n {children}\n </fieldset>\n );\n}\n"],"mappings":";;;;AAUA,SAAgB,SAAS,UAAuC;CAC9D,MAAM,EACJ,UACA,GAAG,cACD,YAAY,YAAY,QAAQ;CAEpC,MAAM,SAAS,eAAe,CAAC,CAAC;CAChC,MAAM,MAAM,iBAAiB,YAAY,QAAQ,QAAQ;CACzD,MAAM,MAAM,aAAa,YAAY,QAAQ;CAE7C,OACE,oBAAC,YAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACO,CAAA;AAEd"}
|
|
@@ -16,5 +16,4 @@ export interface HeadingProps extends HuiComponentProps<ComponentProps<"h2">, He
|
|
|
16
16
|
*/
|
|
17
17
|
margin?: HeadingVariants["margin"] | undefined;
|
|
18
18
|
}
|
|
19
|
-
export declare function Heading(rawProps: HeadingProps): ReactElement;
|
|
20
|
-
//# sourceMappingURL=heading.d.ts.map
|
|
19
|
+
export declare function Heading(rawProps: HeadingProps): ReactElement;
|
|
@@ -9,8 +9,8 @@ function Heading(rawProps) {
|
|
|
9
9
|
level: `${level}`,
|
|
10
10
|
margin
|
|
11
11
|
});
|
|
12
|
-
const cls = useHuiClassNames("Heading", recipe,
|
|
13
|
-
const sls = useHuiStyles("Heading",
|
|
12
|
+
const cls = useHuiClassNames("Heading", recipe, rawProps);
|
|
13
|
+
const sls = useHuiStyles("Heading", rawProps);
|
|
14
14
|
return /* @__PURE__ */ jsx(Component, {
|
|
15
15
|
className: cls.root,
|
|
16
16
|
style: sls.root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/heading/heading.tsx"],"sourcesContent":["import { headingRecipe, type HeadingSlots, type HeadingVariants } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport interface HeadingProps extends HuiComponentProps<ComponentProps<\"h2\">, HeadingSlots> {\n /**\n * The heading level used to choose the rendered heading element.\n *\n * @default 2\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;\n /**\n * The block margin applied to the heading.\n *\n * @default \"none\"\n */\n margin?: HeadingVariants[\"margin\"] | undefined;\n}\n\nexport function Heading(rawProps: HeadingProps): ReactElement {\n const {\n level = 2,\n margin,\n children,\n ...restProps\n } = useHuiProps(\"Heading\", rawProps);\n\n const Component = `h${level}` as const;\n\n const recipe = headingRecipe({ level: `${level}`, margin });\n const cls = useHuiClassNames(\"Heading\", recipe,
|
|
1
|
+
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/heading/heading.tsx"],"sourcesContent":["import { headingRecipe, type HeadingSlots, type HeadingVariants } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\n\nexport interface HeadingProps extends HuiComponentProps<ComponentProps<\"h2\">, HeadingSlots> {\n /**\n * The heading level used to choose the rendered heading element.\n *\n * @default 2\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;\n /**\n * The block margin applied to the heading.\n *\n * @default \"none\"\n */\n margin?: HeadingVariants[\"margin\"] | undefined;\n}\n\nexport function Heading(rawProps: HeadingProps): ReactElement {\n const {\n level = 2,\n margin,\n children,\n ...restProps\n } = useHuiProps(\"Heading\", rawProps);\n\n const Component = `h${level}` as const;\n\n const recipe = headingRecipe({ level: `${level}`, margin });\n const cls = useHuiClassNames(\"Heading\", recipe, rawProps);\n const sls = useHuiStyles(\"Heading\", 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":";;;;AAoBA,SAAgB,QAAQ,UAAsC;CAC5D,MAAM,EACJ,QAAQ,GACR,QACA,UACA,GAAG,cACD,YAAY,WAAW,QAAQ;CAEnC,MAAM,YAAY,IAAI;CAEtB,MAAM,SAAS,cAAc;EAAE,OAAO,GAAG;EAAS;CAAO,CAAC;CAC1D,MAAM,MAAM,iBAAiB,WAAW,QAAQ,QAAQ;CACxD,MAAM,MAAM,aAAa,WAAW,QAAQ;CAE5C,OACE,oBAAC,WAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;EAEH;CACQ,CAAA;AAEf"}
|
|
@@ -5,5 +5,4 @@ import { ComponentProps, ElementType, ReactElement } from "react";
|
|
|
5
5
|
interface HrOwnProps extends ComponentProps<"hr"> {}
|
|
6
6
|
export type HrProps<E extends ElementType = "hr"> = HuiPolymorphicProps<E, HrOwnProps, HrSlots>;
|
|
7
7
|
export declare function Hr<E extends ElementType = "hr">(rawProps: HrProps<E>): ReactElement;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=hr.d.ts.map
|
|
8
|
+
export {};
|
package/dist/components/hr/hr.js
CHANGED
|
@@ -5,8 +5,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function Hr(rawProps) {
|
|
6
6
|
const { as, ...restProps } = useHuiProps("Hr", rawProps);
|
|
7
7
|
const recipe = hrRecipe();
|
|
8
|
-
const cls = useHuiClassNames("Hr", recipe,
|
|
9
|
-
const sls = useHuiStyles("Hr",
|
|
8
|
+
const cls = useHuiClassNames("Hr", recipe, rawProps);
|
|
9
|
+
const sls = useHuiStyles("Hr", rawProps);
|
|
10
10
|
return /* @__PURE__ */ jsx(as ?? "hr", {
|
|
11
11
|
className: cls.root,
|
|
12
12
|
style: sls.root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hr.js","names":[],"sources":["../../../src/components/hr/hr.tsx"],"sourcesContent":["import { hrRecipe, type HrSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ElementType, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\n\ninterface HrOwnProps extends ComponentProps<\"hr\"> {}\n\nexport type HrProps<E extends ElementType = \"hr\"> = HuiPolymorphicProps<\n E,\n HrOwnProps,\n HrSlots\n>;\n\nexport function Hr<E extends ElementType = \"hr\">(rawProps: HrProps<E>): ReactElement {\n const {\n as,\n ...restProps\n } = useHuiProps(\"Hr\", rawProps);\n\n const recipe = hrRecipe();\n const cls = useHuiClassNames(\"Hr\", recipe,
|
|
1
|
+
{"version":3,"file":"hr.js","names":[],"sources":["../../../src/components/hr/hr.tsx"],"sourcesContent":["import { hrRecipe, type HrSlots } from \"@hebium-ui/core\";\nimport { type ComponentProps, type ElementType, type ReactElement } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiPolymorphicProps } from \"~/types\";\n\ninterface HrOwnProps extends ComponentProps<\"hr\"> {}\n\nexport type HrProps<E extends ElementType = \"hr\"> = HuiPolymorphicProps<\n E,\n HrOwnProps,\n HrSlots\n>;\n\nexport function Hr<E extends ElementType = \"hr\">(rawProps: HrProps<E>): ReactElement {\n const {\n as,\n ...restProps\n } = useHuiProps(\"Hr\", rawProps);\n\n const recipe = hrRecipe();\n const cls = useHuiClassNames(\"Hr\", recipe, rawProps);\n const sls = useHuiStyles(\"Hr\", rawProps);\n\n const Component = as ?? \"hr\";\n return (\n <Component\n className={cls.root}\n style={sls.root}\n {...restProps}\n />\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,GAAiC,UAAoC;CACnF,MAAM,EACJ,IACA,GAAG,cACD,YAAY,MAAM,QAAQ;CAE9B,MAAM,SAAS,SAAS;CACxB,MAAM,MAAM,iBAAiB,MAAM,QAAQ,QAAQ;CACnD,MAAM,MAAM,aAAa,MAAM,QAAQ;CAGvC,OACE,oBAFgB,MAAM,MAEtB;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACX,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -12,59 +12,64 @@ import { Checkbox, CheckboxProps } from "./checkbox/checkbox.js";
|
|
|
12
12
|
import "./checkbox/index.js";
|
|
13
13
|
import { Code, CodeProps } from "./code/code.js";
|
|
14
14
|
import "./code/index.js";
|
|
15
|
-
import {
|
|
15
|
+
import { Label, LabelProps } from "./label/label.js";
|
|
16
|
+
import "./combobox/index.js";
|
|
17
|
+
import { Combobox, ComboboxFormValueProps, ComboboxProps, ComboboxSelectOption, ComboboxTextOption } from "./combobox/combobox.js";
|
|
16
18
|
import "./details/index.js";
|
|
19
|
+
import { Details, DetailsProps } from "./details/details.js";
|
|
20
|
+
import "./dialog/index.js";
|
|
17
21
|
import { Heading, HeadingProps } from "./heading/heading.js";
|
|
18
|
-
import "./
|
|
22
|
+
import "./dl/index.js";
|
|
19
23
|
import { Dialog, DialogCloseProps, DialogContentProps, DialogProps, DialogTriggerProps } from "./dialog/dialog.js";
|
|
20
|
-
import
|
|
21
|
-
import "./dialog/index.js";
|
|
24
|
+
import "./drawer/index.js";
|
|
22
25
|
import { DdProps, Dl, DlProps, DtProps } from "./dl/dl.js";
|
|
23
|
-
import "./
|
|
26
|
+
import "./fieldset/index.js";
|
|
24
27
|
import { Drawer, DrawerCloseProps, DrawerContentProps, DrawerProps, DrawerTriggerProps } from "./drawer/drawer.js";
|
|
25
|
-
import
|
|
26
|
-
import "./drawer/index.js";
|
|
28
|
+
import "./heading/index.js";
|
|
27
29
|
import { Fieldset, FieldsetProps } from "./fieldset/fieldset.js";
|
|
28
|
-
import "./fieldset/index.js";
|
|
29
|
-
import { Hr, HrProps } from "./hr/hr.js";
|
|
30
30
|
import "./hr/index.js";
|
|
31
|
-
import {
|
|
32
|
-
import "./
|
|
33
|
-
import {
|
|
31
|
+
import { Hr, HrProps } from "./hr/hr.js";
|
|
32
|
+
import "./inline-feedback/index.js";
|
|
33
|
+
import { InlineFeedback, InlineFeedbackProps } from "./inline-feedback/inline-feedback.js";
|
|
34
34
|
import "./input/index.js";
|
|
35
|
+
import { Input, InputProps } from "./input/input.js";
|
|
36
|
+
import "./label/index.js";
|
|
35
37
|
import { Menu, MenuContentProps, MenuItemProps, MenuProps, MenuTriggerProps } from "./menu/menu.js";
|
|
36
|
-
import { useMenuId } from "./menu/menu.context.js";
|
|
37
38
|
import "./menu/index.js";
|
|
38
|
-
import {
|
|
39
|
+
import { Tag, TagProps } from "./tag/tag.js";
|
|
40
|
+
import "./multi-combobox/index.js";
|
|
41
|
+
import { MultiCombobox, MultiComboboxFormValueProps, MultiComboboxItemState, MultiComboboxProps, MultiComboboxTagContext, MultiComboboxTagProps } from "./multi-combobox/multi-combobox.js";
|
|
39
42
|
import "./paragraph/index.js";
|
|
40
|
-
import {
|
|
41
|
-
import { usePopoverId } from "./popover/popover.context.js";
|
|
43
|
+
import { Paragraph, ParagraphProps } from "./paragraph/paragraph.js";
|
|
42
44
|
import "./popover/index.js";
|
|
43
|
-
import {
|
|
45
|
+
import { Popover, PopoverContentProps, PopoverProps, PopoverTriggerProps } from "./popover/popover.js";
|
|
44
46
|
import "./progress/index.js";
|
|
45
|
-
import {
|
|
47
|
+
import { Progress, ProgressProps } from "./progress/progress.js";
|
|
46
48
|
import "./radio/index.js";
|
|
47
|
-
import {
|
|
49
|
+
import { Radio, RadioProps } from "./radio/radio.js";
|
|
48
50
|
import "./radiogroup/index.js";
|
|
49
|
-
import {
|
|
51
|
+
import { Radiogroup, RadiogroupProps } from "./radiogroup/radiogroup.js";
|
|
50
52
|
import "./section/index.js";
|
|
51
|
-
import {
|
|
53
|
+
import { Section, SectionProps } from "./section/section.js";
|
|
52
54
|
import "./segmented-control/index.js";
|
|
53
|
-
import {
|
|
55
|
+
import { SegmentedControl, SegmentedControlItemProps, SegmentedControlProps } from "./segmented-control/segmented-control.js";
|
|
54
56
|
import "./select/index.js";
|
|
55
|
-
import {
|
|
57
|
+
import { Select, SelectProps } from "./select/select.js";
|
|
56
58
|
import "./skip-link/index.js";
|
|
57
|
-
import {
|
|
59
|
+
import { SkipLink, SkipLinkProps } from "./skip-link/skip-link.js";
|
|
60
|
+
import "./status-icon/index.js";
|
|
61
|
+
import { StatusIcon, StatusIconProps } from "./status-icon/status-icon.js";
|
|
58
62
|
import "./table/index.js";
|
|
59
|
-
import {
|
|
63
|
+
import { CaptionProps, Table, TableProps, TbodyProps, TdProps, TfootProps, ThProps, TheadProps, TrProps } from "./table/table.js";
|
|
60
64
|
import "./tabs/index.js";
|
|
65
|
+
import { Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTabProps } from "./tabs/tabs.js";
|
|
66
|
+
import "./tag/index.js";
|
|
61
67
|
import { Text, TextProps } from "./text/text.js";
|
|
62
68
|
import "./text/index.js";
|
|
63
69
|
import { Textarea, TextareaProps } from "./textarea/textarea.js";
|
|
64
70
|
import "./textarea/index.js";
|
|
65
71
|
import { Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps } from "./tooltip/tooltip.js";
|
|
66
|
-
import { useTooltipId } from "./tooltip/tooltip.context.js";
|
|
67
72
|
import "./tooltip/index.js";
|
|
68
73
|
import { VisuallyHidden, VisuallyHiddenProps } from "./visually-hidden/visually-hidden.js";
|
|
69
74
|
import "./visually-hidden/index.js";
|
|
70
|
-
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, 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, SkipLink, SkipLinkProps, Table, TableProps, Tabs, TabsListProps, TabsPanelProps, TabsProps, TabsTabProps, TbodyProps, TdProps, Text, TextProps, Textarea, TextareaProps, TfootProps, ThProps, TheadProps, Tooltip, TooltipContentProps, TooltipProps, TooltipTriggerProps, TrProps, VisuallyHidden, VisuallyHiddenProps
|
|
75
|
+
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, 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 };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { InlineFeedbackSlots, InlineFeedbackVariants } from "@hebium-ui/core";
|
|
4
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
5
|
+
interface InlineFeedbackOwnProps extends Omit<ComponentProps<"div">, "color" | "role"> {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to show the icon and message. For live announcements, mount with
|
|
8
|
+
* `when={false}` and keep the component mounted as you toggle visibility.
|
|
9
|
+
*/
|
|
10
|
+
when: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The icon content, rendered without changing its attributes or styles.
|
|
13
|
+
* Set to `null` or `false` to omit.
|
|
14
|
+
*
|
|
15
|
+
* @default StatusIcon with status="info"
|
|
16
|
+
*/
|
|
17
|
+
icon?: ReactNode | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The color inherited by the icon and message.
|
|
20
|
+
*
|
|
21
|
+
* @default "text"
|
|
22
|
+
*/
|
|
23
|
+
color?: InlineFeedbackVariants["color"] | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The ARIA role of the feedback container.
|
|
26
|
+
*
|
|
27
|
+
* @default "status"
|
|
28
|
+
*/
|
|
29
|
+
role?: "status" | "alert" | "log" | "none" | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type InlineFeedbackProps = HuiComponentProps<InlineFeedbackOwnProps, InlineFeedbackSlots>;
|
|
32
|
+
export declare function InlineFeedback(rawProps: InlineFeedbackProps): ReactElement;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useHuiClassNames, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import { StatusIcon } from "../status-icon/status-icon.js";
|
|
3
|
+
import { inlineFeedbackRecipe, toStrbool } from "@hebium-ui/core";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/components/inline-feedback/inline-feedback.tsx
|
|
7
|
+
function InlineFeedback(rawProps) {
|
|
8
|
+
const { when, children, icon, color, role = "status", ...restProps } = useHuiProps("InlineFeedback", rawProps);
|
|
9
|
+
const diagnosed = useRef(null);
|
|
10
|
+
if (diagnosed.current === null) {
|
|
11
|
+
diagnosed.current = true;
|
|
12
|
+
if ((role === "status" || role === "log") && when) console.warn("[Hebium UI] InlineFeedback: Content shown on the first render with role \"status\" or \"log\" may not be announced by screen readers. Mount InlineFeedback with when={false}, then set when to true after the user action.");
|
|
13
|
+
}
|
|
14
|
+
const recipe = inlineFeedbackRecipe({
|
|
15
|
+
color,
|
|
16
|
+
empty: toStrbool(!when)
|
|
17
|
+
});
|
|
18
|
+
const cls = useHuiClassNames("InlineFeedback", recipe, rawProps);
|
|
19
|
+
const sls = useHuiStyles("InlineFeedback", rawProps);
|
|
20
|
+
return /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: cls.root,
|
|
22
|
+
style: sls.root,
|
|
23
|
+
role,
|
|
24
|
+
...restProps,
|
|
25
|
+
children: when && /* @__PURE__ */ jsxs(Fragment, { children: [typeof icon === "undefined" ? /* @__PURE__ */ jsx(StatusIcon, { status: "info" }) : icon, children] })
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { InlineFeedback };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=inline-feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-feedback.js","names":[],"sources":["../../../src/components/inline-feedback/inline-feedback.tsx"],"sourcesContent":["import {\n inlineFeedbackRecipe,\n type InlineFeedbackSlots,\n type InlineFeedbackVariants,\n toStrbool,\n} from \"@hebium-ui/core\";\nimport { type ComponentProps, type ReactElement, type ReactNode, useRef } from \"react\";\nimport { useHuiClassNames, useHuiProps, useHuiStyles } from \"~/provider\";\nimport { type HuiComponentProps } from \"~/types\";\nimport { StatusIcon } from \"../status-icon\";\n\ninterface InlineFeedbackOwnProps extends Omit<ComponentProps<\"div\">, \"color\" | \"role\"> {\n /**\n * Whether to show the icon and message. For live announcements, mount with\n * `when={false}` and keep the component mounted as you toggle visibility.\n */\n when: boolean;\n /**\n * The icon content, rendered without changing its attributes or styles.\n * Set to `null` or `false` to omit.\n *\n * @default StatusIcon with status=\"info\"\n */\n icon?: ReactNode | undefined;\n /**\n * The color inherited by the icon and message.\n *\n * @default \"text\"\n */\n color?: InlineFeedbackVariants[\"color\"] | undefined;\n /**\n * The ARIA role of the feedback container.\n *\n * @default \"status\"\n */\n role?: \"status\" | \"alert\" | \"log\" | \"none\" | undefined;\n}\n\nexport type InlineFeedbackProps = HuiComponentProps<InlineFeedbackOwnProps, InlineFeedbackSlots>;\n\nexport function InlineFeedback(rawProps: InlineFeedbackProps): ReactElement {\n const {\n when,\n children,\n icon,\n color,\n role = \"status\",\n ...restProps\n } = useHuiProps(\"InlineFeedback\", rawProps);\n const diagnosed = useRef<true | null>(null);\n\n if (diagnosed.current === null) {\n diagnosed.current = true;\n if ((role === \"status\" || role === \"log\") && when) {\n console.warn(\n \"[Hebium UI] InlineFeedback: Content shown on the first render with role \\\"status\\\" or \\\"log\\\" may not be announced by screen readers. Mount InlineFeedback with when={false}, then set when to true after the user action.\",\n );\n }\n }\n\n const recipe = inlineFeedbackRecipe({ color, empty: toStrbool(!when) });\n const cls = useHuiClassNames(\"InlineFeedback\", recipe, rawProps);\n const sls = useHuiStyles(\"InlineFeedback\", rawProps);\n\n return (\n <div\n className={cls.root}\n style={sls.root}\n role={role}\n {...restProps}\n >\n {when && (\n <>\n {typeof icon === \"undefined\"\n ? <StatusIcon status=\"info\" />\n : icon}\n {children}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAwCA,SAAgB,eAAe,UAA6C;CAC1E,MAAM,EACJ,MACA,UACA,MACA,OACA,OAAO,UACP,GAAG,cACD,YAAY,kBAAkB,QAAQ;CAC1C,MAAM,YAAY,OAAoB,IAAI;CAE1C,IAAI,UAAU,YAAY,MAAM;EAC9B,UAAU,UAAU;EACpB,KAAK,SAAS,YAAY,SAAS,UAAU,MAC3C,QAAQ,KACN,4NACF;CAEJ;CAEA,MAAM,SAAS,qBAAqB;EAAE;EAAO,OAAO,UAAU,CAAC,IAAI;CAAE,CAAC;CACtE,MAAM,MAAM,iBAAiB,kBAAkB,QAAQ,QAAQ;CAC/D,MAAM,MAAM,aAAa,kBAAkB,QAAQ;CAEnD,OACE,oBAAC,OAAD;EACE,WAAW,IAAI;EACf,OAAO,IAAI;EACL;EACN,GAAI;EAEH,UAAA,QACC,qBAAA,UAAA,EAAA,UAAA,CACG,OAAO,SAAS,cACb,oBAAC,YAAD,EAAY,QAAO,OAAQ,CAAA,IAC3B,MACH,QACD,EAAA,CAAA;CAED,CAAA;AAET"}
|
|
@@ -19,8 +19,8 @@ function Input(rawProps) {
|
|
|
19
19
|
color,
|
|
20
20
|
error: toStrbool(inputState.invalid)
|
|
21
21
|
});
|
|
22
|
-
const cls = useHuiClassNames("Input", recipe, rawProps
|
|
23
|
-
const sls = useHuiStyles("Input", rawProps
|
|
22
|
+
const cls = useHuiClassNames("Input", recipe, rawProps);
|
|
23
|
+
const sls = useHuiStyles("Input", rawProps);
|
|
24
24
|
const hasLabel = !!label || !!description || !!error;
|
|
25
25
|
const controlAttrs = normalizeAttributes(inputControl.getControlAttributes(inputState));
|
|
26
26
|
const labelAttrs = normalizeAttributes(inputControl.getLabelAttributes(inputState));
|