@postenbring/hedwig-react 0.0.55 → 0.0.57
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 +162 -190
- package/dist/_tsup-dts-rollup.d.ts +162 -190
- package/dist/button/button.js +1 -1
- package/dist/button/button.js.map +1 -1
- package/dist/button/button.mjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/{chunk-2XSEQBJ5.mjs → chunk-5IIBIO3Y.mjs} +1 -1
- package/dist/chunk-5IIBIO3Y.mjs.map +1 -0
- package/dist/{chunk-MJ4LA23N.mjs → chunk-BDA6STW2.mjs} +2 -2
- package/dist/{chunk-5T3VUFL4.mjs → chunk-GVSLN5KE.mjs} +1 -1
- package/dist/chunk-GVSLN5KE.mjs.map +1 -0
- package/dist/{chunk-UVUIY2WB.mjs → chunk-J6ES2LO5.mjs} +2 -2
- package/dist/{chunk-UVUIY2WB.mjs.map → chunk-J6ES2LO5.mjs.map} +1 -1
- package/dist/{chunk-5GRZROYQ.mjs → chunk-LYRXA4WS.mjs} +8 -8
- package/dist/chunk-LYRXA4WS.mjs.map +1 -0
- package/dist/{chunk-KOO4VQ2N.mjs → chunk-OJ42PRYY.mjs} +2 -2
- package/dist/chunk-OJ42PRYY.mjs.map +1 -0
- package/dist/{chunk-T3EC54VN.mjs → chunk-PUFFEK6I.mjs} +2 -2
- package/dist/chunk-V4NGQVBQ.mjs +61 -0
- package/dist/chunk-V4NGQVBQ.mjs.map +1 -0
- package/dist/{chunk-LK62DXGG.mjs → chunk-ZSLWZUBI.mjs} +10 -3
- package/dist/chunk-ZSLWZUBI.mjs.map +1 -0
- package/dist/index-no-css.d.mts +1 -28
- package/dist/index-no-css.d.ts +1 -28
- package/dist/index-no-css.js +51 -117
- package/dist/index-no-css.js.map +1 -1
- package/dist/index-no-css.mjs +12 -66
- package/dist/index.d.mts +1 -28
- package/dist/index.d.ts +1 -28
- package/dist/index.js +51 -117
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -66
- package/dist/index.mjs.map +1 -1
- 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 +9 -2
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +2 -2
- package/dist/navbar/navbar-expandable-menu.js +9 -2
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +1 -1
- package/dist/show-more/index.js.map +1 -1
- package/dist/show-more/index.mjs +1 -1
- package/dist/show-more/show-more.js.map +1 -1
- package/dist/show-more/show-more.mjs +1 -1
- package/dist/styled-html/index.js +1 -1
- package/dist/styled-html/index.js.map +1 -1
- package/dist/styled-html/index.mjs +1 -1
- package/dist/styled-html/styled-html.js +1 -1
- package/dist/styled-html/styled-html.js.map +1 -1
- package/dist/styled-html/styled-html.mjs +1 -1
- package/dist/text/index.d.mts +15 -0
- package/dist/text/index.d.ts +15 -0
- package/dist/text/index.js +179 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/index.mjs +36 -0
- package/dist/text/text.d.mts +2 -0
- package/dist/text/text.d.ts +2 -0
- package/dist/{typography/typography.js → text/text.js} +12 -12
- package/dist/text/text.js.map +1 -0
- package/dist/text/text.mjs +8 -0
- package/package.json +7 -7
- package/dist/chunk-2XSEQBJ5.mjs.map +0 -1
- package/dist/chunk-5GRZROYQ.mjs.map +0 -1
- package/dist/chunk-5T3VUFL4.mjs.map +0 -1
- package/dist/chunk-KOO4VQ2N.mjs.map +0 -1
- package/dist/chunk-LK62DXGG.mjs.map +0 -1
- package/dist/chunk-NCYRNCGJ.mjs +0 -107
- package/dist/chunk-NCYRNCGJ.mjs.map +0 -1
- package/dist/typography/index.d.mts +0 -42
- package/dist/typography/index.d.ts +0 -42
- package/dist/typography/index.js +0 -252
- package/dist/typography/index.js.map +0 -1
- package/dist/typography/index.mjs +0 -90
- package/dist/typography/typography.d.mts +0 -2
- package/dist/typography/typography.d.ts +0 -2
- package/dist/typography/typography.js.map +0 -1
- package/dist/typography/typography.mjs +0 -8
- /package/dist/{chunk-MJ4LA23N.mjs.map → chunk-BDA6STW2.mjs.map} +0 -0
- /package/dist/{chunk-T3EC54VN.mjs.map → chunk-PUFFEK6I.mjs.map} +0 -0
- /package/dist/{typography → text}/index.mjs.map +0 -0
- /package/dist/{typography/typography.mjs.map → text/text.mjs.map} +0 -0
|
@@ -204,26 +204,6 @@ export { BaseButton as BaseButton_alias_1 }
|
|
|
204
204
|
export { BaseButton as BaseButton_alias_2 }
|
|
205
205
|
export { BaseButton as BaseButton_alias_3 }
|
|
206
206
|
|
|
207
|
-
declare const Body_2: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
208
|
-
export { Body_2 as Body }
|
|
209
|
-
export { Body_2 as Body_alias_1 }
|
|
210
|
-
export { Body_2 as Body_alias_2 }
|
|
211
|
-
|
|
212
|
-
declare const BodySmall: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
213
|
-
export { BodySmall }
|
|
214
|
-
export { BodySmall as BodySmall_alias_1 }
|
|
215
|
-
export { BodySmall as BodySmall_alias_2 }
|
|
216
|
-
|
|
217
|
-
declare const BodySmallTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
218
|
-
export { BodySmallTitle }
|
|
219
|
-
export { BodySmallTitle as BodySmallTitle_alias_1 }
|
|
220
|
-
export { BodySmallTitle as BodySmallTitle_alias_2 }
|
|
221
|
-
|
|
222
|
-
declare const BodyTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
223
|
-
export { BodyTitle }
|
|
224
|
-
export { BodyTitle as BodyTitle_alias_1 }
|
|
225
|
-
export { BodyTitle as BodyTitle_alias_2 }
|
|
226
|
-
|
|
227
207
|
export declare const BoundedCheckbox: Story_7;
|
|
228
208
|
|
|
229
209
|
export declare const BoundedRadiobutton: Story_11;
|
|
@@ -367,16 +347,6 @@ declare interface ButtonPropsInternal extends React.ButtonHTMLAttributes<HTMLBut
|
|
|
367
347
|
children?: React.ReactNode;
|
|
368
348
|
}
|
|
369
349
|
|
|
370
|
-
declare const Caption: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
371
|
-
export { Caption }
|
|
372
|
-
export { Caption as Caption_alias_1 }
|
|
373
|
-
export { Caption as Caption_alias_2 }
|
|
374
|
-
|
|
375
|
-
declare const CaptionTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
376
|
-
export { CaptionTitle }
|
|
377
|
-
export { CaptionTitle as CaptionTitle_alias_1 }
|
|
378
|
-
export { CaptionTitle as CaptionTitle_alias_2 }
|
|
379
|
-
|
|
380
350
|
export declare const Card_alias_2: Story_6;
|
|
381
351
|
|
|
382
352
|
export declare const Card_alias_3: OverridableComponent<CardBaseProps & {
|
|
@@ -640,7 +610,7 @@ export declare const default_alias_25: Meta<typeof StyledHtml>;
|
|
|
640
610
|
|
|
641
611
|
export declare const default_alias_26: Meta<typeof TabsComponent>;
|
|
642
612
|
|
|
643
|
-
export declare const default_alias_27: Meta<typeof
|
|
613
|
+
export declare const default_alias_27: Meta<typeof Text_2>;
|
|
644
614
|
|
|
645
615
|
export declare const default_alias_28: Meta<typeof WarningBanner>;
|
|
646
616
|
|
|
@@ -805,35 +775,10 @@ export { FieldsetProps as FieldsetProps_alias_4 }
|
|
|
805
775
|
|
|
806
776
|
export declare const FormWithErrorsOnSubmit: Story_10;
|
|
807
777
|
|
|
808
|
-
declare
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* Alternative: Named as the different typography levels
|
|
815
|
-
*
|
|
816
|
-
* ## Alias to @see Typography
|
|
817
|
-
*/
|
|
818
|
-
declare const H1Display: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
819
|
-
export { H1Display }
|
|
820
|
-
export { H1Display as H1Display_alias_1 }
|
|
821
|
-
export { H1Display as H1Display_alias_2 }
|
|
822
|
-
|
|
823
|
-
declare const H2: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
824
|
-
export { H2 }
|
|
825
|
-
export { H2 as H2_alias_1 }
|
|
826
|
-
export { H2 as H2_alias_2 }
|
|
827
|
-
|
|
828
|
-
declare const H3: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
829
|
-
export { H3 }
|
|
830
|
-
export { H3 as H3_alias_1 }
|
|
831
|
-
export { H3 as H3_alias_2 }
|
|
832
|
-
|
|
833
|
-
declare const H3Title: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
834
|
-
export { H3Title }
|
|
835
|
-
export { H3Title as H3Title_alias_1 }
|
|
836
|
-
export { H3Title as H3Title_alias_2 }
|
|
778
|
+
declare interface HeadingProps {
|
|
779
|
+
variant: "h1-display" | "h1" | "h2" | "h3" | "h3-title";
|
|
780
|
+
as: React_3.ElementType;
|
|
781
|
+
}
|
|
837
782
|
|
|
838
783
|
export declare const Horizontal: Story_16;
|
|
839
784
|
|
|
@@ -1003,14 +948,35 @@ export declare const MessageTitle: OverridableComponent<object, HTMLParagraphEle
|
|
|
1003
948
|
export declare const MinAndMax: Story_27;
|
|
1004
949
|
|
|
1005
950
|
/**
|
|
1006
|
-
*
|
|
951
|
+
* A modal dialog is a window that forces the user to interact with it before they can return to other parts of the application.
|
|
1007
952
|
*
|
|
1008
|
-
*
|
|
953
|
+
* Uses the native [`dialog`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) element.
|
|
1009
954
|
*
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1012
|
-
|
|
1013
|
-
|
|
955
|
+
* Example
|
|
956
|
+
* ```
|
|
957
|
+
const modalRef = useRef<HTMLDialogElement>(null);
|
|
958
|
+
const onClose = () => modalRef.current?.close();
|
|
959
|
+
|
|
960
|
+
return (
|
|
961
|
+
<>
|
|
962
|
+
<PrimaryButton onClick={() => modalRef.current?.showModal()}>Open Modal</PrimaryButton>
|
|
963
|
+
<Modal ref={modalRef}>
|
|
964
|
+
<Modal.Header>Dialog header</Modal.Header>
|
|
965
|
+
<Modal.Content>
|
|
966
|
+
<p>
|
|
967
|
+
Dialog header Dialog description - a description of what is about to happen and maybe
|
|
968
|
+
something about the consequences.
|
|
969
|
+
</p>
|
|
970
|
+
</Modal.Content>
|
|
971
|
+
<Modal.Footer style={{ display: "flex", gap: 16 }}>
|
|
972
|
+
<PrimaryButton fill="outline" onClick={onClose}>
|
|
973
|
+
Close
|
|
974
|
+
</PrimaryButton>
|
|
975
|
+
</Modal.Footer>
|
|
976
|
+
</Modal>
|
|
977
|
+
</>
|
|
978
|
+
);
|
|
979
|
+
* ```
|
|
1014
980
|
*/
|
|
1015
981
|
export declare const Modal_alias_3: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDialogElement>>;
|
|
1016
982
|
|
|
@@ -1201,6 +1167,10 @@ export declare type OverridableComponent<ComponentProps, Element extends HTMLEle
|
|
|
1201
1167
|
|
|
1202
1168
|
export declare const Paragraph: Story_16;
|
|
1203
1169
|
|
|
1170
|
+
declare interface ParagraphProps {
|
|
1171
|
+
variant?: "body" | "body-title" | "body-small" | "body-small-title" | "technical" | "technical-title" | "caption" | "caption-title";
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1204
1174
|
export declare const PlainCheckbox: Story_7;
|
|
1205
1175
|
|
|
1206
1176
|
export declare const PlainInput: Story_10;
|
|
@@ -1311,7 +1281,7 @@ export declare const ShowMore: Story_22;
|
|
|
1311
1281
|
* ))}
|
|
1312
1282
|
* </ul>
|
|
1313
1283
|
* {moreItemsAvailable ?
|
|
1314
|
-
* <ShowMoreButton className="mt-
|
|
1284
|
+
* <ShowMoreButton className="mt-8" onClick={onShowMoreItems} lang="en" /> :
|
|
1315
1285
|
* null
|
|
1316
1286
|
* }
|
|
1317
1287
|
* </>
|
|
@@ -1464,7 +1434,7 @@ declare type Story_25 = StoryObj<typeof StyledHtml>;
|
|
|
1464
1434
|
|
|
1465
1435
|
declare type Story_26 = StoryObj<typeof TabsComponent>;
|
|
1466
1436
|
|
|
1467
|
-
declare type Story_27 = StoryObj<typeof
|
|
1437
|
+
declare type Story_27 = StoryObj<typeof Text_2>;
|
|
1468
1438
|
|
|
1469
1439
|
declare type Story_28 = StoryObj<typeof WarningBanner>;
|
|
1470
1440
|
|
|
@@ -1635,27 +1605,26 @@ export { TabsProps as TabsProps_alias_1 }
|
|
|
1635
1605
|
export { TabsProps as TabsProps_alias_2 }
|
|
1636
1606
|
export { TabsProps as TabsProps_alias_3 }
|
|
1637
1607
|
|
|
1638
|
-
declare const Technical: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1639
|
-
export { Technical }
|
|
1640
|
-
export { Technical as Technical_alias_1 }
|
|
1641
|
-
export { Technical as Technical_alias_2 }
|
|
1642
|
-
|
|
1643
|
-
declare const TechnicalTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1644
|
-
export { TechnicalTitle }
|
|
1645
|
-
export { TechnicalTitle as TechnicalTitle_alias_1 }
|
|
1646
|
-
export { TechnicalTitle as TechnicalTitle_alias_2 }
|
|
1647
|
-
|
|
1648
1608
|
/**
|
|
1649
|
-
*
|
|
1609
|
+
* Text component
|
|
1610
|
+
*
|
|
1611
|
+
* If the variant is `h1-display`, `h1`, `h2`, `h3`, or `h3-title` the `as` prop is required.
|
|
1650
1612
|
*
|
|
1651
|
-
*
|
|
1613
|
+
* This to force the consumer to consider which semantic html element to use. E.g. `<h1>` or `<h2>`
|
|
1652
1614
|
*
|
|
1653
|
-
*
|
|
1615
|
+
* @example
|
|
1616
|
+
* ```tsx
|
|
1617
|
+
* <Text variant="h1-display" as="h1">Hello world</Text>
|
|
1618
|
+
* <Text variant="body">
|
|
1619
|
+
* This is a body text
|
|
1620
|
+
* </Text>
|
|
1621
|
+
* ```
|
|
1654
1622
|
*/
|
|
1655
|
-
declare const Text_2: OverridableComponent<
|
|
1623
|
+
declare const Text_2: OverridableComponent<TextProps, HTMLDivElement>;
|
|
1656
1624
|
export { Text_2 as Text }
|
|
1657
1625
|
export { Text_2 as Text_alias_1 }
|
|
1658
1626
|
export { Text_2 as Text_alias_2 }
|
|
1627
|
+
export { Text_2 as Text_alias_3 }
|
|
1659
1628
|
|
|
1660
1629
|
declare const Textarea: ForwardRefExoticComponent<TextareaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
1661
1630
|
export { Textarea }
|
|
@@ -1671,72 +1640,168 @@ export { TextareaProps as TextareaProps_alias_2 }
|
|
|
1671
1640
|
export { TextareaProps as TextareaProps_alias_3 }
|
|
1672
1641
|
export { TextareaProps as TextareaProps_alias_4 }
|
|
1673
1642
|
|
|
1674
|
-
|
|
1643
|
+
/**
|
|
1644
|
+
* # 🚨 Unstable alternative
|
|
1645
|
+
*
|
|
1646
|
+
* named as the different typography levels with Text prefix
|
|
1647
|
+
*
|
|
1648
|
+
* ## Alias to @see Text
|
|
1649
|
+
*/
|
|
1650
|
+
declare const TextBody: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1675
1651
|
export { TextBody }
|
|
1676
1652
|
export { TextBody as TextBody_alias_1 }
|
|
1677
1653
|
export { TextBody as TextBody_alias_2 }
|
|
1678
1654
|
|
|
1679
|
-
|
|
1655
|
+
/**
|
|
1656
|
+
* # 🚨 Unstable alternative
|
|
1657
|
+
*
|
|
1658
|
+
* named as the different typography levels with Text prefix
|
|
1659
|
+
*
|
|
1660
|
+
* ## Alias to @see Text
|
|
1661
|
+
*/
|
|
1662
|
+
declare const TextBodySmall: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1680
1663
|
export { TextBodySmall }
|
|
1681
1664
|
export { TextBodySmall as TextBodySmall_alias_1 }
|
|
1682
1665
|
export { TextBodySmall as TextBodySmall_alias_2 }
|
|
1683
1666
|
|
|
1684
|
-
|
|
1667
|
+
/**
|
|
1668
|
+
* # 🚨 Unstable alternative
|
|
1669
|
+
*
|
|
1670
|
+
* named as the different typography levels with Text prefix
|
|
1671
|
+
*
|
|
1672
|
+
* ## Alias to @see Text
|
|
1673
|
+
*/
|
|
1674
|
+
declare const TextBodySmallTitle: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1685
1675
|
export { TextBodySmallTitle }
|
|
1686
1676
|
export { TextBodySmallTitle as TextBodySmallTitle_alias_1 }
|
|
1687
1677
|
export { TextBodySmallTitle as TextBodySmallTitle_alias_2 }
|
|
1688
1678
|
|
|
1689
|
-
|
|
1679
|
+
/**
|
|
1680
|
+
* # 🚨 Unstable alternative
|
|
1681
|
+
*
|
|
1682
|
+
* named as the different typography levels with Text prefix
|
|
1683
|
+
*
|
|
1684
|
+
* ## Alias to @see Text
|
|
1685
|
+
*/
|
|
1686
|
+
declare const TextBodyTitle: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1690
1687
|
export { TextBodyTitle }
|
|
1691
1688
|
export { TextBodyTitle as TextBodyTitle_alias_1 }
|
|
1692
1689
|
export { TextBodyTitle as TextBodyTitle_alias_2 }
|
|
1693
1690
|
|
|
1694
|
-
|
|
1691
|
+
/**
|
|
1692
|
+
* 🚨 Unstable alterentative: Named as the different typography levels with Text prefix
|
|
1693
|
+
*
|
|
1694
|
+
* ## Alias to @see Text
|
|
1695
|
+
*/
|
|
1696
|
+
declare const TextCaption: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1695
1697
|
export { TextCaption }
|
|
1696
1698
|
export { TextCaption as TextCaption_alias_1 }
|
|
1697
1699
|
export { TextCaption as TextCaption_alias_2 }
|
|
1698
1700
|
|
|
1699
|
-
|
|
1701
|
+
/**
|
|
1702
|
+
* 🚨 Unstable alterentative: Named as the different typography levels with Text prefix
|
|
1703
|
+
*
|
|
1704
|
+
* ## Alias to @see Text
|
|
1705
|
+
*/
|
|
1706
|
+
declare const TextCaptionTitle: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1700
1707
|
export { TextCaptionTitle }
|
|
1701
1708
|
export { TextCaptionTitle as TextCaptionTitle_alias_1 }
|
|
1702
1709
|
export { TextCaptionTitle as TextCaptionTitle_alias_2 }
|
|
1703
1710
|
|
|
1704
|
-
|
|
1711
|
+
/**
|
|
1712
|
+
* # 🚨 Unstable alternative
|
|
1713
|
+
*
|
|
1714
|
+
* named as the different typography levels with Text prefix
|
|
1715
|
+
*
|
|
1716
|
+
* ## Alias to @see Text
|
|
1717
|
+
*/
|
|
1718
|
+
declare const TextH1: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1705
1719
|
export { TextH1 }
|
|
1706
1720
|
export { TextH1 as TextH1_alias_1 }
|
|
1707
1721
|
export { TextH1 as TextH1_alias_2 }
|
|
1708
1722
|
|
|
1709
1723
|
/**
|
|
1710
|
-
*
|
|
1724
|
+
* # 🚨 Unstable alternative
|
|
1711
1725
|
*
|
|
1712
|
-
*
|
|
1726
|
+
* named as the different typography levels with Text prefix
|
|
1727
|
+
*
|
|
1728
|
+
* ## Alias to @see Text
|
|
1713
1729
|
*/
|
|
1714
|
-
declare const TextH1Display: FunctionComponent<Omit<
|
|
1730
|
+
declare const TextH1Display: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1715
1731
|
export { TextH1Display }
|
|
1716
1732
|
export { TextH1Display as TextH1Display_alias_1 }
|
|
1717
1733
|
export { TextH1Display as TextH1Display_alias_2 }
|
|
1718
1734
|
|
|
1719
|
-
|
|
1735
|
+
/**
|
|
1736
|
+
* # 🚨 Unstable alternative
|
|
1737
|
+
*
|
|
1738
|
+
* named as the different typography levels with Text prefix
|
|
1739
|
+
*
|
|
1740
|
+
* ## Alias to @see Text
|
|
1741
|
+
*/
|
|
1742
|
+
declare const TextH2: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1720
1743
|
export { TextH2 }
|
|
1721
1744
|
export { TextH2 as TextH2_alias_1 }
|
|
1722
1745
|
export { TextH2 as TextH2_alias_2 }
|
|
1723
1746
|
|
|
1724
|
-
|
|
1747
|
+
/**
|
|
1748
|
+
* # 🚨 Unstable alternative
|
|
1749
|
+
*
|
|
1750
|
+
* named as the different typography levels with Text prefix
|
|
1751
|
+
*
|
|
1752
|
+
* ## Alias to @see Text
|
|
1753
|
+
*/
|
|
1754
|
+
declare const TextH3: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1725
1755
|
export { TextH3 }
|
|
1726
1756
|
export { TextH3 as TextH3_alias_1 }
|
|
1727
1757
|
export { TextH3 as TextH3_alias_2 }
|
|
1728
1758
|
|
|
1729
|
-
|
|
1759
|
+
/**
|
|
1760
|
+
* # 🚨 Unstable alternative
|
|
1761
|
+
*
|
|
1762
|
+
* named as the different typography levels with Text prefix
|
|
1763
|
+
*
|
|
1764
|
+
* ## Alias to @see Text
|
|
1765
|
+
*/
|
|
1766
|
+
declare const TextH3Title: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1730
1767
|
export { TextH3Title }
|
|
1731
1768
|
export { TextH3Title as TextH3Title_alias_1 }
|
|
1732
1769
|
export { TextH3Title as TextH3Title_alias_2 }
|
|
1733
1770
|
|
|
1734
|
-
declare
|
|
1771
|
+
declare type TextProps = (HeadingProps | ParagraphProps) & {
|
|
1772
|
+
children: React_3.ReactNode;
|
|
1773
|
+
/**
|
|
1774
|
+
* The font-size of the component. By default it's `fluid` which means it's smaller on mobile and larger on desktop.
|
|
1775
|
+
*
|
|
1776
|
+
* But you can lock it to either the min or the max size.
|
|
1777
|
+
*/
|
|
1778
|
+
size?: "min" | "max" | "fluid";
|
|
1779
|
+
/**
|
|
1780
|
+
* 🚧 Experimental spacing
|
|
1781
|
+
*/
|
|
1782
|
+
_unstableSpacing?: boolean;
|
|
1783
|
+
};
|
|
1784
|
+
export { TextProps }
|
|
1785
|
+
export { TextProps as TextProps_alias_1 }
|
|
1786
|
+
export { TextProps as TextProps_alias_2 }
|
|
1787
|
+
export { TextProps as TextProps_alias_3 }
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* 🚨 Unstable alterentative: Named as the different typography levels with Text prefix
|
|
1791
|
+
*
|
|
1792
|
+
* ## Alias to @see Text
|
|
1793
|
+
*/
|
|
1794
|
+
declare const TextTechnical: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1735
1795
|
export { TextTechnical }
|
|
1736
1796
|
export { TextTechnical as TextTechnical_alias_1 }
|
|
1737
1797
|
export { TextTechnical as TextTechnical_alias_2 }
|
|
1738
1798
|
|
|
1739
|
-
|
|
1799
|
+
/**
|
|
1800
|
+
* 🚨 Unstable alterentative: Named as the different typography levels with Text prefix
|
|
1801
|
+
*
|
|
1802
|
+
* ## Alias to @see Text
|
|
1803
|
+
*/
|
|
1804
|
+
declare const TextTechnicalTitle: FunctionComponent<Omit<TextProps, "variant">>;
|
|
1740
1805
|
export { TextTechnicalTitle }
|
|
1741
1806
|
export { TextTechnicalTitle as TextTechnicalTitle_alias_1 }
|
|
1742
1807
|
export { TextTechnicalTitle as TextTechnicalTitle_alias_2 }
|
|
@@ -1767,99 +1832,6 @@ export declare const TrackingNumberSearch: Story_10;
|
|
|
1767
1832
|
*/
|
|
1768
1833
|
export declare const TwoElements: Story_4;
|
|
1769
1834
|
|
|
1770
|
-
/**
|
|
1771
|
-
* ## 🚨 WORK IN PROGRESS 🚨
|
|
1772
|
-
*/
|
|
1773
|
-
declare const Typography: OverridableComponent<TypographyProps, HTMLDivElement>;
|
|
1774
|
-
export { Typography }
|
|
1775
|
-
export { Typography as Typography_alias_1 }
|
|
1776
|
-
export { Typography as Typography_alias_2 }
|
|
1777
|
-
export { Typography as Typography_alias_3 }
|
|
1778
|
-
|
|
1779
|
-
declare const TypographyBody: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1780
|
-
export { TypographyBody }
|
|
1781
|
-
export { TypographyBody as TypographyBody_alias_1 }
|
|
1782
|
-
export { TypographyBody as TypographyBody_alias_2 }
|
|
1783
|
-
|
|
1784
|
-
declare const TypographyBodySmall: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1785
|
-
export { TypographyBodySmall }
|
|
1786
|
-
export { TypographyBodySmall as TypographyBodySmall_alias_1 }
|
|
1787
|
-
export { TypographyBodySmall as TypographyBodySmall_alias_2 }
|
|
1788
|
-
|
|
1789
|
-
declare const TypographyBodySmallTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1790
|
-
export { TypographyBodySmallTitle }
|
|
1791
|
-
export { TypographyBodySmallTitle as TypographyBodySmallTitle_alias_1 }
|
|
1792
|
-
export { TypographyBodySmallTitle as TypographyBodySmallTitle_alias_2 }
|
|
1793
|
-
|
|
1794
|
-
declare const TypographyBodyTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1795
|
-
export { TypographyBodyTitle }
|
|
1796
|
-
export { TypographyBodyTitle as TypographyBodyTitle_alias_1 }
|
|
1797
|
-
export { TypographyBodyTitle as TypographyBodyTitle_alias_2 }
|
|
1798
|
-
|
|
1799
|
-
declare const TypographyCaption: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1800
|
-
export { TypographyCaption }
|
|
1801
|
-
export { TypographyCaption as TypographyCaption_alias_1 }
|
|
1802
|
-
export { TypographyCaption as TypographyCaption_alias_2 }
|
|
1803
|
-
|
|
1804
|
-
declare const TypographyCaptionTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1805
|
-
export { TypographyCaptionTitle }
|
|
1806
|
-
export { TypographyCaptionTitle as TypographyCaptionTitle_alias_1 }
|
|
1807
|
-
export { TypographyCaptionTitle as TypographyCaptionTitle_alias_2 }
|
|
1808
|
-
|
|
1809
|
-
declare const TypographyH1: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1810
|
-
export { TypographyH1 }
|
|
1811
|
-
export { TypographyH1 as TypographyH1_alias_1 }
|
|
1812
|
-
export { TypographyH1 as TypographyH1_alias_2 }
|
|
1813
|
-
|
|
1814
|
-
/**
|
|
1815
|
-
* Alternative: Named as the different typography levels with Typography prefix
|
|
1816
|
-
*
|
|
1817
|
-
* ## Alias to @see Typography
|
|
1818
|
-
*/
|
|
1819
|
-
declare const TypographyH1Display: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1820
|
-
export { TypographyH1Display }
|
|
1821
|
-
export { TypographyH1Display as TypographyH1Display_alias_1 }
|
|
1822
|
-
export { TypographyH1Display as TypographyH1Display_alias_2 }
|
|
1823
|
-
|
|
1824
|
-
declare const TypographyH2: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1825
|
-
export { TypographyH2 }
|
|
1826
|
-
export { TypographyH2 as TypographyH2_alias_1 }
|
|
1827
|
-
export { TypographyH2 as TypographyH2_alias_2 }
|
|
1828
|
-
|
|
1829
|
-
declare const TypographyH3: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1830
|
-
export { TypographyH3 }
|
|
1831
|
-
export { TypographyH3 as TypographyH3_alias_1 }
|
|
1832
|
-
export { TypographyH3 as TypographyH3_alias_2 }
|
|
1833
|
-
|
|
1834
|
-
declare const TypographyH3Title: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1835
|
-
export { TypographyH3Title }
|
|
1836
|
-
export { TypographyH3Title as TypographyH3Title_alias_1 }
|
|
1837
|
-
export { TypographyH3Title as TypographyH3Title_alias_2 }
|
|
1838
|
-
|
|
1839
|
-
declare interface TypographyProps {
|
|
1840
|
-
children: React_3.ReactNode;
|
|
1841
|
-
variant?: "h1-display" | "h1" | "h2" | "h3" | "h3-title" | "body" | "body-title" | "body-small" | "body-small-title" | "technical" | "technical-title" | "caption" | "caption-title";
|
|
1842
|
-
size?: "min" | "max" | "fluid";
|
|
1843
|
-
/**
|
|
1844
|
-
* 🚧 Experimental spacing
|
|
1845
|
-
*/
|
|
1846
|
-
_unstableSpacing?: boolean;
|
|
1847
|
-
}
|
|
1848
|
-
export { TypographyProps }
|
|
1849
|
-
export { TypographyProps as TypographyProps_alias_1 }
|
|
1850
|
-
export { TypographyProps as TypographyProps_alias_2 }
|
|
1851
|
-
export { TypographyProps as TypographyProps_alias_3 }
|
|
1852
|
-
|
|
1853
|
-
declare const TypographyTechnical: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1854
|
-
export { TypographyTechnical }
|
|
1855
|
-
export { TypographyTechnical as TypographyTechnical_alias_1 }
|
|
1856
|
-
export { TypographyTechnical as TypographyTechnical_alias_2 }
|
|
1857
|
-
|
|
1858
|
-
declare const TypographyTechnicalTitle: FunctionComponent<Omit<TypographyProps, "variant">>;
|
|
1859
|
-
export { TypographyTechnicalTitle }
|
|
1860
|
-
export { TypographyTechnicalTitle as TypographyTechnicalTitle_alias_1 }
|
|
1861
|
-
export { TypographyTechnicalTitle as TypographyTechnicalTitle_alias_2 }
|
|
1862
|
-
|
|
1863
1835
|
export declare const Underline: Story_15;
|
|
1864
1836
|
|
|
1865
1837
|
/**
|
package/dist/button/button.js
CHANGED
|
@@ -90,7 +90,7 @@ var BaseButton = (0, import_react.forwardRef)(
|
|
|
90
90
|
{
|
|
91
91
|
[`hds-button--${variant}`]: fill === "contained",
|
|
92
92
|
[`hds-button--outline-${variant}`]: fill === "outline" || fill === "outlined",
|
|
93
|
-
"hds-button--full": fullWidth,
|
|
93
|
+
"hds-button--full": fullWidth === true,
|
|
94
94
|
"hds-button--mobile-full": fullWidth === "mobile",
|
|
95
95
|
"hds-button--icon-only": icon && !children
|
|
96
96
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\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,\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,mBAA2B;AAC3B,6BAAqB;AAgEf;AAzBC,IAAM,iBAGT;AAAA,EACF,CACE,IAWA,QACG;AAZH,iBACE;AAAA,UAAI,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,MACA;AAAA,IArDN,IA6CI,IASK,iBATL,IASK;AAAA,MARH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAOF,QAAI,SAAS,YAAY;AAEvB,cAAQ,KAAK,yEAAyE;AAAA,IACxF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,eAAe,IAAI;AAAA,UACnB;AAAA,YACE,CAAC,eAAe,OAAO,EAAE,GAAG,SAAS;AAAA,YACrC,CAAC,uBAAuB,OAAO,EAAE,GAAG,SAAS,aAAa,SAAS;AAAA,YACnE,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/button/button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\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,mBAA2B;AAC3B,6BAAqB;AAgEf;AAzBC,IAAM,iBAGT;AAAA,EACF,CACE,IAWA,QACG;AAZH,iBACE;AAAA,UAAI,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,MACA;AAAA,IArDN,IA6CI,IASK,iBATL,IASK;AAAA,MARH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAOF,QAAI,SAAS,YAAY;AAEvB,cAAQ,KAAK,yEAAyE;AAAA,IACxF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,eAAe,IAAI;AAAA,UACnB;AAAA,YACE,CAAC,eAAe,OAAO,EAAE,GAAG,SAAS;AAAA,YACrC,CAAC,uBAAuB,OAAO,EAAE,GAAG,SAAS,aAAa,SAAS;AAAA,YACnE,oBAAoB,cAAc;AAAA,YAClC,2BAA2B,cAAc;AAAA,YACzC,yBAAyB,QAAQ,CAAC;AAAA,UACpC;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,SACI,OAdL;AAAA,QAgBE;AAAA,kBAAQ,CAAC,WAAW,OAAO;AAAA,UAC3B;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;AAUlB,IAAM,oBAAsE;AAAA,EACjF,CAAC,OAAO,QAAQ;AACd,WAAO,4CAAC,6CAAe,QAAf,EAAsB,KAAU,SAAQ,YAAU;AAAA,EAC5D;AACF;AAEA,cAAc,cAAc;AAErB,IAAM,sBAAwE;AAAA,EACnF,CAAC,OAAO,QAAQ;AACd,WAAO,4CAAC,6CAAe,QAAf,EAAsB,KAAU,SAAQ,cAAY;AAAA,EAC9D;AACF;AAEA,gBAAgB,cAAc;","names":[]}
|
package/dist/button/button.mjs
CHANGED
package/dist/button/index.js
CHANGED
|
@@ -91,7 +91,7 @@ var BaseButton = (0, import_react.forwardRef)(
|
|
|
91
91
|
{
|
|
92
92
|
[`hds-button--${variant}`]: fill === "contained",
|
|
93
93
|
[`hds-button--outline-${variant}`]: fill === "outline" || fill === "outlined",
|
|
94
|
-
"hds-button--full": fullWidth,
|
|
94
|
+
"hds-button--full": fullWidth === true,
|
|
95
95
|
"hds-button--mobile-full": fullWidth === "mobile",
|
|
96
96
|
"hds-button--icon-only": icon && !children
|
|
97
97
|
},
|
package/dist/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/index.tsx","../../src/button/button.tsx"],"sourcesContent":["export { PrimaryButton, SecondaryButton } from \"./button\";\n\nexport type * from \"./button\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\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,\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;;;ACAA,mBAA2B;AAC3B,6BAAqB;AAgEf;AAzBC,IAAM,iBAGT;AAAA,EACF,CACE,IAWA,QACG;AAZH,iBACE;AAAA,UAAI,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,MACA;AAAA,IArDN,IA6CI,IASK,iBATL,IASK;AAAA,MARH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAOF,QAAI,SAAS,YAAY;AAEvB,cAAQ,KAAK,yEAAyE;AAAA,IACxF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,eAAe,IAAI;AAAA,UACnB;AAAA,YACE,CAAC,eAAe,OAAO,EAAE,GAAG,SAAS;AAAA,YACrC,CAAC,uBAAuB,OAAO,EAAE,GAAG,SAAS,aAAa,SAAS;AAAA,YACnE,oBAAoB;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/button/index.tsx","../../src/button/button.tsx"],"sourcesContent":["export { PrimaryButton, SecondaryButton } from \"./button\";\n\nexport type * from \"./button\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\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;;;ACAA,mBAA2B;AAC3B,6BAAqB;AAgEf;AAzBC,IAAM,iBAGT;AAAA,EACF,CACE,IAWA,QACG;AAZH,iBACE;AAAA,UAAI,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,MACA;AAAA,IArDN,IA6CI,IASK,iBATL,IASK;AAAA,MARH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAOF,QAAI,SAAS,YAAY;AAEvB,cAAQ,KAAK,yEAAyE;AAAA,IACxF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,eAAe,IAAI;AAAA,UACnB;AAAA,YACE,CAAC,eAAe,OAAO,EAAE,GAAG,SAAS;AAAA,YACrC,CAAC,uBAAuB,OAAO,EAAE,GAAG,SAAS,aAAa,SAAS;AAAA,YACnE,oBAAoB,cAAc;AAAA,YAClC,2BAA2B,cAAc;AAAA,YACzC,yBAAyB,QAAQ,CAAC;AAAA,UACpC;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,SACI,OAdL;AAAA,QAgBE;AAAA,kBAAQ,CAAC,WAAW,OAAO;AAAA,UAC3B;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;AAUlB,IAAM,oBAAsE;AAAA,EACjF,CAAC,OAAO,QAAQ;AACd,WAAO,4CAAC,6CAAe,QAAf,EAAsB,KAAU,SAAQ,YAAU;AAAA,EAC5D;AACF;AAEA,cAAc,cAAc;AAErB,IAAM,sBAAwE;AAAA,EACnF,CAAC,OAAO,QAAQ;AACd,WAAO,4CAAC,6CAAe,QAAf,EAAsB,KAAU,SAAQ,cAAY;AAAA,EAC9D;AACF;AAEA,gBAAgB,cAAc;","names":[]}
|
package/dist/button/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/show-more/show-more.tsx"],"sourcesContent":["import { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\n\ntype Variant =\n | {\n variant?: \"show-more\";\n expanded?: never;\n }\n | {\n variant: \"show-more-show-less\";\n expanded: boolean;\n };\n\nexport type ShowMoreProps = React.HTMLAttributes<HTMLButtonElement> & {\n text: React.ReactNode;\n} & Variant;\n\n/**\n * Simple button for triggering more content.\n *\n * You have to add the logic for what happens when the button is clicked yourself.\n *\n * **Example**\n *\n * ```tsx\n * function Content() {\n * const [items, fetchMoreItems, moreItemsAvailable] = useYourData();\n * function onShowMoreItems() {\n * fetchMoreItems();\n * }\n * return (\n * <>\n * <ul>\n * {items.map((item) => (\n * <li key={item.id}>{item.text}</li>\n * ))}\n * </ul>\n * {moreItemsAvailable ?\n * <ShowMoreButton className=\"mt-8\" onClick={onShowMoreItems} lang=\"en\" /> :\n * null\n * }\n * </>\n * )\n * }\n * ```\n */\nexport function ShowMoreButton({ text, variant, expanded, className, ...rest }: ShowMoreProps) {\n return (\n <button\n className={clsx(\n \"hds-show-more\",\n variant === \"show-more-show-less\" && \"hds-show-more--show-less\",\n className as undefined,\n )}\n data-state={expanded ? \"expanded\" : undefined}\n type=\"button\"\n {...rest}\n >\n {text}\n <span className={clsx(\"hds-show-more__icon\")} />\n </button>\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAS,YAAY;AA+CjB,SAWE,KAXF;AAFG,SAAS,eAAe,IAAgE;AAAhE,eAAE,QAAM,SAAS,UAAU,UA7C1D,IA6C+B,IAAyC,iBAAzC,IAAyC,CAAvC,QAAM,WAAS,YAAU;AACxD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,YAAY,yBAAyB;AAAA,QACrC;AAAA,MACF;AAAA,MACA,cAAY,WAAW,aAAa;AAAA,MACpC,MAAK;AAAA,OACD,OARL;AAAA,MAUE;AAAA;AAAA,QACD,oBAAC,UAAK,WAAW,KAAK,qBAAqB,GAAG;AAAA;AAAA;AAAA,EAChD;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ModalContent,
|
|
4
4
|
ModalFooter,
|
|
5
5
|
ModalHeader
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GVSLN5KE.mjs";
|
|
7
7
|
|
|
8
8
|
// src/modal/index.tsx
|
|
9
9
|
var ModalComponent = Modal;
|
|
@@ -14,4 +14,4 @@ ModalComponent.Footer = ModalFooter;
|
|
|
14
14
|
export {
|
|
15
15
|
ModalComponent
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-BDA6STW2.mjs.map
|
|
@@ -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/index.mjs\";\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 style={{ display: \"flex\", gap: 16 }}>\n <PrimaryButton fill=\"outline\" onClick={onClose}>\n Close\n </PrimaryButton>\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":";;;;;;;;;;;;;AAAA,SAAS,YAAY,WAAW,cAAc;AAC9C,SAAS,YAAY;AAmFf;AAjCC,IAAM,QAAQ;AAAA,EACnB,CAAC,IAAuE,QAAQ;AAA/E,iBAAE,YAAU,WAAW,MAAM,sBAAsB,QApDtD,IAoDG,IAA+D,iBAA/D,IAA+D,CAA7D,YAAU,aAAW,QAAM,wBAAsB;AAClD,UAAM,WAAW,OAA0B,IAAI;AAC/C,UAAM,YAAY,aAAa,CAAC,UAAU,GAAG,CAAC;AAG9C,aAAS,qBAAqB;AAzDlC,UAAAA;AA0DM,OAAAA,MAAA,SAAS,YAAT,gBAAAA,IAAkB;AAClB,aAAO;AAAA,IACT;AAGA,kBAAc,UAAU,uBAAuB;AAG/C,cAAU,MAAM;AACd,UAAI,SAAS,WAAW,SAAS,QAAW;AAC1C,YAAI,QAAQ,CAAC,SAAS,QAAQ,MAAM;AAClC,mBAAS,QAAQ,UAAU;AAAA,QAC7B,WAAW,CAAC,QAAQ,SAAS,QAAQ,MAAM;AACzC,mBAAS,QAAQ,MAAM;AAAA,QACzB;AAAA,MACF;AAAA,IACF,GAAG,CAAC,UAAU,IAAI,CAAC;AAEnB,aAAS,cAAc,GAAkC;AACvD,UAAI,wBAAwB,EAAE,WAAW,SAAS,SAAS;AACzD,iBAAS,QAAQ,MAAM;AAAA,MACzB;AACA,yCAAU;AAAA,IACZ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,WAAW,KAAK,aAAa,SAAsB;AAAA,QACnD,WAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,KAAK;AAAA,QACL,SAAQ;AAAA,SAEF,OATP;AAAA,QAYE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAEb,IAAM,cAAgE;AAAA,EAC3E,CAAC,IAA8C,QAAQ;AAAtD,iBAAE,MAAI,YAAY,MAAM,UAxG3B,IAwGG,IAAsC,iBAAtC,IAAsC,CAApC,MAAsB;AACvB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;AAEnB,IAAM,eAA6D;AAAA,EACxE,CAAC,IAA+C,QAAQ;AAAvD,iBAAE,MAAI,YAAY,OAAO,UArH5B,IAqHG,IAAuC,iBAAvC,IAAuC,CAArC,MAAuB;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK,sBAAsB,SAAsB;AAAA,QAC5D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAEpB,IAAM,cAA4D;AAAA,EACvE,CAAC,IAAkD,QAAQ;AAA1D,iBAAE,MAAI,YAAY,UAAU,UAlI/B,IAkIG,IAA0C,iBAA1C,IAA0C,CAAxC,MAA0B;AAC3B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;AAEnB,SAAS,cAAc,UAA8C,WAAmB;AAC7F,YAAU,MAAM;AACd,QAAI,CAAC,SAAS;AAAS;AACvB,QAAI,SAAS,QAAQ;AAAM,eAAS,KAAK,UAAU,IAAI,SAAS;AAEhE,UAAM,WAAW,IAAI,iBAAiB,MAAM;AAnJhD;AAoJM,WAAI,cAAS,YAAT,mBAAkB;AAAM,iBAAS,KAAK,UAAU,IAAI,SAAS;AAAA;AAC5D,iBAAS,KAAK,UAAU,OAAO,SAAS;AAAA,IAC/C,CAAC;AACD,aAAS,QAAQ,SAAS,SAAS;AAAA,MACjC,YAAY;AAAA,MACZ,iBAAiB,CAAC,MAAM;AAAA,IAC1B,CAAC;AACD,WAAO,MAAM;AACX,eAAS,WAAW;AACpB,eAAS,KAAK,UAAU,OAAO,SAAS;AAAA,IAC1C;AAAA,EACF,GAAG,CAAC,WAAW,QAAQ,CAAC;AAC1B;","names":["_a"]}
|
|
@@ -27,9 +27,9 @@ var StyledHtml = forwardRef(
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
StyledHtml.displayName = "
|
|
30
|
+
StyledHtml.displayName = "StyledHtml";
|
|
31
31
|
|
|
32
32
|
export {
|
|
33
33
|
StyledHtml
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-J6ES2LO5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/styled-html/styled-html.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\nimport type { OverridableComponent } from \"../utils\";\n\nexport interface StyledHtmlProps {\n children?: React.ReactNode;\n size?: \"default\" | \"small\";\n darkmode?: boolean;\n}\n\n/**\n * A component for displaying dynamic content that you want to apply hedwig styling to.\n * the styling depends on the semantic html elements you use inside the component.\n *\n * Useful when you have dynamic content that you want styled with hedwig, like content from a CMS.\n *\n * Previously known as `hw-wysiwyg` in hedwig legacy. In tailwind this kind of component it is known as `prose`.\n *\n * ```tsx\n * <StyledHtml>\n * <h1>Heading 1</h1>\n * <h2>Heading 2</h2>\n * <a href=\"https://www.postenbring.no\">Postenbring</a>\n * <ul>\n * <li>Hei</li>\n * <li>Hallo</li>\n * <li>Hello</li>\n * </ul>\n * </StyledHtml>\n * ```\n */\nexport const StyledHtml: OverridableComponent<StyledHtmlProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, size, darkmode = false, className, ...rest }, ref) => {\n return (\n <Component\n className={clsx(\n `hds-styled-html`,\n size === \"small\" && \"hds-styled-html--small\",\n darkmode && \"hds-styled-html--darkmode\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nStyledHtml.displayName = \"
|
|
1
|
+
{"version":3,"sources":["../src/styled-html/styled-html.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname/index.mjs\";\nimport type { OverridableComponent } from \"../utils\";\n\nexport interface StyledHtmlProps {\n children?: React.ReactNode;\n size?: \"default\" | \"small\";\n darkmode?: boolean;\n}\n\n/**\n * A component for displaying dynamic content that you want to apply hedwig styling to.\n * the styling depends on the semantic html elements you use inside the component.\n *\n * Useful when you have dynamic content that you want styled with hedwig, like content from a CMS.\n *\n * Previously known as `hw-wysiwyg` in hedwig legacy. In tailwind this kind of component it is known as `prose`.\n *\n * ```tsx\n * <StyledHtml>\n * <h1>Heading 1</h1>\n * <h2>Heading 2</h2>\n * <a href=\"https://www.postenbring.no\">Postenbring</a>\n * <ul>\n * <li>Hei</li>\n * <li>Hallo</li>\n * <li>Hello</li>\n * </ul>\n * </StyledHtml>\n * ```\n */\nexport const StyledHtml: OverridableComponent<StyledHtmlProps, HTMLDivElement> = forwardRef(\n ({ as: Component = \"div\", children, size, darkmode = false, className, ...rest }, ref) => {\n return (\n <Component\n className={clsx(\n `hds-styled-html`,\n size === \"small\" && \"hds-styled-html--small\",\n darkmode && \"hds-styled-html--darkmode\",\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nStyledHtml.displayName = \"StyledHtml\";\n"],"mappings":";;;;;;;AAAA,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AAiCf;AAHC,IAAM,aAAoE;AAAA,EAC/E,CAAC,IAAiF,QAAQ;AAAzF,iBAAE,MAAI,YAAY,OAAO,UAAU,MAAM,WAAW,OAAO,UAhC9D,IAgCG,IAAyE,iBAAzE,IAAyE,CAAvE,MAAuB,YAAU,QAAM,YAAkB;AAC1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,SAAS,WAAW;AAAA,UACpB,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QACA;AAAA,SACI,OARL;AAAA,QAUE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
|