@postenbring/hedwig-react 0.0.71 → 0.0.73
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/_tsup-dts-rollup.d.mts +99 -28
- package/dist/_tsup-dts-rollup.d.ts +99 -28
- package/dist/{breadcrumb/index.js → breadcrumbs/breadcrumbs.js} +12 -11
- package/dist/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/{breadcrumb/breadcrumb.mjs → breadcrumbs/breadcrumbs.mjs} +2 -2
- package/dist/{breadcrumb/breadcrumb.js → breadcrumbs/index.js} +14 -9
- package/dist/breadcrumbs/index.js.map +1 -0
- package/dist/breadcrumbs/index.mjs +9 -0
- package/dist/button/button.js +1 -4
- package/dist/button/button.js.map +1 -1
- package/dist/button/button.mjs +1 -1
- package/dist/button/index.js +1 -4
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/chunk-3LYJRAOC.mjs +1 -0
- package/dist/{chunk-OUHO4LGN.mjs → chunk-BWFFP6BB.mjs} +2 -5
- package/dist/chunk-BWFFP6BB.mjs.map +1 -0
- package/dist/chunk-CFAH2LID.mjs +1 -0
- package/dist/{chunk-K2HG7WRK.mjs → chunk-CSAEHQ4R.mjs} +2 -2
- package/dist/{chunk-ZRFDCZ62.mjs → chunk-CSFSJGLY.mjs} +5 -5
- package/dist/chunk-E2RTLHMZ.mjs +54 -0
- package/dist/chunk-E2RTLHMZ.mjs.map +1 -0
- package/dist/chunk-EMI7NAO2.mjs +45 -0
- package/dist/chunk-EMI7NAO2.mjs.map +1 -0
- package/dist/chunk-GGEQEVZ4.mjs +22 -0
- package/dist/chunk-GGEQEVZ4.mjs.map +1 -0
- package/dist/chunk-HSIL53A5.mjs +118 -0
- package/dist/chunk-HSIL53A5.mjs.map +1 -0
- package/dist/chunk-ISAHCU7C.mjs +1 -0
- package/dist/chunk-ISAHCU7C.mjs.map +1 -0
- package/dist/chunk-JBWAZQKM.mjs +1 -0
- package/dist/chunk-JBWAZQKM.mjs.map +1 -0
- package/dist/{chunk-O32FZU7E.mjs → chunk-S3BGPCLK.mjs} +4 -4
- package/dist/{chunk-FOZSX44S.mjs → chunk-VM345XBI.mjs} +6 -6
- package/dist/chunk-Z753E3XF.mjs +33 -0
- package/dist/chunk-Z753E3XF.mjs.map +1 -0
- package/dist/description-list/description-list.d.mts +1 -1
- package/dist/description-list/description-list.d.ts +1 -1
- package/dist/description-list/description-list.js +19 -21
- package/dist/description-list/description-list.js.map +1 -1
- package/dist/description-list/description-list.mjs +1 -1
- package/dist/description-list/index.js +19 -21
- package/dist/description-list/index.js.map +1 -1
- package/dist/description-list/index.mjs +1 -1
- package/dist/footer/footer.js +1 -4
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +2 -2
- package/dist/footer/index.js +1 -4
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +3 -3
- package/dist/form/index.mjs +14 -14
- package/dist/help-text/help-text.d.mts +1 -0
- package/dist/help-text/help-text.d.ts +1 -0
- package/dist/help-text/help-text.js +186 -0
- package/dist/help-text/help-text.js.map +1 -0
- package/dist/help-text/help-text.mjs +10 -0
- package/dist/help-text/help-text.mjs.map +1 -0
- package/dist/help-text/index.d.mts +1 -0
- package/dist/help-text/index.d.ts +1 -0
- package/dist/help-text/index.js +188 -0
- package/dist/help-text/index.js.map +1 -0
- package/dist/help-text/index.mjs +11 -0
- package/dist/help-text/index.mjs.map +1 -0
- package/dist/index-no-css.d.mts +2 -0
- package/dist/index-no-css.d.ts +2 -0
- package/dist/index-no-css.js +414 -316
- package/dist/index-no-css.js.map +1 -1
- package/dist/index-no-css.mjs +112 -102
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +414 -316
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -102
- package/dist/index.mjs.map +1 -1
- package/dist/layout/index.mjs +6 -6
- package/dist/navbar/index.mjs +5 -5
- package/dist/show-more/index.js +91 -39
- package/dist/show-more/index.js.map +1 -1
- package/dist/show-more/index.mjs +2 -1
- package/dist/table/index.d.mts +1 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.js +94 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/index.mjs +9 -0
- package/dist/table/index.mjs.map +1 -0
- package/dist/table/table.d.mts +1 -0
- package/dist/table/table.d.ts +1 -0
- package/dist/table/table.js +92 -0
- package/dist/table/table.js.map +1 -0
- package/dist/table/table.mjs +8 -0
- package/dist/table/table.mjs.map +1 -0
- package/dist/tabs/index.mjs +5 -5
- package/dist/utilities/auto-animate-height.js +89 -37
- package/dist/utilities/auto-animate-height.js.map +1 -1
- package/dist/utilities/auto-animate-height.mjs +2 -1
- package/dist/utilities/index.js +89 -37
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/index.mjs +2 -1
- package/package.json +6 -5
- package/dist/breadcrumb/breadcrumb.js.map +0 -1
- package/dist/breadcrumb/index.js.map +0 -1
- package/dist/breadcrumb/index.mjs +0 -9
- package/dist/chunk-AKYK3XFN.mjs +0 -95
- package/dist/chunk-AKYK3XFN.mjs.map +0 -1
- package/dist/chunk-OUHO4LGN.mjs.map +0 -1
- package/dist/chunk-XMB45ILT.mjs +0 -35
- package/dist/chunk-XMB45ILT.mjs.map +0 -1
- package/dist/chunk-YKDKFWP2.mjs +0 -19
- package/dist/chunk-YKDKFWP2.mjs.map +0 -1
- package/dist/chunk-YWNVB7TY.mjs +0 -1
- package/dist/chunk-ZOCMUEOX.mjs +0 -1
- package/dist/{breadcrumb/breadcrumb.d.mts → breadcrumbs/breadcrumbs.d.mts} +1 -1
- package/dist/{breadcrumb/breadcrumb.d.ts → breadcrumbs/breadcrumbs.d.ts} +1 -1
- /package/dist/{breadcrumb/breadcrumb.mjs.map → breadcrumbs/breadcrumbs.mjs.map} +0 -0
- /package/dist/{breadcrumb → breadcrumbs}/index.d.mts +0 -0
- /package/dist/{breadcrumb → breadcrumbs}/index.d.ts +0 -0
- /package/dist/{breadcrumb → breadcrumbs}/index.mjs.map +0 -0
- /package/dist/{chunk-YWNVB7TY.mjs.map → chunk-3LYJRAOC.mjs.map} +0 -0
- /package/dist/{chunk-ZOCMUEOX.mjs.map → chunk-CFAH2LID.mjs.map} +0 -0
- /package/dist/{chunk-K2HG7WRK.mjs.map → chunk-CSAEHQ4R.mjs.map} +0 -0
- /package/dist/{chunk-ZRFDCZ62.mjs.map → chunk-CSFSJGLY.mjs.map} +0 -0
- /package/dist/{chunk-O32FZU7E.mjs.map → chunk-S3BGPCLK.mjs.map} +0 -0
- /package/dist/{chunk-FOZSX44S.mjs.map → chunk-VM345XBI.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/footer/footer.tsx","../../src/accordion/accordion.tsx","../../src/accordion/accordion-item.tsx","../../src/accordion/context.ts","../../src/accordion/accordion-header.tsx","../../src/accordion/accordion-content.tsx","../../src/accordion/index.tsx","../../src/list/link-list.tsx","../../src/list/list.tsx","../../src/button/button.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactElement } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Accordion } from \"../accordion\";\nimport { LinkList } from \"../list/link-list\";\nimport { PrimaryButton } from \"../button\";\n\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {\n variant?: \"default\" | \"slim\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(\n ({ children, className, variant, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"footer\";\n return (\n <Component\n className={clsx(\n `hds-footer`,\n variant === \"slim\" && \"hds-footer--slim\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nFooter.displayName = \"Footer\";\n\nexport interface FooterButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const FooterButtonLink = forwardRef<HTMLAnchorElement, FooterButtonLinkProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n // @ts-expect-error -- It's ok, types are a bit off\n <PrimaryButton\n as={Component}\n fill=\"outline\"\n className={clsx(className as undefined)}\n ref={ref}\n {...rest}\n >\n {children}\n </PrimaryButton>\n );\n },\n);\nFooterButtonLink.displayName = \"FooterButton\";\n\ninterface FooterLogoProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * A fixed Posten or Bring logo.\n *\n * The logo follows the brand theme, so if the class `hds-theme-bring` is set the Bring logo will be shown instead of the Posten logo\n */\nexport const FooterLogo = forwardRef<HTMLDivElement, FooterLogoProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(`hds-footer__logo`, className as undefined)} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\nFooterLogo.displayName = \"Footer.Logo\";\n\ninterface FooterLinkSectionsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactElement<FooterLinkSectionProps> | ReactElement<FooterLinkSectionProps>[];\n}\n\n/**\n * Responsive sections of links. Will become an accordion on mobile.\n *\n * Use with `Footer.LinkSection` for each section.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile and Desktop. The accordion styling gets removed on desktop */}\n <Accordion\n className={clsx(\"hds-footer__link-sections\", className as undefined)}\n ref={ref}\n {...rest}\n >\n {/* @ts-expect-error -- It's ok */}\n {children}\n </Accordion>\n </>\n );\n },\n);\nFooterLinkSections.displayName = \"Footer.LinkSections\";\n\ninterface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement> {\n heading: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const FooterLinkSection = forwardRef<HTMLDivElement, FooterLinkSectionProps>(\n ({ heading, children, className, ...rest }, ref) => {\n // @ts-expect-error -- It's ok\n const linkListChildren = <LinkList>{children}</LinkList>;\n return (\n <>\n {/* Mobile */}\n <Accordion.Item\n className={clsx(`hds-footer__link-section`, className as undefined)}\n ref={ref}\n {...rest}\n >\n <Accordion.Header>{heading}</Accordion.Header>\n <Accordion.Content>{linkListChildren}</Accordion.Content>\n </Accordion.Item>\n\n {/* Desktop */}\n <div className={clsx(`hds-footer__link-section`, className as undefined)}>\n <h2>{heading}</h2>\n {linkListChildren}\n </div>\n </>\n );\n },\n);\nFooterLinkSection.displayName = \"Footer.LinkSection\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport type { AccordionItemProps } from \"./accordion-item\";\n\nexport interface AccordionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts type of <AccordionItem/>\n */\n children: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];\n\n /**\n * Adds padding to the left of the accordion\n */\n indent?: boolean;\n\n className?: string;\n}\n\nexport const Accordion: OverridableComponent<AccordionProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, className, indent = true, ...rest }, ref) => {\n return (\n <Component\n {...rest}\n className={clsx(\n \"hds-accordion\",\n !indent && \"hds-accordion--no-indent\",\n className as undefined,\n )}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\n\nAccordion.displayName = \"Accordion\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\nimport type { AccordionHeaderProps } from \"./accordion-header\";\nimport type { AccordionContentProps } from \"./accordion-content\";\n\nexport type AccordionItemChildrenType =\n | ReactElement<AccordionHeaderProps>\n | ReactElement<AccordionContentProps>;\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Control the open state of the accordion manually\n */\n open?: boolean;\n\n /**\n * Use with open to control the open state of the accordion manually\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * If the accordion should be open by default\n */\n defaultOpen?: boolean;\n\n /**\n * Accepts type of Accordion.Content and Accordion.Header\n */\n children: AccordionItemChildrenType[];\n}\n\nexport const AccordionItem: OverridableComponent<AccordionItemProps, HTMLDivElement> = forwardRef(\n (\n {\n as: Component = \"div\",\n children,\n defaultOpen,\n open: outerOpen,\n onOpenChange,\n className,\n ...rest\n },\n ref,\n ) => {\n const [innerOpen, setInnerOpen] = useState(defaultOpen ?? false);\n const open = outerOpen ?? innerOpen;\n\n const handleOpen = () => {\n if (outerOpen !== undefined) {\n onOpenChange && onOpenChange(!open);\n } else {\n setInnerOpen(!open);\n }\n };\n\n return (\n <Component\n {...rest}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item\", className as undefined)}\n ref={ref}\n >\n <AccordionItemContext.Provider value={{ open, setOpen: handleOpen }}>\n {children}\n </AccordionItemContext.Provider>\n </Component>\n );\n },\n);\n\nAccordionItem.displayName = \"Accordion.Item\";\n","import { createContext } from \"react\";\n\nexport interface AccordionItemContextProps {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const AccordionItemContext = createContext<AccordionItemContextProps | null>(null);\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionHeaderProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n}\n\nexport const AccordionHeader: OverridableComponent<AccordionHeaderProps, HTMLButtonElement> =\n forwardRef(({ as: Component = \"button\", children, className, onClick, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n const expandOrCollapse = (e: MouseEvent<HTMLButtonElement>) => {\n context.setOpen(!context.open);\n onClick && onClick(e);\n };\n return (\n <Component\n {...rest}\n aria-expanded={context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item-header\", className as undefined)}\n onClick={expandOrCollapse}\n ref={ref}\n type=\"button\"\n >\n <span>{children}</span>\n </Component>\n );\n });\n\nAccordionHeader.displayName = \"Accordion.Header\";\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const AccordionContent: OverridableComponent<AccordionContentProps, HTMLDivElement> =\n forwardRef(({ as: Component = \"div\", children, className, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n return (\n <Component\n aria-hidden={!context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n inert={context.open ? undefined : \"true\"}\n className={clsx(\"hds-accordion-item-content\", className as undefined)}\n ref={ref}\n {...rest}\n >\n <div className={clsx(\"hds-accordion-item-content-inner\")}>{children}</div>\n </Component>\n );\n });\n\nAccordionContent.displayName = \"Accordion.Content\";\n","import { Accordion } from \"./accordion\";\nimport { AccordionItem } from \"./accordion-item\";\nimport { AccordionHeader } from \"./accordion-header\";\nimport { AccordionContent } from \"./accordion-content\";\n\nconst AccordionComponent = Accordion as typeof Accordion & {\n Item: typeof AccordionItem;\n Header: typeof AccordionHeader;\n Content: typeof AccordionContent;\n};\n\nAccordionComponent.Item = AccordionItem;\nAccordionComponent.Header = AccordionHeader;\nAccordionComponent.Content = AccordionContent;\n\nexport { AccordionComponent as Accordion, AccordionItem, AccordionHeader, AccordionContent };\n\nexport type * from \"./accordion\";\nexport type * from \"./accordion-item\";\nexport type * from \"./accordion-header\";\nexport type * from \"./accordion-content\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ListProps } from \"./list\";\nimport { UnorderedList } from \"./list\";\n\nexport interface LinkListProps extends Omit<ListProps, \"listStyle\"> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n}\n\n/**\n * Show a list of links\n *\n * For other list types use `UnorderedList` and `OrderedList`, or use your own list component using the semantic `ul` and `ol` tags.\n */\nexport function LinkList({ className, ...rest }: LinkListProps) {\n return (\n <UnorderedList className={clsx(\"hds-list--link-list\", className as undefined)} {...rest} />\n );\n}\n\nLinkList.displayName = \"LinkList\";\n","import type { HTMLAttributes } from \"react\";\nimport * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n /**\n * Sets the size of the items (font)\n */\n size?: \"small\" | \"medium\" | \"large\";\n}\n\nfunction BaseList({\n as: ListTag = \"ul\",\n children,\n size = \"medium\",\n className,\n ...rest\n}: ListProps & { as?: \"ul\" | \"ol\" }) {\n return (\n <ListTag className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)} {...rest}>\n {children}\n </ListTag>\n );\n}\n\n/**\n * An unordered list of simple items, often text. You can nest other lists inside this component.\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function UnorderedList(props: ListProps) {\n return (\n <BaseList as=\"ul\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\n/**\n * An ordered list of simple items\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function OrderedList(props: ListProps) {\n return (\n <BaseList as=\"ol\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\nBaseList.displayName = \"BaseList\";\nOrderedList.displayName = \"OrderedList\";\nUnorderedList.displayName = \"UnorderedList\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\n\ninterface ButtonPropsInternal extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n /**\n * Make the button use 100% width available.\n * Using the \"mobile\" it only stretch to full width on smaller screens\n */\n fullWidth?: boolean | \"mobile\";\n\n /**\n * Use an icon inside the button\n */\n icon?: React.ReactNode;\n\n children?: React.ReactNode;\n}\n\nexport type ButtonProps = ButtonPropsInternal &\n (\n | {\n /**\n * The background fill of the button\n */\n fill?: \"contained\" | \"outline\";\n }\n | {\n /**\n * @deprecated use `fill='outline'` instead\n */\n fill?: \"outlined\";\n }\n );\n\nexport const BaseButton: OverridableComponent<\n ButtonProps & { variant: \"primary\" | \"secondary\" },\n HTMLButtonElement\n> = forwardRef(\n (\n {\n as: Component = \"button\",\n children,\n variant,\n size = \"medium\",\n fullWidth = false,\n fill = \"contained\",\n icon,\n className,\n ...rest\n },\n ref,\n ) => {\n // TODO: Remove deprecated fill value name at some point\n // Deprecated at 10. march 2024\n if (fill === \"outlined\") {\n // eslint-disable-next-line no-console -- Deprecation warning\n console.warn(\"The `fill` value `outlined` is deprecated, use `fill='outline'` instead\");\n }\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n {\n [`hds-button--${variant}`]: fill === \"contained\",\n [`hds-button--outline-${variant}`]: fill === \"outline\" || fill === \"outlined\",\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--icon-only\": icon && !children,\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {icon && !children ? icon : null}\n {children}\n </Component>\n );\n },\n);\nBaseButton.displayName = \"BaseButton\";\n\n/**\n * ## TODO\n *\n * - [x] Handle links that looks like buttons\n * - [ ] Revisit how to handle outline\n * - [ ] Figure out outline-white\n */\n\nexport const PrimaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"primary\" />;\n },\n);\n\nPrimaryButton.displayName = \"PrimaryButton\";\n\nexport const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"secondary\" />;\n },\n);\n\nSecondaryButton.displayName = \"SecondaryButton\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAAmE;AACnE,IAAAC,0BAAqB;AACrB,wBAAqB;;;ACDrB,mBAA2B;AAC3B,6BAAqB;AAqBf;AAHC,IAAM,gBAAkE;AAAA,EAC7E,CAAC,IAAwE,QAAQ;AAAhF,iBAAE,MAAI,YAAY,OAAO,UAAU,WAAW,SAAS,KArB1D,IAqBG,IAAgE,iBAAhE,IAAgE,CAA9D,MAAuB,YAAU,aAAW;AAC7C,WACE;AAAA,MAAC;AAAA,uCACK,OADL;AAAA,QAEC,eAAW;AAAA,UACT;AAAA,UACA,CAAC,UAAU;AAAA,UACX;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;;;ACrCxB,IAAAC,gBAAqC;AACrC,IAAAC,0BAAqB;;;ACFrB,IAAAC,gBAA8B;AAOvB,IAAM,2BAAuB,6BAAgD,IAAI;;;AD0DhF,IAAAC,sBAAA;AA/BD,IAAM,oBAA0E;AAAA,EACrF,CACE,IASA,QACG;AAVH,iBACE;AAAA,UAAI,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AW,QAjF1B,IAiFG,IAAmC,iBAAnC,IAAmC,CAAjC,YAAU,aAAW;AACtB,UAAM,YAAY,UAAU,yBAAO;AACnC,WACE,6CAAC,0CAAU,eAAW,8BAAK,oBAAoB,SAAsB,GAAG,OAAc,OAArF,EACE,WACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;AAWlB,IAAM,yBAAqB;AAAA,EAChC,CAAC,IAAkC,QAAQ;AAA1C,iBAAE,YAAU,UAtGf,IAsGG,IAA0B,iBAA1B,IAA0B,CAAxB,YAAU;AACX,WACE,6EAEE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,6BAA6B,SAAsB;AAAA,QACnE;AAAA,SACI,OAHL;AAAA,QAME;AAAA;AAAA,IACH,GACF;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAO1B,IAAM,wBAAoB;AAAA,EAC/B,CAAC,IAA2C,QAAQ;AAAnD,iBAAE,WAAS,UAAU,UA9HxB,IA8HG,IAAmC,iBAAnC,IAAmC,CAAjC,WAAS,YAAU;AAEpB,UAAM,mBAAmB,6CAAC,YAAU,UAAS;AAC7C,WACE,8EAEE;AAAA;AAAA,QAAC,mBAAU;AAAA,QAAV;AAAA,UACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,UAClE;AAAA,WACI,OAHL;AAAA,UAKC;AAAA,yDAAC,mBAAU,QAAV,EAAkB,mBAAQ;AAAA,YAC3B,6CAAC,mBAAU,SAAV,EAAmB,4BAAiB;AAAA;AAAA;AAAA,MACvC;AAAA,MAGA,8CAAC,SAAI,eAAW,8BAAK,4BAA4B,SAAsB,GACrE;AAAA,qDAAC,QAAI,mBAAQ;AAAA,QACZ;AAAA,SACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_react","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","React","import_typed_classname","import_typed_classname","import_jsx_runtime","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/footer/footer.tsx","../../src/accordion/accordion.tsx","../../src/accordion/accordion-item.tsx","../../src/accordion/context.ts","../../src/accordion/accordion-header.tsx","../../src/accordion/accordion-content.tsx","../../src/accordion/index.tsx","../../src/list/link-list.tsx","../../src/list/list.tsx","../../src/button/button.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactElement } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Accordion } from \"../accordion\";\nimport { LinkList } from \"../list/link-list\";\nimport { PrimaryButton } from \"../button\";\n\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {\n variant?: \"default\" | \"slim\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(\n ({ children, className, variant, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"footer\";\n return (\n <Component\n className={clsx(\n `hds-footer`,\n variant === \"slim\" && \"hds-footer--slim\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nFooter.displayName = \"Footer\";\n\nexport interface FooterButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const FooterButtonLink = forwardRef<HTMLAnchorElement, FooterButtonLinkProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n // @ts-expect-error -- It's ok, types are a bit off\n <PrimaryButton\n as={Component}\n fill=\"outline\"\n className={clsx(className as undefined)}\n ref={ref}\n {...rest}\n >\n {children}\n </PrimaryButton>\n );\n },\n);\nFooterButtonLink.displayName = \"FooterButton\";\n\ninterface FooterLogoProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * A fixed Posten or Bring logo.\n *\n * The logo follows the brand theme, so if the class `hds-theme-bring` is set the Bring logo will be shown instead of the Posten logo\n */\nexport const FooterLogo = forwardRef<HTMLDivElement, FooterLogoProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(`hds-footer__logo`, className as undefined)} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\nFooterLogo.displayName = \"Footer.Logo\";\n\ninterface FooterLinkSectionsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactElement<FooterLinkSectionProps> | ReactElement<FooterLinkSectionProps>[];\n}\n\n/**\n * Responsive sections of links. Will become an accordion on mobile.\n *\n * Use with `Footer.LinkSection` for each section.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile and Desktop. The accordion styling gets removed on desktop */}\n <Accordion\n className={clsx(\"hds-footer__link-sections\", className as undefined)}\n ref={ref}\n {...rest}\n >\n {/* @ts-expect-error -- It's ok */}\n {children}\n </Accordion>\n </>\n );\n },\n);\nFooterLinkSections.displayName = \"Footer.LinkSections\";\n\ninterface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement> {\n heading: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const FooterLinkSection = forwardRef<HTMLDivElement, FooterLinkSectionProps>(\n ({ heading, children, className, ...rest }, ref) => {\n // @ts-expect-error -- It's ok\n const linkListChildren = <LinkList>{children}</LinkList>;\n return (\n <>\n {/* Mobile */}\n <Accordion.Item\n className={clsx(`hds-footer__link-section`, className as undefined)}\n ref={ref}\n {...rest}\n >\n <Accordion.Header>{heading}</Accordion.Header>\n <Accordion.Content>{linkListChildren}</Accordion.Content>\n </Accordion.Item>\n\n {/* Desktop */}\n <div className={clsx(`hds-footer__link-section`, className as undefined)}>\n <h2>{heading}</h2>\n {linkListChildren}\n </div>\n </>\n );\n },\n);\nFooterLinkSection.displayName = \"Footer.LinkSection\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport type { AccordionItemProps } from \"./accordion-item\";\n\nexport interface AccordionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts type of <AccordionItem/>\n */\n children: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];\n\n /**\n * Adds padding to the left of the accordion\n */\n indent?: boolean;\n\n className?: string;\n}\n\nexport const Accordion: OverridableComponent<AccordionProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, className, indent = true, ...rest }, ref) => {\n return (\n <Component\n {...rest}\n className={clsx(\n \"hds-accordion\",\n !indent && \"hds-accordion--no-indent\",\n className as undefined,\n )}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\n\nAccordion.displayName = \"Accordion\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\nimport type { AccordionHeaderProps } from \"./accordion-header\";\nimport type { AccordionContentProps } from \"./accordion-content\";\n\nexport type AccordionItemChildrenType =\n | ReactElement<AccordionHeaderProps>\n | ReactElement<AccordionContentProps>;\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Control the open state of the accordion manually\n */\n open?: boolean;\n\n /**\n * Use with open to control the open state of the accordion manually\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * If the accordion should be open by default\n */\n defaultOpen?: boolean;\n\n /**\n * Accepts type of Accordion.Content and Accordion.Header\n */\n children: AccordionItemChildrenType[];\n}\n\nexport const AccordionItem: OverridableComponent<AccordionItemProps, HTMLDivElement> = forwardRef(\n (\n {\n as: Component = \"div\",\n children,\n defaultOpen,\n open: outerOpen,\n onOpenChange,\n className,\n ...rest\n },\n ref,\n ) => {\n const [innerOpen, setInnerOpen] = useState(defaultOpen ?? false);\n const open = outerOpen ?? innerOpen;\n\n const handleOpen = () => {\n if (outerOpen !== undefined) {\n onOpenChange && onOpenChange(!open);\n } else {\n setInnerOpen(!open);\n }\n };\n\n return (\n <Component\n {...rest}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item\", className as undefined)}\n ref={ref}\n >\n <AccordionItemContext.Provider value={{ open, setOpen: handleOpen }}>\n {children}\n </AccordionItemContext.Provider>\n </Component>\n );\n },\n);\n\nAccordionItem.displayName = \"Accordion.Item\";\n","import { createContext } from \"react\";\n\nexport interface AccordionItemContextProps {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const AccordionItemContext = createContext<AccordionItemContextProps | null>(null);\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionHeaderProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n}\n\nexport const AccordionHeader: OverridableComponent<AccordionHeaderProps, HTMLButtonElement> =\n forwardRef(({ as: Component = \"button\", children, className, onClick, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n const expandOrCollapse = (e: MouseEvent<HTMLButtonElement>) => {\n context.setOpen(!context.open);\n onClick && onClick(e);\n };\n return (\n <Component\n {...rest}\n aria-expanded={context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item-header\", className as undefined)}\n onClick={expandOrCollapse}\n ref={ref}\n type=\"button\"\n >\n <span>{children}</span>\n </Component>\n );\n });\n\nAccordionHeader.displayName = \"Accordion.Header\";\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const AccordionContent: OverridableComponent<AccordionContentProps, HTMLDivElement> =\n forwardRef(({ as: Component = \"div\", children, className, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n return (\n <Component\n aria-hidden={!context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n inert={context.open ? undefined : \"true\"}\n className={clsx(\"hds-accordion-item-content\", className as undefined)}\n ref={ref}\n {...rest}\n >\n <div className={clsx(\"hds-accordion-item-content-inner\")}>{children}</div>\n </Component>\n );\n });\n\nAccordionContent.displayName = \"Accordion.Content\";\n","import { Accordion } from \"./accordion\";\nimport { AccordionItem } from \"./accordion-item\";\nimport { AccordionHeader } from \"./accordion-header\";\nimport { AccordionContent } from \"./accordion-content\";\n\nconst AccordionComponent = Accordion as typeof Accordion & {\n Item: typeof AccordionItem;\n Header: typeof AccordionHeader;\n Content: typeof AccordionContent;\n};\n\nAccordionComponent.Item = AccordionItem;\nAccordionComponent.Header = AccordionHeader;\nAccordionComponent.Content = AccordionContent;\n\nexport { AccordionComponent as Accordion, AccordionItem, AccordionHeader, AccordionContent };\n\nexport type * from \"./accordion\";\nexport type * from \"./accordion-item\";\nexport type * from \"./accordion-header\";\nexport type * from \"./accordion-content\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ListProps } from \"./list\";\nimport { UnorderedList } from \"./list\";\n\nexport interface LinkListProps extends Omit<ListProps, \"listStyle\"> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n}\n\n/**\n * Show a list of links\n *\n * For other list types use `UnorderedList` and `OrderedList`, or use your own list component using the semantic `ul` and `ol` tags.\n */\nexport function LinkList({ className, ...rest }: LinkListProps) {\n return (\n <UnorderedList className={clsx(\"hds-list--link-list\", className as undefined)} {...rest} />\n );\n}\n\nLinkList.displayName = \"LinkList\";\n","import type { HTMLAttributes } from \"react\";\nimport * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n /**\n * Sets the size of the items (font)\n */\n size?: \"small\" | \"medium\" | \"large\";\n}\n\nfunction BaseList({\n as: ListTag = \"ul\",\n children,\n size = \"medium\",\n className,\n ...rest\n}: ListProps & { as?: \"ul\" | \"ol\" }) {\n return (\n <ListTag className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)} {...rest}>\n {children}\n </ListTag>\n );\n}\n\n/**\n * An unordered list of simple items, often text. You can nest other lists inside this component.\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function UnorderedList(props: ListProps) {\n return (\n <BaseList as=\"ul\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\n/**\n * An ordered list of simple items\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function OrderedList(props: ListProps) {\n return (\n <BaseList as=\"ol\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\nBaseList.displayName = \"BaseList\";\nOrderedList.displayName = \"OrderedList\";\nUnorderedList.displayName = \"UnorderedList\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n /**\n * The background fill of the button\n */\n fill?: \"contained\" | \"outline\";\n\n /**\n * Make the button use 100% width available.\n * Using the \"mobile\" it only stretch to full width on smaller screens\n */\n fullWidth?: boolean | \"mobile\";\n\n /**\n * Use an icon inside the button\n */\n icon?: React.ReactNode;\n\n children?: React.ReactNode;\n}\n\nexport const BaseButton: OverridableComponent<\n ButtonProps & { variant: \"primary\" | \"secondary\" },\n HTMLButtonElement\n> = forwardRef(\n (\n {\n as: Component = \"button\",\n children,\n variant,\n size = \"medium\",\n fullWidth = false,\n fill = \"contained\",\n icon,\n className,\n ...rest\n },\n ref,\n ) => {\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n {\n [`hds-button--${variant}`]: fill === \"contained\",\n [`hds-button--outline-${variant}`]: fill === \"outline\",\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--icon-only\": icon && !children,\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {icon && !children ? icon : null}\n {children}\n </Component>\n );\n },\n);\nBaseButton.displayName = \"BaseButton\";\n\n/**\n * ## TODO\n *\n * - [x] Handle links that looks like buttons\n * - [ ] Revisit how to handle outline\n * - [ ] Figure out outline-white\n */\n\nexport const PrimaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"primary\" />;\n },\n);\n\nPrimaryButton.displayName = \"PrimaryButton\";\n\nexport const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"secondary\" />;\n },\n);\n\nSecondaryButton.displayName = \"SecondaryButton\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAAmE;AACnE,IAAAC,0BAAqB;AACrB,wBAAqB;;;ACDr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;AAAA;AAAA,QAAC,mBAAU;AAAA,QAAV;AAAA,UACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,UAClE;AAAA,WACI,OAHL;AAAA,UAKC;AAAA,yDAAC,mBAAU,QAAV,EAAkB,mBAAQ;AAAA,YAC3B,6CAAC,mBAAU,SAAV,EAAmB,4BAAiB;AAAA;AAAA;AAAA,MACvC;AAAA,MAGA,8CAAC,SAAI,eAAW,8BAAK,4BAA4B,SAAsB,GACrE;AAAA,qDAAC,QAAI,mBAAQ;AAAA,QACZ;AAAA,SACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_react","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","React","import_typed_classname","import_typed_classname","import_jsx_runtime","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/footer/footer.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
FooterLinkSection,
|
|
5
5
|
FooterLinkSections,
|
|
6
6
|
FooterLogo
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-S3BGPCLK.mjs";
|
|
8
8
|
import "../chunk-GJDRW6PA.mjs";
|
|
9
9
|
import "../chunk-PMLDK3VC.mjs";
|
|
10
10
|
import "../chunk-HT2EIJAD.mjs";
|
|
11
|
+
import "../chunk-BWFFP6BB.mjs";
|
|
11
12
|
import "../chunk-XYIY6FHW.mjs";
|
|
12
|
-
import "../chunk-OUHO4LGN.mjs";
|
|
13
13
|
import "../chunk-GUB3UCXO.mjs";
|
|
14
14
|
import "../chunk-YXHXRUFX.mjs";
|
|
15
15
|
import "../chunk-62F4I3MQ.mjs";
|
package/dist/footer/index.js
CHANGED
|
@@ -259,9 +259,6 @@ var BaseButton = (0, import_react6.forwardRef)(
|
|
|
259
259
|
"icon",
|
|
260
260
|
"className"
|
|
261
261
|
]);
|
|
262
|
-
if (fill === "outlined") {
|
|
263
|
-
console.warn("The `fill` value `outlined` is deprecated, use `fill='outline'` instead");
|
|
264
|
-
}
|
|
265
262
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
266
263
|
Component,
|
|
267
264
|
__spreadProps(__spreadValues({
|
|
@@ -270,7 +267,7 @@ var BaseButton = (0, import_react6.forwardRef)(
|
|
|
270
267
|
`hds-button--${size}`,
|
|
271
268
|
{
|
|
272
269
|
[`hds-button--${variant}`]: fill === "contained",
|
|
273
|
-
[`hds-button--outline-${variant}`]: fill === "outline"
|
|
270
|
+
[`hds-button--outline-${variant}`]: fill === "outline",
|
|
274
271
|
"hds-button--full": fullWidth === true,
|
|
275
272
|
"hds-button--mobile-full": fullWidth === "mobile",
|
|
276
273
|
"hds-button--icon-only": icon && !children
|
package/dist/footer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/footer/index.tsx","../../src/footer/footer.tsx","../../src/accordion/accordion.tsx","../../src/accordion/accordion-item.tsx","../../src/accordion/context.ts","../../src/accordion/accordion-header.tsx","../../src/accordion/accordion-content.tsx","../../src/accordion/index.tsx","../../src/list/link-list.tsx","../../src/list/list.tsx","../../src/button/button.tsx"],"sourcesContent":["import {\n Footer,\n FooterLogo,\n FooterButtonLink,\n FooterLinkSections,\n FooterLinkSection,\n} from \"./footer\";\n\nconst FooterComponent = Footer as typeof Footer & {\n Logo: typeof FooterLogo;\n ButtonLink: typeof FooterButtonLink;\n LinkSections: typeof FooterLinkSections;\n LinkSection: typeof FooterLinkSection;\n};\nFooterComponent.Logo = FooterLogo;\nFooterComponent.ButtonLink = FooterButtonLink;\nFooterComponent.LinkSections = FooterLinkSections;\nFooterComponent.LinkSection = FooterLinkSection;\n\nexport {\n FooterComponent as Footer,\n FooterLogo,\n FooterButtonLink,\n FooterLinkSections,\n FooterLinkSection,\n};\nexport type * from \"./footer\";\n","import { forwardRef, type HTMLAttributes, type ReactElement } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Accordion } from \"../accordion\";\nimport { LinkList } from \"../list/link-list\";\nimport { PrimaryButton } from \"../button\";\n\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {\n variant?: \"default\" | \"slim\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(\n ({ children, className, variant, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"footer\";\n return (\n <Component\n className={clsx(\n `hds-footer`,\n variant === \"slim\" && \"hds-footer--slim\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nFooter.displayName = \"Footer\";\n\nexport interface FooterButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const FooterButtonLink = forwardRef<HTMLAnchorElement, FooterButtonLinkProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n // @ts-expect-error -- It's ok, types are a bit off\n <PrimaryButton\n as={Component}\n fill=\"outline\"\n className={clsx(className as undefined)}\n ref={ref}\n {...rest}\n >\n {children}\n </PrimaryButton>\n );\n },\n);\nFooterButtonLink.displayName = \"FooterButton\";\n\ninterface FooterLogoProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * A fixed Posten or Bring logo.\n *\n * The logo follows the brand theme, so if the class `hds-theme-bring` is set the Bring logo will be shown instead of the Posten logo\n */\nexport const FooterLogo = forwardRef<HTMLDivElement, FooterLogoProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(`hds-footer__logo`, className as undefined)} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\nFooterLogo.displayName = \"Footer.Logo\";\n\ninterface FooterLinkSectionsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactElement<FooterLinkSectionProps> | ReactElement<FooterLinkSectionProps>[];\n}\n\n/**\n * Responsive sections of links. Will become an accordion on mobile.\n *\n * Use with `Footer.LinkSection` for each section.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile and Desktop. The accordion styling gets removed on desktop */}\n <Accordion\n className={clsx(\"hds-footer__link-sections\", className as undefined)}\n ref={ref}\n {...rest}\n >\n {/* @ts-expect-error -- It's ok */}\n {children}\n </Accordion>\n </>\n );\n },\n);\nFooterLinkSections.displayName = \"Footer.LinkSections\";\n\ninterface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement> {\n heading: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const FooterLinkSection = forwardRef<HTMLDivElement, FooterLinkSectionProps>(\n ({ heading, children, className, ...rest }, ref) => {\n // @ts-expect-error -- It's ok\n const linkListChildren = <LinkList>{children}</LinkList>;\n return (\n <>\n {/* Mobile */}\n <Accordion.Item\n className={clsx(`hds-footer__link-section`, className as undefined)}\n ref={ref}\n {...rest}\n >\n <Accordion.Header>{heading}</Accordion.Header>\n <Accordion.Content>{linkListChildren}</Accordion.Content>\n </Accordion.Item>\n\n {/* Desktop */}\n <div className={clsx(`hds-footer__link-section`, className as undefined)}>\n <h2>{heading}</h2>\n {linkListChildren}\n </div>\n </>\n );\n },\n);\nFooterLinkSection.displayName = \"Footer.LinkSection\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport type { AccordionItemProps } from \"./accordion-item\";\n\nexport interface AccordionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts type of <AccordionItem/>\n */\n children: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];\n\n /**\n * Adds padding to the left of the accordion\n */\n indent?: boolean;\n\n className?: string;\n}\n\nexport const Accordion: OverridableComponent<AccordionProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, className, indent = true, ...rest }, ref) => {\n return (\n <Component\n {...rest}\n className={clsx(\n \"hds-accordion\",\n !indent && \"hds-accordion--no-indent\",\n className as undefined,\n )}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\n\nAccordion.displayName = \"Accordion\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\nimport type { AccordionHeaderProps } from \"./accordion-header\";\nimport type { AccordionContentProps } from \"./accordion-content\";\n\nexport type AccordionItemChildrenType =\n | ReactElement<AccordionHeaderProps>\n | ReactElement<AccordionContentProps>;\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Control the open state of the accordion manually\n */\n open?: boolean;\n\n /**\n * Use with open to control the open state of the accordion manually\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * If the accordion should be open by default\n */\n defaultOpen?: boolean;\n\n /**\n * Accepts type of Accordion.Content and Accordion.Header\n */\n children: AccordionItemChildrenType[];\n}\n\nexport const AccordionItem: OverridableComponent<AccordionItemProps, HTMLDivElement> = forwardRef(\n (\n {\n as: Component = \"div\",\n children,\n defaultOpen,\n open: outerOpen,\n onOpenChange,\n className,\n ...rest\n },\n ref,\n ) => {\n const [innerOpen, setInnerOpen] = useState(defaultOpen ?? false);\n const open = outerOpen ?? innerOpen;\n\n const handleOpen = () => {\n if (outerOpen !== undefined) {\n onOpenChange && onOpenChange(!open);\n } else {\n setInnerOpen(!open);\n }\n };\n\n return (\n <Component\n {...rest}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item\", className as undefined)}\n ref={ref}\n >\n <AccordionItemContext.Provider value={{ open, setOpen: handleOpen }}>\n {children}\n </AccordionItemContext.Provider>\n </Component>\n );\n },\n);\n\nAccordionItem.displayName = \"Accordion.Item\";\n","import { createContext } from \"react\";\n\nexport interface AccordionItemContextProps {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const AccordionItemContext = createContext<AccordionItemContextProps | null>(null);\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionHeaderProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n}\n\nexport const AccordionHeader: OverridableComponent<AccordionHeaderProps, HTMLButtonElement> =\n forwardRef(({ as: Component = \"button\", children, className, onClick, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n const expandOrCollapse = (e: MouseEvent<HTMLButtonElement>) => {\n context.setOpen(!context.open);\n onClick && onClick(e);\n };\n return (\n <Component\n {...rest}\n aria-expanded={context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item-header\", className as undefined)}\n onClick={expandOrCollapse}\n ref={ref}\n type=\"button\"\n >\n <span>{children}</span>\n </Component>\n );\n });\n\nAccordionHeader.displayName = \"Accordion.Header\";\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const AccordionContent: OverridableComponent<AccordionContentProps, HTMLDivElement> =\n forwardRef(({ as: Component = \"div\", children, className, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n return (\n <Component\n aria-hidden={!context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n inert={context.open ? undefined : \"true\"}\n className={clsx(\"hds-accordion-item-content\", className as undefined)}\n ref={ref}\n {...rest}\n >\n <div className={clsx(\"hds-accordion-item-content-inner\")}>{children}</div>\n </Component>\n );\n });\n\nAccordionContent.displayName = \"Accordion.Content\";\n","import { Accordion } from \"./accordion\";\nimport { AccordionItem } from \"./accordion-item\";\nimport { AccordionHeader } from \"./accordion-header\";\nimport { AccordionContent } from \"./accordion-content\";\n\nconst AccordionComponent = Accordion as typeof Accordion & {\n Item: typeof AccordionItem;\n Header: typeof AccordionHeader;\n Content: typeof AccordionContent;\n};\n\nAccordionComponent.Item = AccordionItem;\nAccordionComponent.Header = AccordionHeader;\nAccordionComponent.Content = AccordionContent;\n\nexport { AccordionComponent as Accordion, AccordionItem, AccordionHeader, AccordionContent };\n\nexport type * from \"./accordion\";\nexport type * from \"./accordion-item\";\nexport type * from \"./accordion-header\";\nexport type * from \"./accordion-content\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ListProps } from \"./list\";\nimport { UnorderedList } from \"./list\";\n\nexport interface LinkListProps extends Omit<ListProps, \"listStyle\"> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n}\n\n/**\n * Show a list of links\n *\n * For other list types use `UnorderedList` and `OrderedList`, or use your own list component using the semantic `ul` and `ol` tags.\n */\nexport function LinkList({ className, ...rest }: LinkListProps) {\n return (\n <UnorderedList className={clsx(\"hds-list--link-list\", className as undefined)} {...rest} />\n );\n}\n\nLinkList.displayName = \"LinkList\";\n","import type { HTMLAttributes } from \"react\";\nimport * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n /**\n * Sets the size of the items (font)\n */\n size?: \"small\" | \"medium\" | \"large\";\n}\n\nfunction BaseList({\n as: ListTag = \"ul\",\n children,\n size = \"medium\",\n className,\n ...rest\n}: ListProps & { as?: \"ul\" | \"ol\" }) {\n return (\n <ListTag className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)} {...rest}>\n {children}\n </ListTag>\n );\n}\n\n/**\n * An unordered list of simple items, often text. You can nest other lists inside this component.\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function UnorderedList(props: ListProps) {\n return (\n <BaseList as=\"ul\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\n/**\n * An ordered list of simple items\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function OrderedList(props: ListProps) {\n return (\n <BaseList as=\"ol\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\nBaseList.displayName = \"BaseList\";\nOrderedList.displayName = \"OrderedList\";\nUnorderedList.displayName = \"UnorderedList\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\n\ninterface ButtonPropsInternal extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n /**\n * Make the button use 100% width available.\n * Using the \"mobile\" it only stretch to full width on smaller screens\n */\n fullWidth?: boolean | \"mobile\";\n\n /**\n * Use an icon inside the button\n */\n icon?: React.ReactNode;\n\n children?: React.ReactNode;\n}\n\nexport type ButtonProps = ButtonPropsInternal &\n (\n | {\n /**\n * The background fill of the button\n */\n fill?: \"contained\" | \"outline\";\n }\n | {\n /**\n * @deprecated use `fill='outline'` instead\n */\n fill?: \"outlined\";\n }\n );\n\nexport const BaseButton: OverridableComponent<\n ButtonProps & { variant: \"primary\" | \"secondary\" },\n HTMLButtonElement\n> = forwardRef(\n (\n {\n as: Component = \"button\",\n children,\n variant,\n size = \"medium\",\n fullWidth = false,\n fill = \"contained\",\n icon,\n className,\n ...rest\n },\n ref,\n ) => {\n // TODO: Remove deprecated fill value name at some point\n // Deprecated at 10. march 2024\n if (fill === \"outlined\") {\n // eslint-disable-next-line no-console -- Deprecation warning\n console.warn(\"The `fill` value `outlined` is deprecated, use `fill='outline'` instead\");\n }\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n {\n [`hds-button--${variant}`]: fill === \"contained\",\n [`hds-button--outline-${variant}`]: fill === \"outline\" || fill === \"outlined\",\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--icon-only\": icon && !children,\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {icon && !children ? icon : null}\n {children}\n </Component>\n );\n },\n);\nBaseButton.displayName = \"BaseButton\";\n\n/**\n * ## TODO\n *\n * - [x] Handle links that looks like buttons\n * - [ ] Revisit how to handle outline\n * - [ ] Figure out outline-white\n */\n\nexport const PrimaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"primary\" />;\n },\n);\n\nPrimaryButton.displayName = \"PrimaryButton\";\n\nexport const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"secondary\" />;\n },\n);\n\nSecondaryButton.displayName = \"SecondaryButton\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAmE;AACnE,IAAAC,0BAAqB;AACrB,wBAAqB;;;ACDrB,mBAA2B;AAC3B,6BAAqB;AAqBf;AAHC,I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C,YAAU,UAAS;AAC7C,WACE,8EAEE;AAAA;AAAA,QAAC,mBAAU;AAAA,QAAV;AAAA,UACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,UAClE;AAAA,WACI,OAHL;AAAA,UAKC;AAAA,yDAAC,mBAAU,QAAV,EAAkB,mBAAQ;AAAA,YAC3B,6CAAC,mBAAU,SAAV,EAAmB,4BAAiB;AAAA;AAAA;AAAA,MACvC;AAAA,MAGA,8CAAC,SAAI,eAAW,8BAAK,4BAA4B,SAAsB,GACrE;AAAA,qDAAC,QAAI,mBAAQ;AAAA,QACZ;AAAA,SACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;;;AD9IhC,IAAM,kBAAkB;AAMxB,gBAAgB,OAAO;AACvB,gBAAgB,aAAa;AAC7B,gBAAgB,eAAe;AAC/B,gBAAgB,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_react","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","React","import_typed_classname","import_typed_classname","import_jsx_runtime","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/footer/index.tsx","../../src/footer/footer.tsx","../../src/accordion/accordion.tsx","../../src/accordion/accordion-item.tsx","../../src/accordion/context.ts","../../src/accordion/accordion-header.tsx","../../src/accordion/accordion-content.tsx","../../src/accordion/index.tsx","../../src/list/link-list.tsx","../../src/list/list.tsx","../../src/button/button.tsx"],"sourcesContent":["import {\n Footer,\n FooterLogo,\n FooterButtonLink,\n FooterLinkSections,\n FooterLinkSection,\n} from \"./footer\";\n\nconst FooterComponent = Footer as typeof Footer & {\n Logo: typeof FooterLogo;\n ButtonLink: typeof FooterButtonLink;\n LinkSections: typeof FooterLinkSections;\n LinkSection: typeof FooterLinkSection;\n};\nFooterComponent.Logo = FooterLogo;\nFooterComponent.ButtonLink = FooterButtonLink;\nFooterComponent.LinkSections = FooterLinkSections;\nFooterComponent.LinkSection = FooterLinkSection;\n\nexport {\n FooterComponent as Footer,\n FooterLogo,\n FooterButtonLink,\n FooterLinkSections,\n FooterLinkSection,\n};\nexport type * from \"./footer\";\n","import { forwardRef, type HTMLAttributes, type ReactElement } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Accordion } from \"../accordion\";\nimport { LinkList } from \"../list/link-list\";\nimport { PrimaryButton } from \"../button\";\n\nexport interface FooterProps extends HTMLAttributes<HTMLDivElement> {\n variant?: \"default\" | \"slim\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const Footer = forwardRef<HTMLDivElement, FooterProps>(\n ({ children, className, variant, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"footer\";\n return (\n <Component\n className={clsx(\n `hds-footer`,\n variant === \"slim\" && \"hds-footer--slim\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nFooter.displayName = \"Footer\";\n\nexport interface FooterButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n */\nexport const FooterButtonLink = forwardRef<HTMLAnchorElement, FooterButtonLinkProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n // @ts-expect-error -- It's ok, types are a bit off\n <PrimaryButton\n as={Component}\n fill=\"outline\"\n className={clsx(className as undefined)}\n ref={ref}\n {...rest}\n >\n {children}\n </PrimaryButton>\n );\n },\n);\nFooterButtonLink.displayName = \"FooterButton\";\n\ninterface FooterLogoProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean;\n}\n\n/**\n * A fixed Posten or Bring logo.\n *\n * The logo follows the brand theme, so if the class `hds-theme-bring` is set the Bring logo will be shown instead of the Posten logo\n */\nexport const FooterLogo = forwardRef<HTMLDivElement, FooterLogoProps>(\n ({ children, className, asChild, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(`hds-footer__logo`, className as undefined)} ref={ref} {...rest}>\n {children}\n </Component>\n );\n },\n);\nFooterLogo.displayName = \"Footer.Logo\";\n\ninterface FooterLinkSectionsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactElement<FooterLinkSectionProps> | ReactElement<FooterLinkSectionProps>[];\n}\n\n/**\n * Responsive sections of links. Will become an accordion on mobile.\n *\n * Use with `Footer.LinkSection` for each section.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile and Desktop. The accordion styling gets removed on desktop */}\n <Accordion\n className={clsx(\"hds-footer__link-sections\", className as undefined)}\n ref={ref}\n {...rest}\n >\n {/* @ts-expect-error -- It's ok */}\n {children}\n </Accordion>\n </>\n );\n },\n);\nFooterLinkSections.displayName = \"Footer.LinkSections\";\n\ninterface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement> {\n heading: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const FooterLinkSection = forwardRef<HTMLDivElement, FooterLinkSectionProps>(\n ({ heading, children, className, ...rest }, ref) => {\n // @ts-expect-error -- It's ok\n const linkListChildren = <LinkList>{children}</LinkList>;\n return (\n <>\n {/* Mobile */}\n <Accordion.Item\n className={clsx(`hds-footer__link-section`, className as undefined)}\n ref={ref}\n {...rest}\n >\n <Accordion.Header>{heading}</Accordion.Header>\n <Accordion.Content>{linkListChildren}</Accordion.Content>\n </Accordion.Item>\n\n {/* Desktop */}\n <div className={clsx(`hds-footer__link-section`, className as undefined)}>\n <h2>{heading}</h2>\n {linkListChildren}\n </div>\n </>\n );\n },\n);\nFooterLinkSection.displayName = \"Footer.LinkSection\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport type { AccordionItemProps } from \"./accordion-item\";\n\nexport interface AccordionProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts type of <AccordionItem/>\n */\n children: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];\n\n /**\n * Adds padding to the left of the accordion\n */\n indent?: boolean;\n\n className?: string;\n}\n\nexport const Accordion: OverridableComponent<AccordionProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, className, indent = true, ...rest }, ref) => {\n return (\n <Component\n {...rest}\n className={clsx(\n \"hds-accordion\",\n !indent && \"hds-accordion--no-indent\",\n className as undefined,\n )}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\n\nAccordion.displayName = \"Accordion\";\n","import type { HTMLAttributes, ReactElement } from \"react\";\nimport { forwardRef, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\nimport type { AccordionHeaderProps } from \"./accordion-header\";\nimport type { AccordionContentProps } from \"./accordion-content\";\n\nexport type AccordionItemChildrenType =\n | ReactElement<AccordionHeaderProps>\n | ReactElement<AccordionContentProps>;\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Control the open state of the accordion manually\n */\n open?: boolean;\n\n /**\n * Use with open to control the open state of the accordion manually\n */\n onOpenChange?: (open: boolean) => void;\n\n /**\n * If the accordion should be open by default\n */\n defaultOpen?: boolean;\n\n /**\n * Accepts type of Accordion.Content and Accordion.Header\n */\n children: AccordionItemChildrenType[];\n}\n\nexport const AccordionItem: OverridableComponent<AccordionItemProps, HTMLDivElement> = forwardRef(\n (\n {\n as: Component = \"div\",\n children,\n defaultOpen,\n open: outerOpen,\n onOpenChange,\n className,\n ...rest\n },\n ref,\n ) => {\n const [innerOpen, setInnerOpen] = useState(defaultOpen ?? false);\n const open = outerOpen ?? innerOpen;\n\n const handleOpen = () => {\n if (outerOpen !== undefined) {\n onOpenChange && onOpenChange(!open);\n } else {\n setInnerOpen(!open);\n }\n };\n\n return (\n <Component\n {...rest}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item\", className as undefined)}\n ref={ref}\n >\n <AccordionItemContext.Provider value={{ open, setOpen: handleOpen }}>\n {children}\n </AccordionItemContext.Provider>\n </Component>\n );\n },\n);\n\nAccordionItem.displayName = \"Accordion.Item\";\n","import { createContext } from \"react\";\n\nexport interface AccordionItemContextProps {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const AccordionItemContext = createContext<AccordionItemContextProps | null>(null);\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionHeaderProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n}\n\nexport const AccordionHeader: OverridableComponent<AccordionHeaderProps, HTMLButtonElement> =\n forwardRef(({ as: Component = \"button\", children, className, onClick, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n const expandOrCollapse = (e: MouseEvent<HTMLButtonElement>) => {\n context.setOpen(!context.open);\n onClick && onClick(e);\n };\n return (\n <Component\n {...rest}\n aria-expanded={context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n className={clsx(\"hds-accordion-item-header\", className as undefined)}\n onClick={expandOrCollapse}\n ref={ref}\n type=\"button\"\n >\n <span>{children}</span>\n </Component>\n );\n });\n\nAccordionHeader.displayName = \"Accordion.Header\";\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useContext } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\nimport { AccordionItemContext } from \"./context\";\n\nexport interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport const AccordionContent: OverridableComponent<AccordionContentProps, HTMLDivElement> =\n forwardRef(({ as: Component = \"div\", children, className, ...rest }, ref) => {\n const context = useContext(AccordionItemContext);\n if (context === null) {\n return null;\n }\n return (\n <Component\n aria-hidden={!context.open}\n data-state={context.open ? \"open\" : \"closed\"}\n inert={context.open ? undefined : \"true\"}\n className={clsx(\"hds-accordion-item-content\", className as undefined)}\n ref={ref}\n {...rest}\n >\n <div className={clsx(\"hds-accordion-item-content-inner\")}>{children}</div>\n </Component>\n );\n });\n\nAccordionContent.displayName = \"Accordion.Content\";\n","import { Accordion } from \"./accordion\";\nimport { AccordionItem } from \"./accordion-item\";\nimport { AccordionHeader } from \"./accordion-header\";\nimport { AccordionContent } from \"./accordion-content\";\n\nconst AccordionComponent = Accordion as typeof Accordion & {\n Item: typeof AccordionItem;\n Header: typeof AccordionHeader;\n Content: typeof AccordionContent;\n};\n\nAccordionComponent.Item = AccordionItem;\nAccordionComponent.Header = AccordionHeader;\nAccordionComponent.Content = AccordionContent;\n\nexport { AccordionComponent as Accordion, AccordionItem, AccordionHeader, AccordionContent };\n\nexport type * from \"./accordion\";\nexport type * from \"./accordion-item\";\nexport type * from \"./accordion-header\";\nexport type * from \"./accordion-content\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ListProps } from \"./list\";\nimport { UnorderedList } from \"./list\";\n\nexport interface LinkListProps extends Omit<ListProps, \"listStyle\"> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n}\n\n/**\n * Show a list of links\n *\n * For other list types use `UnorderedList` and `OrderedList`, or use your own list component using the semantic `ul` and `ol` tags.\n */\nexport function LinkList({ className, ...rest }: LinkListProps) {\n return (\n <UnorderedList className={clsx(\"hds-list--link-list\", className as undefined)} {...rest} />\n );\n}\n\nLinkList.displayName = \"LinkList\";\n","import type { HTMLAttributes } from \"react\";\nimport * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {\n children?: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];\n /**\n * Sets the size of the items (font)\n */\n size?: \"small\" | \"medium\" | \"large\";\n}\n\nfunction BaseList({\n as: ListTag = \"ul\",\n children,\n size = \"medium\",\n className,\n ...rest\n}: ListProps & { as?: \"ul\" | \"ol\" }) {\n return (\n <ListTag className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)} {...rest}>\n {children}\n </ListTag>\n );\n}\n\n/**\n * An unordered list of simple items, often text. You can nest other lists inside this component.\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function UnorderedList(props: ListProps) {\n return (\n <BaseList as=\"ul\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\n/**\n * An ordered list of simple items\n *\n * If you have other list needs build your own using the semantic `ul` and `ol` tags.\n */\nexport function OrderedList(props: ListProps) {\n return (\n <BaseList as=\"ol\" {...props}>\n {props.children}\n </BaseList>\n );\n}\n\nBaseList.displayName = \"BaseList\";\nOrderedList.displayName = \"OrderedList\";\nUnorderedList.displayName = \"UnorderedList\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n /**\n * The background fill of the button\n */\n fill?: \"contained\" | \"outline\";\n\n /**\n * Make the button use 100% width available.\n * Using the \"mobile\" it only stretch to full width on smaller screens\n */\n fullWidth?: boolean | \"mobile\";\n\n /**\n * Use an icon inside the button\n */\n icon?: React.ReactNode;\n\n children?: React.ReactNode;\n}\n\nexport const BaseButton: OverridableComponent<\n ButtonProps & { variant: \"primary\" | \"secondary\" },\n HTMLButtonElement\n> = forwardRef(\n (\n {\n as: Component = \"button\",\n children,\n variant,\n size = \"medium\",\n fullWidth = false,\n fill = \"contained\",\n icon,\n className,\n ...rest\n },\n ref,\n ) => {\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n {\n [`hds-button--${variant}`]: fill === \"contained\",\n [`hds-button--outline-${variant}`]: fill === \"outline\",\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--icon-only\": icon && !children,\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {icon && !children ? icon : null}\n {children}\n </Component>\n );\n },\n);\nBaseButton.displayName = \"BaseButton\";\n\n/**\n * ## TODO\n *\n * - [x] Handle links that looks like buttons\n * - [ ] Revisit how to handle outline\n * - [ ] Figure out outline-white\n */\n\nexport const PrimaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"primary\" />;\n },\n);\n\nPrimaryButton.displayName = \"PrimaryButton\";\n\nexport const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement> = forwardRef(\n (props, ref) => {\n return <BaseButton {...props} ref={ref} variant=\"secondary\" />;\n },\n);\n\nSecondaryButton.displayName = \"SecondaryButton\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAmE;AACnE,IAAAC,0BAAqB;AACrB,wBAAqB;;;ACDrB,mBAA2B;AAC3B,6BAAqB;AAqBf;AAHC,IAAM,gBAAkE;AAAA,EAC7E,CAAC,IAAwE,QAAQ;AAAhF,iBAAE,MAAI,YAAY,OAAO,UAAU,WAAW,SA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AAU,QAAV,EAAkB,mBAAQ;AAAA,YAC3B,6CAAC,mBAAU,SAAV,EAAmB,4BAAiB;AAAA;AAAA;AAAA,MACvC;AAAA,MAGA,8CAAC,SAAI,eAAW,8BAAK,4BAA4B,SAAsB,GACrE;AAAA,qDAAC,QAAI,mBAAQ;AAAA,QACZ;AAAA,SACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;;;AD9IhC,IAAM,kBAAkB;AAMxB,gBAAgB,OAAO;AACvB,gBAAgB,aAAa;AAC7B,gBAAgB,eAAe;AAC/B,gBAAgB,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_react","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","React","import_typed_classname","import_typed_classname","import_jsx_runtime","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/footer/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FooterComponent
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-CSAEHQ4R.mjs";
|
|
4
4
|
import {
|
|
5
5
|
FooterButtonLink,
|
|
6
6
|
FooterLinkSection,
|
|
7
7
|
FooterLinkSections,
|
|
8
8
|
FooterLogo
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-S3BGPCLK.mjs";
|
|
10
10
|
import "../chunk-GJDRW6PA.mjs";
|
|
11
11
|
import "../chunk-PMLDK3VC.mjs";
|
|
12
12
|
import "../chunk-HT2EIJAD.mjs";
|
|
13
|
+
import "../chunk-BWFFP6BB.mjs";
|
|
13
14
|
import "../chunk-XYIY6FHW.mjs";
|
|
14
|
-
import "../chunk-OUHO4LGN.mjs";
|
|
15
15
|
import "../chunk-GUB3UCXO.mjs";
|
|
16
16
|
import "../chunk-YXHXRUFX.mjs";
|
|
17
17
|
import "../chunk-62F4I3MQ.mjs";
|
package/dist/form/index.mjs
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import "../chunk-XFKD6EEJ.mjs";
|
|
2
|
-
import "../chunk-BYEJZSG5.mjs";
|
|
3
|
-
import {
|
|
4
|
-
Select
|
|
5
|
-
} from "../chunk-DFH4YKQA.mjs";
|
|
6
2
|
import "../chunk-AGZHQDCQ.mjs";
|
|
7
3
|
import {
|
|
8
4
|
Textarea
|
|
9
5
|
} from "../chunk-KTRIVJM3.mjs";
|
|
10
|
-
import "../chunk-7LPYJC6S.mjs";
|
|
11
|
-
import {
|
|
12
|
-
Input
|
|
13
|
-
} from "../chunk-YC7MT6SO.mjs";
|
|
14
6
|
import "../chunk-2KX7VFN2.mjs";
|
|
15
7
|
import {
|
|
16
8
|
Radiobutton
|
|
@@ -19,7 +11,21 @@ import {
|
|
|
19
11
|
RadioGroup,
|
|
20
12
|
useRadioGroupContext
|
|
21
13
|
} from "../chunk-6NGF7FFY.mjs";
|
|
14
|
+
import "../chunk-BYEJZSG5.mjs";
|
|
15
|
+
import {
|
|
16
|
+
Select
|
|
17
|
+
} from "../chunk-DFH4YKQA.mjs";
|
|
22
18
|
import "../chunk-YJOOSTJC.mjs";
|
|
19
|
+
import "../chunk-TDLSHJ4Z.mjs";
|
|
20
|
+
import {
|
|
21
|
+
DatePicker
|
|
22
|
+
} from "../chunk-G2SOAFGS.mjs";
|
|
23
|
+
import "../chunk-7LPYJC6S.mjs";
|
|
24
|
+
import {
|
|
25
|
+
Input
|
|
26
|
+
} from "../chunk-YC7MT6SO.mjs";
|
|
27
|
+
import "../chunk-Y5SUMFYJ.mjs";
|
|
28
|
+
import "../chunk-TNU64NUN.mjs";
|
|
23
29
|
import {
|
|
24
30
|
Checkbox
|
|
25
31
|
} from "../chunk-RHCMBJOT.mjs";
|
|
@@ -28,12 +34,6 @@ import {
|
|
|
28
34
|
Fieldset,
|
|
29
35
|
useFieldsetContext
|
|
30
36
|
} from "../chunk-DM4PJFLG.mjs";
|
|
31
|
-
import "../chunk-TDLSHJ4Z.mjs";
|
|
32
|
-
import {
|
|
33
|
-
DatePicker
|
|
34
|
-
} from "../chunk-G2SOAFGS.mjs";
|
|
35
|
-
import "../chunk-Y5SUMFYJ.mjs";
|
|
36
|
-
import "../chunk-TNU64NUN.mjs";
|
|
37
37
|
import "../chunk-NSLSA7F7.mjs";
|
|
38
38
|
import {
|
|
39
39
|
ErrorMessage
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelpText_alias_2 as HelpText } from '../_tsup-dts-rollup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelpText_alias_2 as HelpText } from '../_tsup-dts-rollup';
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/help-text/help-text.tsx
|
|
60
|
+
var help_text_exports = {};
|
|
61
|
+
__export(help_text_exports, {
|
|
62
|
+
HelpText: () => HelpText
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(help_text_exports);
|
|
65
|
+
var Popover = __toESM(require("@radix-ui/react-popover"));
|
|
66
|
+
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
|
|
67
|
+
var import_react2 = require("react");
|
|
68
|
+
|
|
69
|
+
// src/box/box.tsx
|
|
70
|
+
var import_react = require("react");
|
|
71
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
72
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
73
|
+
var Box = (0, import_react.forwardRef)(
|
|
74
|
+
(_a, ref) => {
|
|
75
|
+
var _b = _a, {
|
|
76
|
+
as: Component = "div",
|
|
77
|
+
variant,
|
|
78
|
+
closeable = false,
|
|
79
|
+
onClose: onCloseProp,
|
|
80
|
+
closed: closedProp,
|
|
81
|
+
closeButtonProps,
|
|
82
|
+
children,
|
|
83
|
+
className
|
|
84
|
+
} = _b, rest = __objRest(_b, [
|
|
85
|
+
"as",
|
|
86
|
+
"variant",
|
|
87
|
+
"closeable",
|
|
88
|
+
"onClose",
|
|
89
|
+
"closed",
|
|
90
|
+
"closeButtonProps",
|
|
91
|
+
"children",
|
|
92
|
+
"className"
|
|
93
|
+
]);
|
|
94
|
+
const [closedState, setClosedState] = (0, import_react.useState)(false);
|
|
95
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
96
|
+
if (onCloseProp) {
|
|
97
|
+
const result = onCloseProp();
|
|
98
|
+
if (result === true) {
|
|
99
|
+
setClosedState(true);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
setClosedState(true);
|
|
103
|
+
}
|
|
104
|
+
}, []);
|
|
105
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
107
|
+
Component,
|
|
108
|
+
__spreadProps(__spreadValues({
|
|
109
|
+
className: (0, import_typed_classname.clsx)(
|
|
110
|
+
"hds-box",
|
|
111
|
+
variant && `hds-box--${variant}`,
|
|
112
|
+
{ "hds-box--closed": closed },
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
ref
|
|
116
|
+
}, rest), {
|
|
117
|
+
children: [
|
|
118
|
+
closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
119
|
+
children
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
Box.displayName = "Box";
|
|
126
|
+
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
127
|
+
(_a, ref) => {
|
|
128
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
"button",
|
|
131
|
+
__spreadValues({
|
|
132
|
+
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
133
|
+
ref,
|
|
134
|
+
type: "button"
|
|
135
|
+
}, rest)
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
BoxCloseButton.displayName = "Box.CloseButton";
|
|
140
|
+
|
|
141
|
+
// src/box/index.tsx
|
|
142
|
+
var BoxComponent = Box;
|
|
143
|
+
BoxComponent.CloseButton = BoxCloseButton;
|
|
144
|
+
|
|
145
|
+
// src/help-text/help-text.tsx
|
|
146
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
147
|
+
var HelpText = (0, import_react2.forwardRef)(
|
|
148
|
+
(_a, ref) => {
|
|
149
|
+
var _b = _a, { children, className, helpText, title, side = "top", align = "start", boxProps } = _b, rest = __objRest(_b, ["children", "className", "helpText", "title", "side", "align", "boxProps"]);
|
|
150
|
+
return (
|
|
151
|
+
// NOTE: Using radix's [Popover component](https://www.radix-ui.com/primitives/docs/components/popover)
|
|
152
|
+
// In the future we can use the native popover api, but as of writing, though all browsers support it
|
|
153
|
+
// it's not far enough back to be used in production
|
|
154
|
+
// https://caniuse.com/mdn-html_elements_input_popovertarget
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Popover.Root, { children: [
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
157
|
+
"button",
|
|
158
|
+
__spreadProps(__spreadValues({
|
|
159
|
+
ref,
|
|
160
|
+
className: (0, import_typed_classname2.clsx)("hds-help-text-button", className),
|
|
161
|
+
title,
|
|
162
|
+
type: "button"
|
|
163
|
+
}, rest), {
|
|
164
|
+
children
|
|
165
|
+
})
|
|
166
|
+
) }),
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Popover.Content, { asChild: true, side, align, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
168
|
+
BoxComponent,
|
|
169
|
+
__spreadProps(__spreadValues({}, boxProps), {
|
|
170
|
+
className: (0, import_typed_classname2.clsx)("hds-help-text-box", boxProps == null ? void 0 : boxProps.className),
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Popover.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxComponent.CloseButton, {}) }),
|
|
173
|
+
helpText
|
|
174
|
+
]
|
|
175
|
+
})
|
|
176
|
+
) }) })
|
|
177
|
+
] })
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
HelpText.displayName = "HelpText";
|
|
182
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
183
|
+
0 && (module.exports = {
|
|
184
|
+
HelpText
|
|
185
|
+
});
|
|
186
|
+
//# sourceMappingURL=help-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/help-text/help-text.tsx","../../src/box/box.tsx","../../src/box/index.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef } from \"react\";\nimport { Box } from \"../box\";\n\ninterface HelpTextProps extends React.HTMLAttributes<HTMLButtonElement> {\n className?: string;\n\n /**\n * The content of the help text, often a word or phrase that could use some explanation\n */\n children: React.ReactNode;\n\n /**\n * The help text that will be shown when the user clicks the trigger\n */\n helpText: React.ReactNode;\n\n /**\n * The title of the help text. Used by screen readers and if the user hover over the help text\n */\n title?: string;\n\n /**\n * Props for the `Box` that contains the help text\n */\n boxProps?: React.ComponentProps<typeof Box>;\n\n /**\n * The side of the trigger the popover should be attached to\n *\n * default is `top`\n */\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\n /**\n * The alignment of the popover content\n *\n * default is `start`\n */\n align?: \"center\" | \"end\" | \"start\";\n}\n\n/**\n * Show a help text for a word or phrase when clicked\n *\n * Useful for providing explanations for domain-specific terms, acronyms or phrases that could do with further elaboration\n *\n * **Usage**\n * ```tsx\n * <p>\n * En annen avgjørende faktor for avgifter er om nettbutikken er registrert i{\" \"}\n * <HelpText helpText={`VOEC er en forkortelse for \"VAT on E-commerce\" (mva. på e-handel).`}>\n * VOEC\n * </HelpText>\n * </p>\n * ```\n */\nexport const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(\n (\n { children, className, helpText, title, side = \"top\", align = \"start\", boxProps, ...rest },\n ref,\n ) => {\n return (\n // NOTE: Using radix's [Popover component](https://www.radix-ui.com/primitives/docs/components/popover)\n // In the future we can use the native popover api, but as of writing, though all browsers support it\n // it's not far enough back to be used in production\n // https://caniuse.com/mdn-html_elements_input_popovertarget\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n ref={ref}\n className={clsx(\"hds-help-text-button\", className as undefined)}\n title={title}\n type=\"button\"\n {...rest}\n >\n {children}\n </button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content asChild side={side} align={align}>\n <Box\n {...boxProps}\n className={clsx(\"hds-help-text-box\", boxProps?.className as undefined)}\n >\n <Popover.Close asChild>\n <Box.CloseButton />\n </Popover.Close>\n {helpText}\n </Box>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n },\n);\nHelpText.displayName = \"HelpText\";\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { OverridableComponent } from \"../utils\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n variant?: \"light-grey\" | \"lighter\" | \"white\" | \"warning\";\n children?: React.ReactNode;\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n}\n\nexport const Box: OverridableComponent<BoxProps, HTMLDivElement> = forwardRef(\n (\n {\n as: Component = \"div\",\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n\n return (\n <Component\n className={clsx(\n \"hds-box\",\n variant && `hds-box--${variant}`,\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n {children}\n </Component>\n );\n },\n);\nBox.displayName = \"Box\";\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n />\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n","import { Box, BoxCloseButton } from \"./box\";\n\nconst BoxComponent = Box as typeof Box & {\n CloseButton: typeof BoxCloseButton;\n};\nBoxComponent.CloseButton = BoxCloseButton;\n\nexport { BoxComponent as Box, BoxCloseButton };\n\nexport type * from \"./box\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAyB;AACzB,IAAAA,0BAAqB;AACrB,IAAAC,gBAA2B;;;ACF3B,mBAAkD;AAClD,6BAAqB;AAmEf;AA9BC,IAAM,UAAsD;AAAA,EACjE,CACE,IAWA,QACG;AAZH,iBACE;AAAA,UAAI,YAAY;AAAA,MAChB;AAAA,MACA,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IAhDN,IAwCI,IASK,iBATL,IASK;AAAA,MARH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAKF,UAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK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AA,YAC9D;AAAA,YACA,MAAK;AAAA,aACD,OALL;AAAA,YAOE;AAAA;AAAA,QACH,GACF;AAAA,QACA,6CAAS,gBAAR,EACC,uDAAS,iBAAR,EAAgB,SAAO,MAAC,MAAY,OACnC;AAAA,UAAC;AAAA,2CACK,WADL;AAAA,YAEC,eAAW,8BAAK,qBAAqB,qCAAU,SAAsB;AAAA,YAErE;AAAA,2DAAS,eAAR,EAAc,SAAO,MACpB,uDAAC,aAAI,aAAJ,EAAgB,GACnB;AAAA,cACC;AAAA;AAAA;AAAA,QACH,GACF,GACF;AAAA,SACF;AAAA;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["import_typed_classname","import_react","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelpText_alias_3 as HelpText } from '../_tsup-dts-rollup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelpText_alias_3 as HelpText } from '../_tsup-dts-rollup';
|