@postenbring/hedwig-react 0.0.65 → 0.0.67
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 +333 -178
- package/dist/_tsup-dts-rollup.d.ts +333 -178
- package/dist/accordion/index.d.mts +3 -3
- package/dist/accordion/index.d.ts +3 -3
- package/dist/accordion/index.js +8 -2
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +14 -5
- package/dist/box/index.d.mts +1 -1
- package/dist/box/index.d.ts +1 -1
- package/dist/box/index.js +4 -2
- package/dist/box/index.js.map +1 -1
- package/dist/box/index.mjs +6 -3
- package/dist/card/index.d.mts +2 -2
- package/dist/card/index.d.ts +2 -2
- package/dist/card/index.js +12 -2
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +14 -3
- package/dist/{chunk-POJTVNEO.mjs → chunk-2FXMUF6K.mjs} +2 -2
- package/dist/chunk-2FXMUF6K.mjs.map +1 -0
- package/dist/{chunk-DEVTAZKG.mjs → chunk-3KZOKDKP.mjs} +14 -3
- package/dist/chunk-3KZOKDKP.mjs.map +1 -0
- package/dist/{chunk-XFSZBILE.mjs → chunk-6NGF7FFY.mjs} +2 -2
- package/dist/{chunk-MUVJAMFN.mjs → chunk-B56JZJOS.mjs} +10 -8
- package/dist/chunk-B56JZJOS.mjs.map +1 -0
- package/dist/{chunk-RVJD2UZF.mjs → chunk-DFH4YKQA.mjs} +2 -2
- package/dist/chunk-DFH4YKQA.mjs.map +1 -0
- package/dist/{chunk-HXV2UMEV.mjs → chunk-DM4PJFLG.mjs} +2 -2
- package/dist/{chunk-HXV2UMEV.mjs.map → chunk-DM4PJFLG.mjs.map} +1 -1
- package/dist/{chunk-AR2NOI4U.mjs → chunk-EJ7ANN7M.mjs} +1 -1
- package/dist/{chunk-AR2NOI4U.mjs.map → chunk-EJ7ANN7M.mjs.map} +1 -1
- package/dist/chunk-F4STR6SD.mjs +18 -0
- package/dist/chunk-F4STR6SD.mjs.map +1 -0
- package/dist/{chunk-TE5M6GJB.mjs → chunk-FOZSX44S.mjs} +2 -2
- package/dist/{chunk-TE5M6GJB.mjs.map → chunk-FOZSX44S.mjs.map} +1 -1
- package/dist/chunk-G2SOAFGS.mjs +86 -0
- package/dist/chunk-G2SOAFGS.mjs.map +1 -0
- package/dist/{chunk-RLUXDZ6X.mjs → chunk-HMB4TY2F.mjs} +3 -3
- package/dist/{chunk-U2MRMUB2.mjs → chunk-K2HG7WRK.mjs} +2 -2
- package/dist/{chunk-U2MRMUB2.mjs.map → chunk-K2HG7WRK.mjs.map} +1 -1
- package/dist/{chunk-RK6BB3HH.mjs → chunk-KTRIVJM3.mjs} +2 -2
- package/dist/chunk-L4GQJETB.mjs +1 -0
- package/dist/chunk-NE6W2PCD.mjs +9 -0
- package/dist/chunk-NE6W2PCD.mjs.map +1 -0
- package/dist/{chunk-BZNDK3KJ.mjs → chunk-NMMFIRLZ.mjs} +1 -1
- package/dist/{chunk-BZNDK3KJ.mjs.map → chunk-NMMFIRLZ.mjs.map} +1 -1
- package/dist/{chunk-EHUVLDIZ.mjs → chunk-O32FZU7E.mjs} +11 -14
- package/dist/chunk-O32FZU7E.mjs.map +1 -0
- package/dist/{chunk-IAS3E2S3.mjs → chunk-PUESATBQ.mjs} +2 -2
- package/dist/chunk-QGZU7Z2W.mjs +51 -0
- package/dist/chunk-QGZU7Z2W.mjs.map +1 -0
- package/dist/{chunk-QSYU64U4.mjs → chunk-QYSLVQ4F.mjs} +2 -2
- package/dist/{chunk-QSYU64U4.mjs.map → chunk-QYSLVQ4F.mjs.map} +1 -1
- package/dist/{chunk-X7EKQZNU.mjs → chunk-RHCMBJOT.mjs} +2 -2
- package/dist/chunk-TDLSHJ4Z.mjs +1 -0
- package/dist/{chunk-SKI2APSK.mjs → chunk-TNU64NUN.mjs} +13 -7
- package/dist/chunk-TNU64NUN.mjs.map +1 -0
- package/dist/{chunk-JC6DBIFE.mjs → chunk-XE4UZBL2.mjs} +1 -1
- package/dist/{chunk-JC6DBIFE.mjs.map → chunk-XE4UZBL2.mjs.map} +1 -1
- package/dist/chunk-XFKD6EEJ.mjs +1 -0
- package/dist/chunk-XFKD6EEJ.mjs.map +1 -0
- package/dist/{chunk-LIQ3FB56.mjs → chunk-XYIY6FHW.mjs} +7 -7
- package/dist/{chunk-LIQ3FB56.mjs.map → chunk-XYIY6FHW.mjs.map} +1 -1
- package/dist/{chunk-6TI7ACBR.mjs → chunk-YC7MT6SO.mjs} +2 -2
- package/dist/{chunk-WCA2WPFS.mjs → chunk-ZL56N4UK.mjs} +14 -2
- package/dist/{chunk-WCA2WPFS.mjs.map → chunk-ZL56N4UK.mjs.map} +1 -1
- package/dist/{chunk-VFFIUNR6.mjs → chunk-ZRFDCZ62.mjs} +5 -5
- package/dist/chunk-ZRFDCZ62.mjs.map +1 -0
- package/dist/footer/footer.js +9 -12
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +5 -5
- package/dist/footer/index.d.mts +3 -3
- package/dist/footer/index.d.ts +3 -3
- package/dist/footer/index.js +19 -14
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +16 -7
- package/dist/form/checkbox/checkbox.js +1 -1
- package/dist/form/checkbox/checkbox.js.map +1 -1
- package/dist/form/checkbox/checkbox.mjs +2 -2
- package/dist/form/checkbox/index.js +1 -1
- package/dist/form/checkbox/index.js.map +1 -1
- package/dist/form/checkbox/index.mjs +2 -2
- package/dist/form/date-picker/date-picker.d.mts +2 -0
- package/dist/form/date-picker/date-picker.d.ts +2 -0
- package/dist/form/date-picker/date-picker.js +265 -0
- package/dist/form/date-picker/date-picker.js.map +1 -0
- package/dist/form/date-picker/date-picker.mjs +13 -0
- package/dist/form/date-picker/date-picker.mjs.map +1 -0
- package/dist/form/date-picker/index.d.mts +2 -0
- package/dist/form/date-picker/index.d.ts +2 -0
- package/dist/form/date-picker/index.js +267 -0
- package/dist/form/date-picker/index.js.map +1 -0
- package/dist/form/date-picker/index.mjs +14 -0
- package/dist/form/date-picker/index.mjs.map +1 -0
- package/dist/form/fieldset/fieldset.js +1 -1
- package/dist/form/fieldset/fieldset.js.map +1 -1
- package/dist/form/fieldset/fieldset.mjs +1 -1
- package/dist/form/fieldset/index.js +1 -1
- package/dist/form/fieldset/index.js.map +1 -1
- package/dist/form/fieldset/index.mjs +1 -1
- package/dist/form/index.d.mts +10 -8
- package/dist/form/index.d.ts +10 -8
- package/dist/form/index.js +240 -132
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +20 -14
- package/dist/form/input/index.js +12 -6
- package/dist/form/input/index.js.map +1 -1
- package/dist/form/input/index.mjs +2 -2
- package/dist/form/input/input.js +12 -6
- package/dist/form/input/input.js.map +1 -1
- package/dist/form/input/input.mjs +2 -2
- package/dist/form/input-group/index.js +12 -6
- package/dist/form/input-group/index.js.map +1 -1
- package/dist/form/input-group/index.mjs +1 -1
- package/dist/form/input-group/input-group.js +12 -6
- package/dist/form/input-group/input-group.js.map +1 -1
- package/dist/form/input-group/input-group.mjs +1 -1
- package/dist/form/radiobutton/index.js +1 -1
- package/dist/form/radiobutton/index.js.map +1 -1
- package/dist/form/radiobutton/index.mjs +3 -3
- package/dist/form/radiobutton/radiobutton.js +1 -1
- package/dist/form/radiobutton/radiobutton.js.map +1 -1
- package/dist/form/radiobutton/radiobutton.mjs +3 -3
- package/dist/form/radiobutton/radiogroup.js +1 -1
- package/dist/form/radiobutton/radiogroup.js.map +1 -1
- package/dist/form/radiobutton/radiogroup.mjs +2 -2
- package/dist/form/select/index.js +12 -6
- package/dist/form/select/index.js.map +1 -1
- package/dist/form/select/index.mjs +2 -2
- package/dist/form/select/select.js +12 -6
- package/dist/form/select/select.js.map +1 -1
- package/dist/form/select/select.mjs +2 -2
- package/dist/form/textarea/index.js +12 -6
- package/dist/form/textarea/index.js.map +1 -1
- package/dist/form/textarea/index.mjs +2 -2
- package/dist/form/textarea/textarea.js +12 -6
- package/dist/form/textarea/textarea.js.map +1 -1
- package/dist/form/textarea/textarea.mjs +2 -2
- package/dist/index-no-css.d.mts +36 -28
- package/dist/index-no-css.d.ts +36 -28
- package/dist/index-no-css.js +614 -409
- package/dist/index-no-css.js.map +1 -1
- package/dist/index-no-css.mjs +130 -52
- package/dist/index.d.mts +36 -28
- package/dist/index.d.ts +36 -28
- package/dist/index.js +614 -409
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -52
- package/dist/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +5 -1
- package/dist/layout/index.d.ts +5 -1
- package/dist/layout/index.js +62 -2
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/index.mjs +12 -2
- package/dist/layout/responsive.d.mts +2 -0
- package/dist/layout/responsive.d.ts +2 -0
- package/dist/layout/responsive.js +42 -0
- package/dist/layout/responsive.js.map +1 -0
- package/dist/layout/responsive.mjs +8 -0
- package/dist/layout/responsive.mjs.map +1 -0
- package/dist/layout/spacing.d.mts +3 -0
- package/dist/layout/spacing.d.ts +3 -0
- package/dist/layout/spacing.js +33 -0
- package/dist/layout/spacing.js.map +1 -0
- package/dist/layout/spacing.mjs +8 -0
- package/dist/layout/spacing.mjs.map +1 -0
- package/dist/layout/stack/index.d.mts +4 -0
- package/dist/layout/stack/index.d.ts +4 -0
- package/dist/layout/stack/index.js +117 -0
- package/dist/layout/stack/index.js.map +1 -0
- package/dist/layout/stack/index.mjs +14 -0
- package/dist/layout/stack/index.mjs.map +1 -0
- package/dist/layout/stack/stack.d.mts +4 -0
- package/dist/layout/stack/stack.d.ts +4 -0
- package/dist/layout/stack/stack.js +115 -0
- package/dist/layout/stack/stack.js.map +1 -0
- package/dist/layout/stack/stack.mjs +14 -0
- package/dist/layout/stack/stack.mjs.map +1 -0
- package/dist/message/index.d.mts +2 -0
- package/dist/message/index.d.ts +2 -0
- package/dist/message/index.js +6 -2
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +8 -3
- package/dist/message/message.d.mts +2 -2
- package/dist/message/message.d.ts +2 -2
- package/dist/modal/index.d.mts +2 -2
- package/dist/modal/index.d.ts +2 -2
- package/dist/modal/index.js +8 -2
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +11 -4
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +2 -2
- package/dist/navbar/index.d.mts +3 -3
- package/dist/navbar/index.d.ts +3 -3
- package/dist/navbar/index.js +42 -11
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +13 -3
- package/dist/navbar/navbar-expandable-menu.js +34 -11
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +2 -1
- package/dist/tabs/index.d.mts +5 -5
- package/dist/tabs/index.d.ts +5 -5
- package/dist/tabs/index.js +26 -6
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +15 -5
- package/dist/tabs/tabs-list.d.mts +2 -2
- package/dist/tabs/tabs-list.d.ts +2 -2
- package/dist/tabs/tabs-list.js +19 -7
- package/dist/tabs/tabs-list.js.map +1 -1
- package/dist/tabs/tabs-list.mjs +6 -6
- package/dist/utils.d.mts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +13 -0
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +3 -1
- package/dist/warning-banner/index.js.map +1 -1
- package/dist/warning-banner/index.mjs +2 -2
- package/dist/warning-banner/warning-banner.js.map +1 -1
- package/dist/warning-banner/warning-banner.mjs +2 -2
- package/package.json +4 -4
- package/dist/chunk-DEVTAZKG.mjs.map +0 -1
- package/dist/chunk-EHUVLDIZ.mjs.map +0 -1
- package/dist/chunk-MUVJAMFN.mjs.map +0 -1
- package/dist/chunk-OIQUYB26.mjs +0 -1
- package/dist/chunk-POJTVNEO.mjs.map +0 -1
- package/dist/chunk-RVJD2UZF.mjs.map +0 -1
- package/dist/chunk-SKI2APSK.mjs.map +0 -1
- package/dist/chunk-T24JZIQO.mjs +0 -1
- package/dist/chunk-VFFIUNR6.mjs.map +0 -1
- /package/dist/{chunk-XFSZBILE.mjs.map → chunk-6NGF7FFY.mjs.map} +0 -0
- /package/dist/{chunk-RLUXDZ6X.mjs.map → chunk-HMB4TY2F.mjs.map} +0 -0
- /package/dist/{chunk-RK6BB3HH.mjs.map → chunk-KTRIVJM3.mjs.map} +0 -0
- /package/dist/{chunk-OIQUYB26.mjs.map → chunk-L4GQJETB.mjs.map} +0 -0
- /package/dist/{chunk-IAS3E2S3.mjs.map → chunk-PUESATBQ.mjs.map} +0 -0
- /package/dist/{chunk-X7EKQZNU.mjs.map → chunk-RHCMBJOT.mjs.map} +0 -0
- /package/dist/{chunk-T24JZIQO.mjs.map → chunk-TDLSHJ4Z.mjs.map} +0 -0
- /package/dist/{chunk-6TI7ACBR.mjs.map → chunk-YC7MT6SO.mjs.map} +0 -0
package/dist/footer/footer.js
CHANGED
|
@@ -353,18 +353,15 @@ FooterLogo.displayName = "Footer.Logo";
|
|
|
353
353
|
var FooterLinkSections = (0, import_react7.forwardRef)(
|
|
354
354
|
(_a, ref) => {
|
|
355
355
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
356
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
),
|
|
366
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_typed_classname8.clsx)("hds-footer__link-sections", className) }, rest), { children }))
|
|
367
|
-
] });
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
357
|
+
AccordionComponent,
|
|
358
|
+
__spreadProps(__spreadValues({
|
|
359
|
+
className: (0, import_typed_classname8.clsx)("hds-footer__link-sections", className),
|
|
360
|
+
ref
|
|
361
|
+
}, rest), {
|
|
362
|
+
children
|
|
363
|
+
})
|
|
364
|
+
) });
|
|
368
365
|
}
|
|
369
366
|
);
|
|
370
367
|
FooterLinkSections.displayName = "Footer.LinkSections";
|
|
@@ -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 *\n * TODO:\n * - [ ] Decrease number of DOM elements rendered. We should not rely on conditional rendering as that will make server-side rendering harder.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile */}\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 {/* Desktop */}\n <div className={clsx(\"hds-footer__link-sections\", className as undefined)} {...rest}>\n {children}\n </div>\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 };\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,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,IA1CN,IAoCI,IAOK,iBAPL,IAOK;AAAA,MANH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAKF,UAA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AACF;AACA,WAAW,cAAc;AAclB,IAAM,yBAAqB;AAAA,EAChC,CAAC,IAAkC,QAAQ;AAA1C,iBAAE,YAAU,UAzGf,IAyGG,IAA0B,iBAA1B,IAA0B,CAAxB,YAAU;AACX,WACE,8EAEE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,8BAAK,6BAA6B,SAAsB;AAAA,UACnE;AAAA,WACI,OAHL;AAAA,UAME;AAAA;AAAA,MACH;AAAA,MAGA,6CAAC,sCAAI,eAAW,8BAAK,6BAA6B,SAAsB,KAAO,OAA9E,EACE,WACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAO1B,IAAM,wBAAoB;AAAA,EAC/B,CAAC,IAA2C,QAAQ;AAAnD,iBAAE,WAAS,UAAU,UAtIxB,IAsIG,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\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":";;;;;;;;;;;;;;;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AA,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"]}
|
package/dist/footer/footer.mjs
CHANGED
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
FooterLinkSection,
|
|
5
5
|
FooterLinkSections,
|
|
6
6
|
FooterLogo
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-O32FZU7E.mjs";
|
|
8
8
|
import "../chunk-GJDRW6PA.mjs";
|
|
9
9
|
import "../chunk-PMLDK3VC.mjs";
|
|
10
|
-
import "../chunk-LIQ3FB56.mjs";
|
|
11
|
-
import "../chunk-62F4I3MQ.mjs";
|
|
12
|
-
import "../chunk-VRIY65P5.mjs";
|
|
13
10
|
import "../chunk-HT2EIJAD.mjs";
|
|
14
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-XYIY6FHW.mjs";
|
|
15
12
|
import "../chunk-GUB3UCXO.mjs";
|
|
16
13
|
import "../chunk-YXHXRUFX.mjs";
|
|
14
|
+
import "../chunk-62F4I3MQ.mjs";
|
|
15
|
+
import "../chunk-VRIY65P5.mjs";
|
|
16
|
+
import "../chunk-OUHO4LGN.mjs";
|
|
17
17
|
import "../chunk-V3PAFMK5.mjs";
|
|
18
18
|
import "../chunk-R4SQKVDQ.mjs";
|
|
19
19
|
export {
|
package/dist/footer/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Footer_alias_3 as Footer } from '../_tsup-dts-rollup';
|
|
2
|
-
export { FooterProps_alias_3 as FooterProps } from '../_tsup-dts-rollup';
|
|
3
|
-
export { FooterButtonLinkProps_alias_3 as FooterButtonLinkProps } from '../_tsup-dts-rollup';
|
|
4
|
-
export { FooterButtonLink_alias_3 as FooterButtonLink } from '../_tsup-dts-rollup';
|
|
5
2
|
export { FooterLogo_alias_3 as FooterLogo } from '../_tsup-dts-rollup';
|
|
3
|
+
export { FooterButtonLink_alias_3 as FooterButtonLink } from '../_tsup-dts-rollup';
|
|
6
4
|
export { FooterLinkSections_alias_3 as FooterLinkSections } from '../_tsup-dts-rollup';
|
|
7
5
|
export { FooterLinkSection_alias_3 as FooterLinkSection } from '../_tsup-dts-rollup';
|
|
6
|
+
export { FooterProps_alias_3 as FooterProps } from '../_tsup-dts-rollup';
|
|
7
|
+
export { FooterButtonLinkProps_alias_3 as FooterButtonLinkProps } from '../_tsup-dts-rollup';
|
package/dist/footer/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Footer_alias_3 as Footer } from '../_tsup-dts-rollup';
|
|
2
|
-
export { FooterProps_alias_3 as FooterProps } from '../_tsup-dts-rollup';
|
|
3
|
-
export { FooterButtonLinkProps_alias_3 as FooterButtonLinkProps } from '../_tsup-dts-rollup';
|
|
4
|
-
export { FooterButtonLink_alias_3 as FooterButtonLink } from '../_tsup-dts-rollup';
|
|
5
2
|
export { FooterLogo_alias_3 as FooterLogo } from '../_tsup-dts-rollup';
|
|
3
|
+
export { FooterButtonLink_alias_3 as FooterButtonLink } from '../_tsup-dts-rollup';
|
|
6
4
|
export { FooterLinkSections_alias_3 as FooterLinkSections } from '../_tsup-dts-rollup';
|
|
7
5
|
export { FooterLinkSection_alias_3 as FooterLinkSection } from '../_tsup-dts-rollup';
|
|
6
|
+
export { FooterProps_alias_3 as FooterProps } from '../_tsup-dts-rollup';
|
|
7
|
+
export { FooterButtonLinkProps_alias_3 as FooterButtonLinkProps } from '../_tsup-dts-rollup';
|
package/dist/footer/index.js
CHANGED
|
@@ -49,7 +49,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
49
49
|
// src/footer/index.tsx
|
|
50
50
|
var footer_exports = {};
|
|
51
51
|
__export(footer_exports, {
|
|
52
|
-
Footer: () => FooterComponent
|
|
52
|
+
Footer: () => FooterComponent,
|
|
53
|
+
FooterButtonLink: () => FooterButtonLink,
|
|
54
|
+
FooterLinkSection: () => FooterLinkSection,
|
|
55
|
+
FooterLinkSections: () => FooterLinkSections,
|
|
56
|
+
FooterLogo: () => FooterLogo
|
|
53
57
|
});
|
|
54
58
|
module.exports = __toCommonJS(footer_exports);
|
|
55
59
|
|
|
@@ -351,18 +355,15 @@ FooterLogo.displayName = "Footer.Logo";
|
|
|
351
355
|
var FooterLinkSections = (0, import_react7.forwardRef)(
|
|
352
356
|
(_a, ref) => {
|
|
353
357
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
),
|
|
364
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_typed_classname8.clsx)("hds-footer__link-sections", className) }, rest), { children }))
|
|
365
|
-
] });
|
|
358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
359
|
+
AccordionComponent,
|
|
360
|
+
__spreadProps(__spreadValues({
|
|
361
|
+
className: (0, import_typed_classname8.clsx)("hds-footer__link-sections", className),
|
|
362
|
+
ref
|
|
363
|
+
}, rest), {
|
|
364
|
+
children
|
|
365
|
+
})
|
|
366
|
+
) });
|
|
366
367
|
}
|
|
367
368
|
);
|
|
368
369
|
FooterLinkSections.displayName = "Footer.LinkSections";
|
|
@@ -400,6 +401,10 @@ FooterComponent.LinkSections = FooterLinkSections;
|
|
|
400
401
|
FooterComponent.LinkSection = FooterLinkSection;
|
|
401
402
|
// Annotate the CommonJS export names for ESM import in node:
|
|
402
403
|
0 && (module.exports = {
|
|
403
|
-
Footer
|
|
404
|
+
Footer,
|
|
405
|
+
FooterButtonLink,
|
|
406
|
+
FooterLinkSection,
|
|
407
|
+
FooterLinkSections,
|
|
408
|
+
FooterLogo
|
|
404
409
|
});
|
|
405
410
|
//# sourceMappingURL=index.js.map
|
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 { FooterComponent as Footer };\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 *\n * TODO:\n * - [ ] Decrease number of DOM elements rendered. We should not rely on conditional rendering as that will make server-side rendering harder.\n */\nexport const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(\n ({ children, className, ...rest }, ref) => {\n return (\n <>\n {/* Mobile */}\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 {/* Desktop */}\n <div className={clsx(\"hds-footer__link-sections\", className as undefined)} {...rest}>\n {children}\n </div>\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 };\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 <BaseBut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6BAA6B,SAAsB;AAAA,UACnE;AAAA,WACI,OAHL;AAAA,UAME;AAAA;AAAA,MACH;AAAA,MAGA,6CAAC,sCAAI,eAAW,8BAAK,6BAA6B,SAAsB,KAAO,OAA9E,EACE,WACH;AAAA,OACF;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAO1B,IAAM,wBAAoB;AAAA,EAC/B,CAAC,IAA2C,QAAQ;AAAnD,iBAAE,WAAS,UAAU,UAtIxB,IAsIG,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;;;ADtJhC,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\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,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,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,IA1CN,IAoCI,IAOK,iBAPL,IAOK;AAAA,MANH;AAAA,MACA;AAAA,MACA;AAAA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B,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;;;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,19 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FooterComponent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import
|
|
3
|
+
} from "../chunk-K2HG7WRK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
FooterButtonLink,
|
|
6
|
+
FooterLinkSection,
|
|
7
|
+
FooterLinkSections,
|
|
8
|
+
FooterLogo
|
|
9
|
+
} from "../chunk-O32FZU7E.mjs";
|
|
5
10
|
import "../chunk-GJDRW6PA.mjs";
|
|
6
11
|
import "../chunk-PMLDK3VC.mjs";
|
|
7
|
-
import "../chunk-LIQ3FB56.mjs";
|
|
8
|
-
import "../chunk-62F4I3MQ.mjs";
|
|
9
|
-
import "../chunk-VRIY65P5.mjs";
|
|
10
12
|
import "../chunk-HT2EIJAD.mjs";
|
|
11
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-XYIY6FHW.mjs";
|
|
12
14
|
import "../chunk-GUB3UCXO.mjs";
|
|
13
15
|
import "../chunk-YXHXRUFX.mjs";
|
|
16
|
+
import "../chunk-62F4I3MQ.mjs";
|
|
17
|
+
import "../chunk-VRIY65P5.mjs";
|
|
18
|
+
import "../chunk-OUHO4LGN.mjs";
|
|
14
19
|
import "../chunk-V3PAFMK5.mjs";
|
|
15
20
|
import "../chunk-R4SQKVDQ.mjs";
|
|
16
21
|
export {
|
|
17
|
-
FooterComponent as Footer
|
|
22
|
+
FooterComponent as Footer,
|
|
23
|
+
FooterButtonLink,
|
|
24
|
+
FooterLinkSection,
|
|
25
|
+
FooterLinkSections,
|
|
26
|
+
FooterLogo
|
|
18
27
|
};
|
|
19
28
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -116,7 +116,7 @@ var Fieldset = (0, import_react.forwardRef)(function Fieldset2(_a, ref) {
|
|
|
116
116
|
children: legend
|
|
117
117
|
})
|
|
118
118
|
),
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldsetContext.Provider, { value: { hasError: Boolean(errorMessage) }, children }),
|
|
120
120
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, { id: errorMessageId, children: errorMessage })
|
|
121
121
|
]
|
|
122
122
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/checkbox/checkbox.tsx","../../../src/form/error-message/error-message.tsx","../../../src/form/fieldset/fieldset.tsx"],"sourcesContent":["import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ReactNode } from \"react\";\n\nexport interface ErrorMessageProps {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport function ErrorMessage({ children, id, className }: ErrorMessageProps) {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n >\n {children}\n </div>\n );\n}\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/form/checkbox/checkbox.tsx","../../../src/form/error-message/error-message.tsx","../../../src/form/fieldset/fieldset.tsx"],"sourcesContent":["import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ReactNode } from \"react\";\n\nexport interface ErrorMessageProps {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport function ErrorMessage({ children, id, className }: ErrorMessageProps) {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n >\n {children}\n </div>\n );\n}\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA4E;AAC5E,IAAAC,0BAAqB;;;ACDrB,6BAAqB;AAWjB;AAFG,SAAS,aAAa,EAAE,UAAU,IAAI,UAAU,GAAsB;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,MAC3D;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACnBA,mBAA6D;AAE7D,IAAAC,0BAAqB;AAqCjB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,4BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,yBAAW,eAAe;AAE3D,IAAM,eAAW,yBAA+C,SAASC,UAC9E,IASA,KACA;AAVA,eAIe;AAAA,IAHb;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA7BjG,IA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AsB,GACzC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW;AAAA,YACT;AAAA,YACA;AAAA,cACE,CAAC,iBAAiB,OAAO,EAAE,GAAG,YAAY;AAAA,cAC1C,uBAAuB;AAAA,YACzB;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,0DAAC,WACC;AAAA;AAAA,gBAAC;AAAA,iDACK,OADL;AAAA,kBAEC,gBAAc,WAAW,OAAO;AAAA,kBAChC,oBAAkB,eAAe,iBAAiB;AAAA,kBAClD;AAAA,kBACA,MAAK;AAAA;AAAA,cACP;AAAA,cACA,6CAAC,UAAK,eAAW,MAAC,WAAU,2BAA0B;AAAA,cACrD,QAAQ,6CAAC,OAAE,WAAU,uBAAuB,iBAAM,IAAO;AAAA,eAC5D;AAAA,YACC,QAAQ,WAAW;AAAA;AAAA;AAAA,MACtB;AAAA,MACC,eAAe,6CAAC,gBAAa,IAAI,gBAAiB,wBAAa,IAAkB;AAAA,OACpF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["import_react","import_typed_classname","import_typed_classname","import_jsx_runtime","Fieldset","import_jsx_runtime"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkbox
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-RHCMBJOT.mjs";
|
|
4
4
|
import "../../chunk-LMF3QGSF.mjs";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-DM4PJFLG.mjs";
|
|
6
6
|
import "../../chunk-NSLSA7F7.mjs";
|
|
7
7
|
import "../../chunk-IL7576PP.mjs";
|
|
8
8
|
import "../../chunk-R4SQKVDQ.mjs";
|
|
@@ -118,7 +118,7 @@ var Fieldset = (0, import_react.forwardRef)(function Fieldset2(_a, ref) {
|
|
|
118
118
|
children: legend
|
|
119
119
|
})
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldsetContext.Provider, { value: { hasError: Boolean(errorMessage) }, children }),
|
|
122
122
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, { id: errorMessageId, children: errorMessage })
|
|
123
123
|
]
|
|
124
124
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/checkbox/index.tsx","../../../src/form/checkbox/checkbox.tsx","../../../src/form/error-message/error-message.tsx","../../../src/form/fieldset/fieldset.tsx"],"sourcesContent":["export { Checkbox } from \"./checkbox\";\nexport type * from \"./checkbox\";\n","import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ReactNode } from \"react\";\n\nexport interface ErrorMessageProps {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport function ErrorMessage({ children, id, className }: ErrorMessageProps) {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n >\n {children}\n </div>\n );\n}\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/form/checkbox/index.tsx","../../../src/form/checkbox/checkbox.tsx","../../../src/form/error-message/error-message.tsx","../../../src/form/fieldset/fieldset.tsx"],"sourcesContent":["export { Checkbox } from \"./checkbox\";\nexport type * from \"./checkbox\";\n","import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport type { ReactNode } from \"react\";\n\nexport interface ErrorMessageProps {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport function ErrorMessage({ children, id, className }: ErrorMessageProps) {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n >\n {children}\n </div>\n );\n}\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4E;AAC5E,IAAAC,0BAAqB;;;ACDrB,6BAAqB;AAWjB;AAFG,SAAS,aAAa,EAAE,UAAU,IAAI,UAAU,GAAsB;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,MAC3D;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACnBA,mBAA6D;AAE7D,IAAAC,0BAAqB;AAqCjB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,4BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,yBAAW,eAAe;AAE3D,IAAM,eAAW,yBAA+C,SAASC,UAC9E,IASA,KACA;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B;AAC1D,UAAM,WAAW,CAAC,CAAC,gBAAgB,oBAAoB;AAEvD,WACE,8CAAC,SAAI,eAAW,8BAAK,sBAAsB,GACzC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW;AAAA,YACT;AAAA,YACA;AAAA,cACE,CAAC,iBAAiB,OAAO,EAAE,GAAG,YAAY;AAAA,cAC1C,uBAAuB;AAAA,YACzB;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,0DAAC,WACC;AAAA;AAAA,gBAAC;AAAA,iDACK,OADL;AAAA,kBAEC,gBAAc,WAAW,OAAO;AAAA,kBAChC,oBAAkB,eAAe,iBAAiB;AAAA,kBAClD;AAAA,kBACA,MAAK;AAAA;AAAA,cACP;AAAA,cACA,6CAAC,UAAK,eAAW,MAAC,WAAU,2BAA0B;AAAA,cACrD,QAAQ,6CAAC,OAAE,WAAU,uBAAuB,iBAAM,IAAO;AAAA,eAC5D;AAAA,YACC,QAAQ,WAAW;AAAA;AAAA;AAAA,MACtB;AAAA,MACC,eAAe,6CAAC,gBAAa,IAAI,gBAAiB,wBAAa,IAAkB;AAAA,OACpF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["import_react","import_typed_classname","import_typed_classname","import_jsx_runtime","Fieldset","import_jsx_runtime"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../../chunk-YJOOSTJC.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Checkbox
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-RHCMBJOT.mjs";
|
|
5
5
|
import "../../chunk-LMF3QGSF.mjs";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-DM4PJFLG.mjs";
|
|
7
7
|
import "../../chunk-NSLSA7F7.mjs";
|
|
8
8
|
import "../../chunk-IL7576PP.mjs";
|
|
9
9
|
import "../../chunk-R4SQKVDQ.mjs";
|