@postenbring/hedwig-react 0.0.65 → 0.0.66
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 +133 -52
- package/dist/_tsup-dts-rollup.d.ts +133 -52
- package/dist/accordion/index.mjs +3 -3
- package/dist/chunk-27XJO7E4.mjs +51 -0
- package/dist/chunk-27XJO7E4.mjs.map +1 -0
- package/dist/{chunk-POJTVNEO.mjs → chunk-2ICZ3Q7N.mjs} +1 -1
- package/dist/chunk-2ICZ3Q7N.mjs.map +1 -0
- package/dist/{chunk-TE5M6GJB.mjs → chunk-2JH4FG63.mjs} +2 -2
- package/dist/{chunk-XFSZBILE.mjs → chunk-6NGF7FFY.mjs} +2 -2
- package/dist/{chunk-EHUVLDIZ.mjs → chunk-BZRCDLEW.mjs} +11 -14
- package/dist/chunk-BZRCDLEW.mjs.map +1 -0
- package/dist/{chunk-MUVJAMFN.mjs → chunk-CLXHNRAI.mjs} +7 -7
- package/dist/chunk-CLXHNRAI.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-RLUXDZ6X.mjs → chunk-HMB4TY2F.mjs} +3 -3
- package/dist/{chunk-VFFIUNR6.mjs → chunk-IFGQR4J6.mjs} +5 -5
- package/dist/chunk-IFGQR4J6.mjs.map +1 -0
- package/dist/chunk-L4GQJETB.mjs +1 -0
- package/dist/{chunk-QSYU64U4.mjs → chunk-MRCE2Q7A.mjs} +2 -2
- package/dist/chunk-NE6W2PCD.mjs +9 -0
- package/dist/chunk-NE6W2PCD.mjs.map +1 -0
- package/dist/{chunk-X7EKQZNU.mjs → chunk-RHCMBJOT.mjs} +2 -2
- package/dist/{chunk-U2MRMUB2.mjs → chunk-RXIP2JTE.mjs} +2 -2
- package/dist/{chunk-DEVTAZKG.mjs → chunk-X46LM2QH.mjs} +2 -1
- package/dist/{chunk-DEVTAZKG.mjs.map → chunk-X46LM2QH.mjs.map} +1 -1
- package/dist/{chunk-LIQ3FB56.mjs → chunk-XIHKASNB.mjs} +7 -7
- package/dist/chunk-ZTYEOZLK.mjs +18 -0
- package/dist/chunk-ZTYEOZLK.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.js +9 -12
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +6 -6
- 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/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.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +14 -14
- 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/index-no-css.d.mts +10 -6
- package/dist/index-no-css.d.ts +10 -6
- package/dist/index-no-css.js +267 -201
- package/dist/index-no-css.js.map +1 -1
- package/dist/index-no-css.mjs +66 -46
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +267 -201
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -46
- 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/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +2 -2
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +1 -1
- package/dist/navbar/index.js +1 -0
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +2 -2
- package/dist/navbar/navbar-expandable-menu.js +1 -0
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +1 -1
- package/dist/tabs/index.d.mts +5 -5
- package/dist/tabs/index.d.ts +5 -5
- package/dist/tabs/index.js +13 -5
- 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 +6 -6
- package/dist/tabs/tabs-list.js.map +1 -1
- package/dist/tabs/tabs-list.mjs +6 -6
- package/package.json +4 -4
- 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-VFFIUNR6.mjs.map +0 -1
- /package/dist/{chunk-TE5M6GJB.mjs.map → chunk-2JH4FG63.mjs.map} +0 -0
- /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-OIQUYB26.mjs.map → chunk-L4GQJETB.mjs.map} +0 -0
- /package/dist/{chunk-QSYU64U4.mjs.map → chunk-MRCE2Q7A.mjs.map} +0 -0
- /package/dist/{chunk-X7EKQZNU.mjs.map → chunk-RHCMBJOT.mjs.map} +0 -0
- /package/dist/{chunk-U2MRMUB2.mjs.map → chunk-RXIP2JTE.mjs.map} +0 -0
- /package/dist/{chunk-LIQ3FB56.mjs.map → chunk-XIHKASNB.mjs.map} +0 -0
|
@@ -315,6 +315,8 @@ export { BreadcrumbsProps as BreadcrumbsProps_alias_1 }
|
|
|
315
315
|
export { BreadcrumbsProps as BreadcrumbsProps_alias_2 }
|
|
316
316
|
export { BreadcrumbsProps as BreadcrumbsProps_alias_3 }
|
|
317
317
|
|
|
318
|
+
declare type Breakpoints = "xsmall" | "small" | "medium" | "large" | "xlarge";
|
|
319
|
+
|
|
318
320
|
export declare const ButtonAsLink: Story_17;
|
|
319
321
|
|
|
320
322
|
declare type ButtonProps = ButtonPropsInternal & ({
|
|
@@ -583,8 +585,6 @@ export declare const Darkmode: Story_26;
|
|
|
583
585
|
|
|
584
586
|
export declare const DarkmodeSmall: Story_26;
|
|
585
587
|
|
|
586
|
-
export declare const DefaulDisabled: Story_14;
|
|
587
|
-
|
|
588
588
|
export declare const Default: Story_4;
|
|
589
589
|
|
|
590
590
|
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
@@ -736,18 +736,6 @@ declare interface DimensionsFromWidthAndHeight {
|
|
|
736
736
|
width?: number | string;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
-
export declare const Disabled: Story_5;
|
|
740
|
-
|
|
741
|
-
export declare const DisabledInput: Story_11;
|
|
742
|
-
|
|
743
|
-
export declare const DisabledInputWithError: Story_11;
|
|
744
|
-
|
|
745
|
-
export declare const DisabledOutline: Story_5;
|
|
746
|
-
|
|
747
|
-
export declare const DisabledTextarea: Story_15;
|
|
748
|
-
|
|
749
|
-
export declare const DisabledTextareaWithError: Story_15;
|
|
750
|
-
|
|
751
739
|
declare function ErrorMessage({ children, id, className }: ErrorMessageProps): JSX_2.Element;
|
|
752
740
|
export { ErrorMessage }
|
|
753
741
|
export { ErrorMessage as ErrorMessage_alias_1 }
|
|
@@ -851,9 +839,6 @@ declare interface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement>
|
|
|
851
839
|
* Responsive sections of links. Will become an accordion on mobile.
|
|
852
840
|
*
|
|
853
841
|
* Use with `Footer.LinkSection` for each section.
|
|
854
|
-
*
|
|
855
|
-
* TODO:
|
|
856
|
-
* - [ ] Decrease number of DOM elements rendered. We should not rely on conditional rendering as that will make server-side rendering harder.
|
|
857
842
|
*/
|
|
858
843
|
declare const FooterLinkSections: ForwardRefExoticComponent<FooterLinkSectionsProps & RefAttributes<HTMLDivElement>>;
|
|
859
844
|
export { FooterLinkSections }
|
|
@@ -897,6 +882,10 @@ export { FooterProps as FooterProps_alias_3 }
|
|
|
897
882
|
|
|
898
883
|
export declare const FormWithErrorsOnSubmit: Story_11;
|
|
899
884
|
|
|
885
|
+
export declare function getResponsiveProps<T>(variable: `--hds-${string}`, inputValues?: ResponsiveProp<T>, valueTransformer?: (value: T) => string): Record<string, string>;
|
|
886
|
+
|
|
887
|
+
export declare function getSpacingVariable(size: SpacingSizes | ResponsiveSpacingSizes): string;
|
|
888
|
+
|
|
900
889
|
declare interface HeadingProps {
|
|
901
890
|
variant: "h1-display" | "h1" | "h2" | "h3" | "h3-title";
|
|
902
891
|
as: React_3.ElementType;
|
|
@@ -910,9 +899,20 @@ export declare const HorizontalLongContent: Story_7;
|
|
|
910
899
|
|
|
911
900
|
export declare const HorizontalWithMiddleSelected: Story_27;
|
|
912
901
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
902
|
+
/**
|
|
903
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
904
|
+
*
|
|
905
|
+
* TODO
|
|
906
|
+
* - [ ] Add more examples
|
|
907
|
+
* - [ ] Document usage
|
|
908
|
+
* - [ ] Document props
|
|
909
|
+
*/
|
|
910
|
+
declare const HStack: React_2.ForwardRefExoticComponent<Omit<StackProps, "direction"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
911
|
+
export { HStack }
|
|
912
|
+
export { HStack as HStack_alias_1 }
|
|
913
|
+
export { HStack as HStack_alias_2 }
|
|
914
|
+
export { HStack as HStack_alias_3 }
|
|
915
|
+
export { HStack as HStack_alias_4 }
|
|
916
916
|
|
|
917
917
|
export declare const IconPrimary: Story_5;
|
|
918
918
|
|
|
@@ -1094,10 +1094,13 @@ export declare const MinAndMax: Story_28;
|
|
|
1094
1094
|
something about the consequences.
|
|
1095
1095
|
</p>
|
|
1096
1096
|
</Modal.Content>
|
|
1097
|
-
<Modal.Footer
|
|
1097
|
+
<Modal.Footer>
|
|
1098
|
+
<HStack gap="16" wrap>
|
|
1099
|
+
<PrimaryButton onClick={onMainAction}>Main action</PrimaryButton>
|
|
1098
1100
|
<PrimaryButton fill="outline" onClick={onClose}>
|
|
1099
|
-
|
|
1101
|
+
Cancel
|
|
1100
1102
|
</PrimaryButton>
|
|
1103
|
+
</HStack>
|
|
1101
1104
|
</Modal.Footer>
|
|
1102
1105
|
</Modal>
|
|
1103
1106
|
</>
|
|
@@ -1452,6 +1455,29 @@ export declare const ReadonlyTextarea: Story_15;
|
|
|
1452
1455
|
|
|
1453
1456
|
export declare const ReadonlyTextareaWithError: Story_15;
|
|
1454
1457
|
|
|
1458
|
+
export declare type ResponsiveProp<T> = T | ResponsiveValues<T>;
|
|
1459
|
+
|
|
1460
|
+
export declare type ResponsiveSpacingSizes = keyof typeof responsiveSpacingSizes;
|
|
1461
|
+
|
|
1462
|
+
declare const responsiveSpacingSizes: {
|
|
1463
|
+
readonly "4-8": "4-8";
|
|
1464
|
+
readonly "8-12": "8-12";
|
|
1465
|
+
readonly "12-16": "12-16";
|
|
1466
|
+
readonly "16-20": "16-20";
|
|
1467
|
+
readonly "20-24": "20-24";
|
|
1468
|
+
readonly "24-32": "24-32";
|
|
1469
|
+
readonly "32-40": "32-40";
|
|
1470
|
+
readonly "40-48": "40-48";
|
|
1471
|
+
readonly "48-64": "48-64";
|
|
1472
|
+
readonly "64-80": "64-80";
|
|
1473
|
+
readonly "80-120": "80-120";
|
|
1474
|
+
readonly "120-160": "120-160";
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
declare type ResponsiveValues<T> = {
|
|
1478
|
+
[Breakpoint in Breakpoints]?: T;
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1455
1481
|
export declare const Secondary: Story_5;
|
|
1456
1482
|
|
|
1457
1483
|
declare const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement>;
|
|
@@ -1598,6 +1624,56 @@ export declare const Small: Story_26;
|
|
|
1598
1624
|
|
|
1599
1625
|
export declare const Solid: Story_17;
|
|
1600
1626
|
|
|
1627
|
+
export declare type SpacingSizes = keyof typeof spacingSizes;
|
|
1628
|
+
|
|
1629
|
+
declare const spacingSizes: {
|
|
1630
|
+
readonly "4": "4";
|
|
1631
|
+
readonly "8": "8";
|
|
1632
|
+
readonly "12": "12";
|
|
1633
|
+
readonly "16": "16";
|
|
1634
|
+
readonly "20": "20";
|
|
1635
|
+
readonly "24": "24";
|
|
1636
|
+
readonly "32": "32";
|
|
1637
|
+
readonly "40": "40";
|
|
1638
|
+
readonly "48": "48";
|
|
1639
|
+
readonly "64": "64";
|
|
1640
|
+
readonly "80": "80";
|
|
1641
|
+
readonly "120": "120";
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
1646
|
+
*
|
|
1647
|
+
* TODO
|
|
1648
|
+
* - [ ] Add more examples
|
|
1649
|
+
* - [ ] Document usage
|
|
1650
|
+
* - [ ] Document props
|
|
1651
|
+
*/
|
|
1652
|
+
declare const Stack: React_2.ForwardRefExoticComponent<StackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
1653
|
+
export { Stack }
|
|
1654
|
+
export { Stack as Stack_alias_1 }
|
|
1655
|
+
export { Stack as Stack_alias_2 }
|
|
1656
|
+
export { Stack as Stack_alias_3 }
|
|
1657
|
+
export { Stack as Stack_alias_4 }
|
|
1658
|
+
|
|
1659
|
+
declare interface StackProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1660
|
+
children: React_2.ReactNode;
|
|
1661
|
+
gap?: ResponsiveProp<SpacingSizes> | ResponsiveSpacingSizes;
|
|
1662
|
+
direction?: ResponsiveProp<React_2.CSSProperties["flexDirection"]>;
|
|
1663
|
+
wrap?: ResponsiveProp<boolean>;
|
|
1664
|
+
align?: ResponsiveProp<React_2.CSSProperties["alignItems"]>;
|
|
1665
|
+
justify?: ResponsiveProp<React_2.CSSProperties["justifyContent"]>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
1668
|
+
*/
|
|
1669
|
+
asChild?: boolean;
|
|
1670
|
+
}
|
|
1671
|
+
export { StackProps }
|
|
1672
|
+
export { StackProps as StackProps_alias_1 }
|
|
1673
|
+
export { StackProps as StackProps_alias_2 }
|
|
1674
|
+
export { StackProps as StackProps_alias_3 }
|
|
1675
|
+
export { StackProps as StackProps_alias_4 }
|
|
1676
|
+
|
|
1601
1677
|
/**
|
|
1602
1678
|
* Indicate a step in a process.
|
|
1603
1679
|
*
|
|
@@ -1722,12 +1798,6 @@ export { StyledHtmlProps as StyledHtmlProps_alias_3 }
|
|
|
1722
1798
|
|
|
1723
1799
|
export declare const Success: Story_20;
|
|
1724
1800
|
|
|
1725
|
-
declare const Tab: OverridableComponent<TabProps, HTMLButtonElement>;
|
|
1726
|
-
export { Tab }
|
|
1727
|
-
export { Tab as Tab_alias_1 }
|
|
1728
|
-
export { Tab as Tab_alias_2 }
|
|
1729
|
-
export { Tab as Tab_alias_3 }
|
|
1730
|
-
|
|
1731
1801
|
declare interface TabContentsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1732
1802
|
children: ReactElement<TabsContentProps> | ReactElement<TabsContentProps>[];
|
|
1733
1803
|
}
|
|
@@ -1737,7 +1807,7 @@ export { TabContentsProps as TabContentsProps_alias_2 }
|
|
|
1737
1807
|
export { TabContentsProps as TabContentsProps_alias_3 }
|
|
1738
1808
|
|
|
1739
1809
|
declare interface TabListProps extends HTMLAttributes<HTMLDivElement> {
|
|
1740
|
-
children: ReactElement<
|
|
1810
|
+
children: ReactElement<TabsTabProps> | ReactElement<TabsTabProps>[];
|
|
1741
1811
|
/**
|
|
1742
1812
|
* Direction of the tabs. Can either be vertical or horizontal.
|
|
1743
1813
|
* Horizontal breaks on window width with fallback back to vertical
|
|
@@ -1749,18 +1819,6 @@ export { TabListProps as TabListProps_alias_1 }
|
|
|
1749
1819
|
export { TabListProps as TabListProps_alias_2 }
|
|
1750
1820
|
export { TabListProps as TabListProps_alias_3 }
|
|
1751
1821
|
|
|
1752
|
-
declare interface TabProps extends HTMLAttributes<HTMLButtonElement> {
|
|
1753
|
-
children: ReactElement<HTMLElement> | string;
|
|
1754
|
-
/**
|
|
1755
|
-
* Identifier for the tab
|
|
1756
|
-
*/
|
|
1757
|
-
tabId: string;
|
|
1758
|
-
}
|
|
1759
|
-
export { TabProps }
|
|
1760
|
-
export { TabProps as TabProps_alias_1 }
|
|
1761
|
-
export { TabProps as TabProps_alias_2 }
|
|
1762
|
-
export { TabProps as TabProps_alias_3 }
|
|
1763
|
-
|
|
1764
1822
|
export declare const Tabs_alias_3: OverridableComponent<TabsProps, HTMLDivElement>;
|
|
1765
1823
|
|
|
1766
1824
|
declare const TabsComponent: {
|
|
@@ -1770,7 +1828,7 @@ declare const TabsComponent: {
|
|
|
1770
1828
|
} & TabsProps & Omit<ComponentPropsWithRef<As>, keyof TabsProps>): ReactNode;
|
|
1771
1829
|
} & Pick<FC, "displayName"> & {
|
|
1772
1830
|
List: typeof TabsList;
|
|
1773
|
-
Tab: typeof
|
|
1831
|
+
Tab: typeof TabsTab;
|
|
1774
1832
|
Contents: typeof TabsContents;
|
|
1775
1833
|
Content: typeof TabsContent;
|
|
1776
1834
|
};
|
|
@@ -1835,6 +1893,24 @@ export { TabsProps as TabsProps_alias_1 }
|
|
|
1835
1893
|
export { TabsProps as TabsProps_alias_2 }
|
|
1836
1894
|
export { TabsProps as TabsProps_alias_3 }
|
|
1837
1895
|
|
|
1896
|
+
declare const TabsTab: OverridableComponent<TabsTabProps, HTMLButtonElement>;
|
|
1897
|
+
export { TabsTab }
|
|
1898
|
+
export { TabsTab as TabsTab_alias_1 }
|
|
1899
|
+
export { TabsTab as TabsTab_alias_2 }
|
|
1900
|
+
export { TabsTab as TabsTab_alias_3 }
|
|
1901
|
+
|
|
1902
|
+
declare interface TabsTabProps extends HTMLAttributes<HTMLButtonElement> {
|
|
1903
|
+
children: ReactElement<HTMLElement> | string;
|
|
1904
|
+
/**
|
|
1905
|
+
* Identifier for the tab
|
|
1906
|
+
*/
|
|
1907
|
+
tabId: string;
|
|
1908
|
+
}
|
|
1909
|
+
export { TabsTabProps }
|
|
1910
|
+
export { TabsTabProps as TabsTabProps_alias_1 }
|
|
1911
|
+
export { TabsTabProps as TabsTabProps_alias_2 }
|
|
1912
|
+
export { TabsTabProps as TabsTabProps_alias_3 }
|
|
1913
|
+
|
|
1838
1914
|
/**
|
|
1839
1915
|
* Text component
|
|
1840
1916
|
*
|
|
@@ -2134,6 +2210,21 @@ export declare const Vertical: Story_7;
|
|
|
2134
2210
|
|
|
2135
2211
|
export declare const Vertical_alias_1: Story_27;
|
|
2136
2212
|
|
|
2213
|
+
/**
|
|
2214
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
2215
|
+
*
|
|
2216
|
+
* TODO
|
|
2217
|
+
* - [ ] Add more examples
|
|
2218
|
+
* - [ ] Document usage
|
|
2219
|
+
* - [ ] Document props
|
|
2220
|
+
*/
|
|
2221
|
+
declare const VStack: React_2.ForwardRefExoticComponent<Omit<StackProps, "direction"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
2222
|
+
export { VStack }
|
|
2223
|
+
export { VStack as VStack_alias_1 }
|
|
2224
|
+
export { VStack as VStack_alias_2 }
|
|
2225
|
+
export { VStack as VStack_alias_3 }
|
|
2226
|
+
export { VStack as VStack_alias_4 }
|
|
2227
|
+
|
|
2137
2228
|
export declare const Warning: Story_2;
|
|
2138
2229
|
|
|
2139
2230
|
export declare const Warning_alias_1: Story_20;
|
|
@@ -2181,16 +2272,6 @@ export { WhiteBadge as WhiteBadge_alias_3 }
|
|
|
2181
2272
|
|
|
2182
2273
|
export declare const WhiteBox: Story_3;
|
|
2183
2274
|
|
|
2184
|
-
export declare const WhiteDisabled: Story_14;
|
|
2185
|
-
|
|
2186
|
-
export declare const WhiteDisabledInput: Story_11;
|
|
2187
|
-
|
|
2188
|
-
export declare const WhiteDisabledInputWithError: Story_11;
|
|
2189
|
-
|
|
2190
|
-
export declare const WhiteDisabledTextarea: Story_15;
|
|
2191
|
-
|
|
2192
|
-
export declare const WhiteDisabledTextareaWithError: Story_15;
|
|
2193
|
-
|
|
2194
2275
|
export declare const WhiteInput: Story_11;
|
|
2195
2276
|
|
|
2196
2277
|
export declare const WhiteInputWithError: Story_11;
|
|
@@ -315,6 +315,8 @@ export { BreadcrumbsProps as BreadcrumbsProps_alias_1 }
|
|
|
315
315
|
export { BreadcrumbsProps as BreadcrumbsProps_alias_2 }
|
|
316
316
|
export { BreadcrumbsProps as BreadcrumbsProps_alias_3 }
|
|
317
317
|
|
|
318
|
+
declare type Breakpoints = "xsmall" | "small" | "medium" | "large" | "xlarge";
|
|
319
|
+
|
|
318
320
|
export declare const ButtonAsLink: Story_17;
|
|
319
321
|
|
|
320
322
|
declare type ButtonProps = ButtonPropsInternal & ({
|
|
@@ -583,8 +585,6 @@ export declare const Darkmode: Story_26;
|
|
|
583
585
|
|
|
584
586
|
export declare const DarkmodeSmall: Story_26;
|
|
585
587
|
|
|
586
|
-
export declare const DefaulDisabled: Story_14;
|
|
587
|
-
|
|
588
588
|
export declare const Default: Story_4;
|
|
589
589
|
|
|
590
590
|
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
@@ -736,18 +736,6 @@ declare interface DimensionsFromWidthAndHeight {
|
|
|
736
736
|
width?: number | string;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
-
export declare const Disabled: Story_5;
|
|
740
|
-
|
|
741
|
-
export declare const DisabledInput: Story_11;
|
|
742
|
-
|
|
743
|
-
export declare const DisabledInputWithError: Story_11;
|
|
744
|
-
|
|
745
|
-
export declare const DisabledOutline: Story_5;
|
|
746
|
-
|
|
747
|
-
export declare const DisabledTextarea: Story_15;
|
|
748
|
-
|
|
749
|
-
export declare const DisabledTextareaWithError: Story_15;
|
|
750
|
-
|
|
751
739
|
declare function ErrorMessage({ children, id, className }: ErrorMessageProps): JSX_2.Element;
|
|
752
740
|
export { ErrorMessage }
|
|
753
741
|
export { ErrorMessage as ErrorMessage_alias_1 }
|
|
@@ -851,9 +839,6 @@ declare interface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement>
|
|
|
851
839
|
* Responsive sections of links. Will become an accordion on mobile.
|
|
852
840
|
*
|
|
853
841
|
* Use with `Footer.LinkSection` for each section.
|
|
854
|
-
*
|
|
855
|
-
* TODO:
|
|
856
|
-
* - [ ] Decrease number of DOM elements rendered. We should not rely on conditional rendering as that will make server-side rendering harder.
|
|
857
842
|
*/
|
|
858
843
|
declare const FooterLinkSections: ForwardRefExoticComponent<FooterLinkSectionsProps & RefAttributes<HTMLDivElement>>;
|
|
859
844
|
export { FooterLinkSections }
|
|
@@ -897,6 +882,10 @@ export { FooterProps as FooterProps_alias_3 }
|
|
|
897
882
|
|
|
898
883
|
export declare const FormWithErrorsOnSubmit: Story_11;
|
|
899
884
|
|
|
885
|
+
export declare function getResponsiveProps<T>(variable: `--hds-${string}`, inputValues?: ResponsiveProp<T>, valueTransformer?: (value: T) => string): Record<string, string>;
|
|
886
|
+
|
|
887
|
+
export declare function getSpacingVariable(size: SpacingSizes | ResponsiveSpacingSizes): string;
|
|
888
|
+
|
|
900
889
|
declare interface HeadingProps {
|
|
901
890
|
variant: "h1-display" | "h1" | "h2" | "h3" | "h3-title";
|
|
902
891
|
as: React_3.ElementType;
|
|
@@ -910,9 +899,20 @@ export declare const HorizontalLongContent: Story_7;
|
|
|
910
899
|
|
|
911
900
|
export declare const HorizontalWithMiddleSelected: Story_27;
|
|
912
901
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
902
|
+
/**
|
|
903
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
904
|
+
*
|
|
905
|
+
* TODO
|
|
906
|
+
* - [ ] Add more examples
|
|
907
|
+
* - [ ] Document usage
|
|
908
|
+
* - [ ] Document props
|
|
909
|
+
*/
|
|
910
|
+
declare const HStack: React_2.ForwardRefExoticComponent<Omit<StackProps, "direction"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
911
|
+
export { HStack }
|
|
912
|
+
export { HStack as HStack_alias_1 }
|
|
913
|
+
export { HStack as HStack_alias_2 }
|
|
914
|
+
export { HStack as HStack_alias_3 }
|
|
915
|
+
export { HStack as HStack_alias_4 }
|
|
916
916
|
|
|
917
917
|
export declare const IconPrimary: Story_5;
|
|
918
918
|
|
|
@@ -1094,10 +1094,13 @@ export declare const MinAndMax: Story_28;
|
|
|
1094
1094
|
something about the consequences.
|
|
1095
1095
|
</p>
|
|
1096
1096
|
</Modal.Content>
|
|
1097
|
-
<Modal.Footer
|
|
1097
|
+
<Modal.Footer>
|
|
1098
|
+
<HStack gap="16" wrap>
|
|
1099
|
+
<PrimaryButton onClick={onMainAction}>Main action</PrimaryButton>
|
|
1098
1100
|
<PrimaryButton fill="outline" onClick={onClose}>
|
|
1099
|
-
|
|
1101
|
+
Cancel
|
|
1100
1102
|
</PrimaryButton>
|
|
1103
|
+
</HStack>
|
|
1101
1104
|
</Modal.Footer>
|
|
1102
1105
|
</Modal>
|
|
1103
1106
|
</>
|
|
@@ -1452,6 +1455,29 @@ export declare const ReadonlyTextarea: Story_15;
|
|
|
1452
1455
|
|
|
1453
1456
|
export declare const ReadonlyTextareaWithError: Story_15;
|
|
1454
1457
|
|
|
1458
|
+
export declare type ResponsiveProp<T> = T | ResponsiveValues<T>;
|
|
1459
|
+
|
|
1460
|
+
export declare type ResponsiveSpacingSizes = keyof typeof responsiveSpacingSizes;
|
|
1461
|
+
|
|
1462
|
+
declare const responsiveSpacingSizes: {
|
|
1463
|
+
readonly "4-8": "4-8";
|
|
1464
|
+
readonly "8-12": "8-12";
|
|
1465
|
+
readonly "12-16": "12-16";
|
|
1466
|
+
readonly "16-20": "16-20";
|
|
1467
|
+
readonly "20-24": "20-24";
|
|
1468
|
+
readonly "24-32": "24-32";
|
|
1469
|
+
readonly "32-40": "32-40";
|
|
1470
|
+
readonly "40-48": "40-48";
|
|
1471
|
+
readonly "48-64": "48-64";
|
|
1472
|
+
readonly "64-80": "64-80";
|
|
1473
|
+
readonly "80-120": "80-120";
|
|
1474
|
+
readonly "120-160": "120-160";
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
declare type ResponsiveValues<T> = {
|
|
1478
|
+
[Breakpoint in Breakpoints]?: T;
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1455
1481
|
export declare const Secondary: Story_5;
|
|
1456
1482
|
|
|
1457
1483
|
declare const SecondaryButton: OverridableComponent<ButtonProps, HTMLButtonElement>;
|
|
@@ -1598,6 +1624,56 @@ export declare const Small: Story_26;
|
|
|
1598
1624
|
|
|
1599
1625
|
export declare const Solid: Story_17;
|
|
1600
1626
|
|
|
1627
|
+
export declare type SpacingSizes = keyof typeof spacingSizes;
|
|
1628
|
+
|
|
1629
|
+
declare const spacingSizes: {
|
|
1630
|
+
readonly "4": "4";
|
|
1631
|
+
readonly "8": "8";
|
|
1632
|
+
readonly "12": "12";
|
|
1633
|
+
readonly "16": "16";
|
|
1634
|
+
readonly "20": "20";
|
|
1635
|
+
readonly "24": "24";
|
|
1636
|
+
readonly "32": "32";
|
|
1637
|
+
readonly "40": "40";
|
|
1638
|
+
readonly "48": "48";
|
|
1639
|
+
readonly "64": "64";
|
|
1640
|
+
readonly "80": "80";
|
|
1641
|
+
readonly "120": "120";
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
1646
|
+
*
|
|
1647
|
+
* TODO
|
|
1648
|
+
* - [ ] Add more examples
|
|
1649
|
+
* - [ ] Document usage
|
|
1650
|
+
* - [ ] Document props
|
|
1651
|
+
*/
|
|
1652
|
+
declare const Stack: React_2.ForwardRefExoticComponent<StackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
1653
|
+
export { Stack }
|
|
1654
|
+
export { Stack as Stack_alias_1 }
|
|
1655
|
+
export { Stack as Stack_alias_2 }
|
|
1656
|
+
export { Stack as Stack_alias_3 }
|
|
1657
|
+
export { Stack as Stack_alias_4 }
|
|
1658
|
+
|
|
1659
|
+
declare interface StackProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1660
|
+
children: React_2.ReactNode;
|
|
1661
|
+
gap?: ResponsiveProp<SpacingSizes> | ResponsiveSpacingSizes;
|
|
1662
|
+
direction?: ResponsiveProp<React_2.CSSProperties["flexDirection"]>;
|
|
1663
|
+
wrap?: ResponsiveProp<boolean>;
|
|
1664
|
+
align?: ResponsiveProp<React_2.CSSProperties["alignItems"]>;
|
|
1665
|
+
justify?: ResponsiveProp<React_2.CSSProperties["justifyContent"]>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
1668
|
+
*/
|
|
1669
|
+
asChild?: boolean;
|
|
1670
|
+
}
|
|
1671
|
+
export { StackProps }
|
|
1672
|
+
export { StackProps as StackProps_alias_1 }
|
|
1673
|
+
export { StackProps as StackProps_alias_2 }
|
|
1674
|
+
export { StackProps as StackProps_alias_3 }
|
|
1675
|
+
export { StackProps as StackProps_alias_4 }
|
|
1676
|
+
|
|
1601
1677
|
/**
|
|
1602
1678
|
* Indicate a step in a process.
|
|
1603
1679
|
*
|
|
@@ -1722,12 +1798,6 @@ export { StyledHtmlProps as StyledHtmlProps_alias_3 }
|
|
|
1722
1798
|
|
|
1723
1799
|
export declare const Success: Story_20;
|
|
1724
1800
|
|
|
1725
|
-
declare const Tab: OverridableComponent<TabProps, HTMLButtonElement>;
|
|
1726
|
-
export { Tab }
|
|
1727
|
-
export { Tab as Tab_alias_1 }
|
|
1728
|
-
export { Tab as Tab_alias_2 }
|
|
1729
|
-
export { Tab as Tab_alias_3 }
|
|
1730
|
-
|
|
1731
1801
|
declare interface TabContentsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1732
1802
|
children: ReactElement<TabsContentProps> | ReactElement<TabsContentProps>[];
|
|
1733
1803
|
}
|
|
@@ -1737,7 +1807,7 @@ export { TabContentsProps as TabContentsProps_alias_2 }
|
|
|
1737
1807
|
export { TabContentsProps as TabContentsProps_alias_3 }
|
|
1738
1808
|
|
|
1739
1809
|
declare interface TabListProps extends HTMLAttributes<HTMLDivElement> {
|
|
1740
|
-
children: ReactElement<
|
|
1810
|
+
children: ReactElement<TabsTabProps> | ReactElement<TabsTabProps>[];
|
|
1741
1811
|
/**
|
|
1742
1812
|
* Direction of the tabs. Can either be vertical or horizontal.
|
|
1743
1813
|
* Horizontal breaks on window width with fallback back to vertical
|
|
@@ -1749,18 +1819,6 @@ export { TabListProps as TabListProps_alias_1 }
|
|
|
1749
1819
|
export { TabListProps as TabListProps_alias_2 }
|
|
1750
1820
|
export { TabListProps as TabListProps_alias_3 }
|
|
1751
1821
|
|
|
1752
|
-
declare interface TabProps extends HTMLAttributes<HTMLButtonElement> {
|
|
1753
|
-
children: ReactElement<HTMLElement> | string;
|
|
1754
|
-
/**
|
|
1755
|
-
* Identifier for the tab
|
|
1756
|
-
*/
|
|
1757
|
-
tabId: string;
|
|
1758
|
-
}
|
|
1759
|
-
export { TabProps }
|
|
1760
|
-
export { TabProps as TabProps_alias_1 }
|
|
1761
|
-
export { TabProps as TabProps_alias_2 }
|
|
1762
|
-
export { TabProps as TabProps_alias_3 }
|
|
1763
|
-
|
|
1764
1822
|
export declare const Tabs_alias_3: OverridableComponent<TabsProps, HTMLDivElement>;
|
|
1765
1823
|
|
|
1766
1824
|
declare const TabsComponent: {
|
|
@@ -1770,7 +1828,7 @@ declare const TabsComponent: {
|
|
|
1770
1828
|
} & TabsProps & Omit<ComponentPropsWithRef<As>, keyof TabsProps>): ReactNode;
|
|
1771
1829
|
} & Pick<FC, "displayName"> & {
|
|
1772
1830
|
List: typeof TabsList;
|
|
1773
|
-
Tab: typeof
|
|
1831
|
+
Tab: typeof TabsTab;
|
|
1774
1832
|
Contents: typeof TabsContents;
|
|
1775
1833
|
Content: typeof TabsContent;
|
|
1776
1834
|
};
|
|
@@ -1835,6 +1893,24 @@ export { TabsProps as TabsProps_alias_1 }
|
|
|
1835
1893
|
export { TabsProps as TabsProps_alias_2 }
|
|
1836
1894
|
export { TabsProps as TabsProps_alias_3 }
|
|
1837
1895
|
|
|
1896
|
+
declare const TabsTab: OverridableComponent<TabsTabProps, HTMLButtonElement>;
|
|
1897
|
+
export { TabsTab }
|
|
1898
|
+
export { TabsTab as TabsTab_alias_1 }
|
|
1899
|
+
export { TabsTab as TabsTab_alias_2 }
|
|
1900
|
+
export { TabsTab as TabsTab_alias_3 }
|
|
1901
|
+
|
|
1902
|
+
declare interface TabsTabProps extends HTMLAttributes<HTMLButtonElement> {
|
|
1903
|
+
children: ReactElement<HTMLElement> | string;
|
|
1904
|
+
/**
|
|
1905
|
+
* Identifier for the tab
|
|
1906
|
+
*/
|
|
1907
|
+
tabId: string;
|
|
1908
|
+
}
|
|
1909
|
+
export { TabsTabProps }
|
|
1910
|
+
export { TabsTabProps as TabsTabProps_alias_1 }
|
|
1911
|
+
export { TabsTabProps as TabsTabProps_alias_2 }
|
|
1912
|
+
export { TabsTabProps as TabsTabProps_alias_3 }
|
|
1913
|
+
|
|
1838
1914
|
/**
|
|
1839
1915
|
* Text component
|
|
1840
1916
|
*
|
|
@@ -2134,6 +2210,21 @@ export declare const Vertical: Story_7;
|
|
|
2134
2210
|
|
|
2135
2211
|
export declare const Vertical_alias_1: Story_27;
|
|
2136
2212
|
|
|
2213
|
+
/**
|
|
2214
|
+
* 🚨 WORK IN PROGRESS 🚨
|
|
2215
|
+
*
|
|
2216
|
+
* TODO
|
|
2217
|
+
* - [ ] Add more examples
|
|
2218
|
+
* - [ ] Document usage
|
|
2219
|
+
* - [ ] Document props
|
|
2220
|
+
*/
|
|
2221
|
+
declare const VStack: React_2.ForwardRefExoticComponent<Omit<StackProps, "direction"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
2222
|
+
export { VStack }
|
|
2223
|
+
export { VStack as VStack_alias_1 }
|
|
2224
|
+
export { VStack as VStack_alias_2 }
|
|
2225
|
+
export { VStack as VStack_alias_3 }
|
|
2226
|
+
export { VStack as VStack_alias_4 }
|
|
2227
|
+
|
|
2137
2228
|
export declare const Warning: Story_2;
|
|
2138
2229
|
|
|
2139
2230
|
export declare const Warning_alias_1: Story_20;
|
|
@@ -2181,16 +2272,6 @@ export { WhiteBadge as WhiteBadge_alias_3 }
|
|
|
2181
2272
|
|
|
2182
2273
|
export declare const WhiteBox: Story_3;
|
|
2183
2274
|
|
|
2184
|
-
export declare const WhiteDisabled: Story_14;
|
|
2185
|
-
|
|
2186
|
-
export declare const WhiteDisabledInput: Story_11;
|
|
2187
|
-
|
|
2188
|
-
export declare const WhiteDisabledInputWithError: Story_11;
|
|
2189
|
-
|
|
2190
|
-
export declare const WhiteDisabledTextarea: Story_15;
|
|
2191
|
-
|
|
2192
|
-
export declare const WhiteDisabledTextareaWithError: Story_15;
|
|
2193
|
-
|
|
2194
2275
|
export declare const WhiteInput: Story_11;
|
|
2195
2276
|
|
|
2196
2277
|
export declare const WhiteInputWithError: Story_11;
|
package/dist/accordion/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AccordionComponent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-62F4I3MQ.mjs";
|
|
5
|
-
import "../chunk-VRIY65P5.mjs";
|
|
3
|
+
} from "../chunk-XIHKASNB.mjs";
|
|
6
4
|
import "../chunk-GUB3UCXO.mjs";
|
|
7
5
|
import "../chunk-YXHXRUFX.mjs";
|
|
6
|
+
import "../chunk-62F4I3MQ.mjs";
|
|
7
|
+
import "../chunk-VRIY65P5.mjs";
|
|
8
8
|
import "../chunk-V3PAFMK5.mjs";
|
|
9
9
|
import "../chunk-R4SQKVDQ.mjs";
|
|
10
10
|
export {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getResponsiveProps
|
|
3
|
+
} from "./chunk-ZTYEOZLK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getSpacingVariable
|
|
6
|
+
} from "./chunk-NE6W2PCD.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-R4SQKVDQ.mjs";
|
|
12
|
+
|
|
13
|
+
// src/layout/stack/stack.tsx
|
|
14
|
+
import "react";
|
|
15
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
16
|
+
import { forwardRef } from "react";
|
|
17
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
18
|
+
import { jsx } from "react/jsx-runtime";
|
|
19
|
+
var Stack = forwardRef(
|
|
20
|
+
(_a, ref) => {
|
|
21
|
+
var _b = _a, { children, asChild, className, style: _style, gap, direction, wrap, align, justify } = _b, rest = __objRest(_b, ["children", "asChild", "className", "style", "gap", "direction", "wrap", "align", "justify"]);
|
|
22
|
+
const Component = asChild ? Slot : "div";
|
|
23
|
+
const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, _style), getResponsiveProps("--hds-stack-gap", gap, getSpacingVariable)), getResponsiveProps("--hds-stack-direction", direction)), getResponsiveProps("--hds-stack-wrap", wrap, (value) => value ? "wrap" : "nowrap")), getResponsiveProps("--hds-stack-align", align)), getResponsiveProps("--hds-stack-justify", justify));
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Component,
|
|
26
|
+
__spreadProps(__spreadValues({
|
|
27
|
+
style,
|
|
28
|
+
className: clsx("hds-stack", className),
|
|
29
|
+
ref
|
|
30
|
+
}, rest), {
|
|
31
|
+
children
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
Stack.displayName = "Stack";
|
|
37
|
+
var HStack = forwardRef((props, ref) => {
|
|
38
|
+
return /* @__PURE__ */ jsx(Stack, __spreadProps(__spreadValues({ ref }, props), { direction: "row" }));
|
|
39
|
+
});
|
|
40
|
+
HStack.displayName = "HStack";
|
|
41
|
+
var VStack = forwardRef((props, ref) => {
|
|
42
|
+
return /* @__PURE__ */ jsx(Stack, __spreadProps(__spreadValues({ ref }, props), { direction: "column" }));
|
|
43
|
+
});
|
|
44
|
+
VStack.displayName = "VStack";
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Stack,
|
|
48
|
+
HStack,
|
|
49
|
+
VStack
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-27XJO7E4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/layout/stack/stack.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { getSpacingVariable, type ResponsiveSpacingSizes, type SpacingSizes } from \"../spacing\";\nimport { getResponsiveProps, type ResponsiveProp } from \"../responsive\";\n\ntype CSSPropertiesWithVar = React.CSSProperties & {\n \"--hds-stack-gap\"?: string;\n \"--hds-stack-direction\"?: string;\n \"--hds-stack-wrap\"?: string;\n \"--hds-stack-align\"?: string;\n \"--hds-stack-justify\"?: string;\n};\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n\n gap?: ResponsiveProp<SpacingSizes> | ResponsiveSpacingSizes;\n direction?: ResponsiveProp<React.CSSProperties[\"flexDirection\"]>;\n wrap?: ResponsiveProp<boolean>;\n align?: ResponsiveProp<React.CSSProperties[\"alignItems\"]>;\n justify?: ResponsiveProp<React.CSSProperties[\"justifyContent\"]>;\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 *\n * TODO\n * - [ ] Add more examples\n * - [ ] Document usage\n * - [ ] Document props\n */\nexport const Stack = forwardRef<HTMLDivElement, StackProps>(\n (\n { children, asChild, className, style: _style, gap, direction, wrap, align, justify, ...rest },\n ref,\n ) => {\n const Component = asChild ? Slot : \"div\";\n const style: CSSPropertiesWithVar = {\n ..._style,\n ...getResponsiveProps(\"--hds-stack-gap\", gap, getSpacingVariable),\n ...getResponsiveProps(\"--hds-stack-direction\", direction),\n ...getResponsiveProps(\"--hds-stack-wrap\", wrap, (value) => (value ? \"wrap\" : \"nowrap\")),\n ...getResponsiveProps(\"--hds-stack-align\", align),\n ...getResponsiveProps(\"--hds-stack-justify\", justify),\n };\n return (\n <Component\n style={style}\n className={clsx(\"hds-stack\", className as undefined)}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nStack.displayName = \"Stack\";\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n *\n * TODO\n * - [ ] Add more examples\n * - [ ] Document usage\n * - [ ] Document props\n */\nexport const HStack = forwardRef<HTMLDivElement, Omit<StackProps, \"direction\">>((props, ref) => {\n return <Stack ref={ref} {...props} direction=\"row\" />;\n});\nHStack.displayName = \"HStack\";\n\n/**\n * 🚨 WORK IN PROGRESS 🚨\n *\n * TODO\n * - [ ] Add more examples\n * - [ ] Document usage\n * - [ ] Document props\n */\nexport const VStack = forwardRef<HTMLDivElement, Omit<StackProps, \"direction\">>((props, ref) => {\n return <Stack ref={ref} {...props} direction=\"column\" />;\n});\nVStack.displayName = \"VStack\";\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAuB;AACvB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAkDf;AAfC,IAAM,QAAQ;AAAA,EACnB,CACE,IACA,QACG;AAFH,iBAAE,YAAU,SAAS,WAAW,OAAO,QAAQ,KAAK,WAAW,MAAM,OAAO,QAxChF,IAwCI,IAAwF,iBAAxF,IAAwF,CAAtF,YAAU,WAAS,aAAW,SAAe,OAAK,aAAW,QAAM,SAAO;AAG5E,UAAM,YAAY,UAAU,OAAO;AACnC,UAAM,QAA8B,8FAC/B,SACA,mBAAmB,mBAAmB,KAAK,kBAAkB,IAC7D,mBAAmB,yBAAyB,SAAS,IACrD,mBAAmB,oBAAoB,MAAM,CAAC,UAAW,QAAQ,SAAS,QAAS,IACnF,mBAAmB,qBAAqB,KAAK,IAC7C,mBAAmB,uBAAuB,OAAO;AAEtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,KAAK,aAAa,SAAsB;AAAA,QACnD;AAAA,SACI,OAJL;AAAA,QAME;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAUb,IAAM,SAAS,WAA0D,CAAC,OAAO,QAAQ;AAC9F,SAAO,oBAAC,sCAAM,OAAc,QAApB,EAA2B,WAAU,QAAM;AACrD,CAAC;AACD,OAAO,cAAc;AAUd,IAAM,SAAS,WAA0D,CAAC,OAAO,QAAQ;AAC9F,SAAO,oBAAC,sCAAM,OAAc,QAApB,EAA2B,WAAU,WAAS;AACxD,CAAC;AACD,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/modal/modal.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Box } from \"../box/box\";\nimport type { OverridableComponent } from \"../utils\";\nimport { useMergeRefs } from \"../utils\";\n\nexport interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {\n children: React.ReactNode;\n\n /**\n * Controls the open state of the modal\n */\n open?: boolean;\n\n /**\n * Whether to close when clicking on the backdrop.\n */\n closeOnBackdropClick?: boolean;\n}\n\n/**\n * A modal dialog is a window that forces the user to interact with it before they can return to other parts of the application.\n *\n * Uses the native [`dialog`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) element.\n *\n * Example\n * ```\n const modalRef = useRef<HTMLDialogElement>(null);\n const onClose = () => modalRef.current?.close();\n\n return (\n <>\n <PrimaryButton onClick={() => modalRef.current?.showModal()}>Open Modal</PrimaryButton>\n <Modal ref={modalRef}>\n <Modal.Header>Dialog header</Modal.Header>\n <Modal.Content>\n <p>\n Dialog header Dialog description - a description of what is about to happen and maybe\n something about the consequences.\n </p>\n </Modal.Content>\n <Modal.Footer>\n <HStack gap=\"16\" wrap>\n <PrimaryButton onClick={onMainAction}>Main action</PrimaryButton>\n <PrimaryButton fill=\"outline\" onClick={onClose}>\n Cancel\n </PrimaryButton>\n </HStack>\n </Modal.Footer>\n </Modal>\n </>\n );\n * ```\n */\nexport const Modal = forwardRef<HTMLDialogElement, ModalProps>(\n ({ children, className, open, closeOnBackdropClick, onClick, ...rest }, ref) => {\n const modalRef = useRef<HTMLDialogElement>(null);\n const mergedRef = useMergeRefs([modalRef, ref]);\n\n // The X close button that comes from the `Box` component\n function onCloseButtonClick() {\n modalRef.current?.close();\n return false;\n }\n\n // No scroll when modal is open\n useScrollLock(modalRef, \"hds-modal-scroll-lock\");\n\n // `open` prop\n useEffect(() => {\n if (modalRef.current && open !== undefined) {\n if (open && !modalRef.current.open) {\n modalRef.current.showModal();\n } else if (!open && modalRef.current.open) {\n modalRef.current.close();\n }\n }\n }, [modalRef, open]);\n\n function onDialogClick(e: React.MouseEvent<HTMLElement>) {\n if (closeOnBackdropClick && e.target === modalRef.current) {\n modalRef.current.close();\n }\n onClick?.(e as React.MouseEvent<HTMLDialogElement>);\n }\n\n return (\n <Box\n as=\"dialog\"\n className={clsx(\"hds-modal\", className as undefined)}\n closeable\n onClick={onDialogClick}\n onClose={onCloseButtonClick}\n ref={mergedRef}\n variant=\"white\"\n {\n ...(rest as object) /* TODO remove type casting */\n }\n >\n {children}\n </Box>\n );\n },\n);\nModal.displayName = \"Modal\";\n\nexport const ModalHeader: OverridableComponent<object, HTMLHeadingElement> = forwardRef(\n ({ as: Component = \"h1\", className, ...rest }, ref) => {\n return (\n <Component\n className={clsx(\"hds-modal__header\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nModalHeader.displayName = \"Modal.Header\";\n\nexport const ModalContent: OverridableComponent<object, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", className, ...rest }, ref) => {\n return (\n <Component\n className={clsx(\"hds-modal__content\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: OverridableComponent<object, HTMLDivElement> = forwardRef(\n ({ as: Component = \"footer\", className, ...rest }, ref) => {\n return (\n <Component\n className={clsx(\"hds-modal__footer\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nModalFooter.displayName = \"Modal.Footer\";\n\nexport function useScrollLock(modalRef: React.RefObject<HTMLDialogElement>, bodyClass: string) {\n useEffect(() => {\n if (!modalRef.current) return;\n if (modalRef.current.open) document.body.classList.add(bodyClass);\n\n const observer = new MutationObserver(() => {\n if (modalRef.current?.open) document.body.classList.add(bodyClass);\n else document.body.classList.remove(bodyClass);\n });\n observer.observe(modalRef.current, {\n attributes: true,\n attributeFilter: [\"open\"],\n });\n return () => {\n observer.disconnect();\n document.body.classList.remove(bodyClass);\n };\n }, [bodyClass, modalRef]);\n}\n"],"mappings":"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","names":["_a"]}
|