@postenbring/hedwig-react 3.0.6 → 4.0.0
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/alert/alert.d.ts +14 -0
- package/dist/alert/alert.d.ts.map +1 -1
- package/dist/alert/alert.js +43 -7
- package/dist/alert/alert.js.map +1 -1
- package/dist/alert/alert.mjs +2 -2
- package/dist/alert/index.js +43 -7
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +2 -2
- package/dist/badge/badge.d.ts +12 -2
- package/dist/badge/badge.d.ts.map +1 -1
- package/dist/badge/badge.js +21 -4
- package/dist/badge/badge.js.map +1 -1
- package/dist/badge/badge.mjs +1 -1
- package/dist/badge/index.js +21 -4
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/box/box.d.ts +9 -2
- package/dist/box/box.d.ts.map +1 -1
- package/dist/box/box.js +31 -3
- package/dist/box/box.js.map +1 -1
- package/dist/box/box.mjs +1 -1
- package/dist/box/index.js +31 -3
- package/dist/box/index.js.map +1 -1
- package/dist/box/index.mjs +1 -1
- package/dist/card/card.d.ts +85 -7
- package/dist/card/card.d.ts.map +1 -1
- package/dist/card/card.js +30 -6
- package/dist/card/card.js.map +1 -1
- package/dist/card/card.mjs +1 -1
- package/dist/card/index.js +30 -6
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/{chunk-JOEPTRHW.mjs → chunk-BFM6UZGI.mjs} +31 -7
- package/dist/chunk-BFM6UZGI.mjs.map +1 -0
- package/dist/{chunk-3OGHJOJF.mjs → chunk-DEABU7DB.mjs} +32 -4
- package/dist/chunk-DEABU7DB.mjs.map +1 -0
- package/dist/{chunk-EQFY63YP.mjs → chunk-EDPWJWQO.mjs} +2 -2
- package/dist/chunk-F4VC5NPP.mjs +54 -0
- package/dist/chunk-F4VC5NPP.mjs.map +1 -0
- package/dist/{chunk-W7CPW23K.mjs → chunk-F7MLQ6JI.mjs} +4 -14
- package/dist/{chunk-W7CPW23K.mjs.map → chunk-F7MLQ6JI.mjs.map} +1 -1
- package/dist/{chunk-EGW3RCXD.mjs → chunk-I76U35YW.mjs} +2 -3
- package/dist/chunk-I76U35YW.mjs.map +1 -0
- package/dist/{chunk-BYFBK3J7.mjs → chunk-ILN2L5NX.mjs} +4 -4
- package/dist/chunk-ILN2L5NX.mjs.map +1 -0
- package/dist/{chunk-YZDURLEY.mjs → chunk-INDTHGWZ.mjs} +2 -2
- package/dist/{chunk-4P4GPVKZ.mjs → chunk-PZUJLRG4.mjs} +14 -6
- package/dist/chunk-PZUJLRG4.mjs.map +1 -0
- package/dist/{chunk-OHDHIRAW.mjs → chunk-QE2ZES72.mjs} +1 -1
- package/dist/chunk-QE2ZES72.mjs.map +1 -0
- package/dist/{chunk-I4NL4ESV.mjs → chunk-YNGU3V4J.mjs} +3 -2
- package/dist/chunk-YNGU3V4J.mjs.map +1 -0
- package/dist/footer/footer.d.ts.map +1 -1
- package/dist/footer/footer.js +2 -1
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +1 -1
- package/dist/footer/index.js +2 -1
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +1 -1
- package/dist/form/error-summary/error-summary.d.ts.map +1 -1
- package/dist/form/error-summary/error-summary.js +32 -14
- package/dist/form/error-summary/error-summary.js.map +1 -1
- package/dist/form/error-summary/error-summary.mjs +3 -3
- package/dist/form/error-summary/index.js +32 -14
- package/dist/form/error-summary/index.js.map +1 -1
- package/dist/form/error-summary/index.mjs +3 -3
- package/dist/form/index.js +32 -14
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +3 -3
- package/dist/help-text/help-text.js +31 -3
- package/dist/help-text/help-text.js.map +1 -1
- package/dist/help-text/help-text.mjs +2 -2
- package/dist/help-text/index.js +31 -3
- package/dist/help-text/index.js.map +1 -1
- package/dist/help-text/index.mjs +2 -2
- package/dist/index.js +102 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/link/index.js.map +1 -1
- package/dist/link/index.mjs +1 -1
- package/dist/link/link.d.ts +1 -1
- package/dist/link/link.d.ts.map +1 -1
- package/dist/link/link.js.map +1 -1
- package/dist/link/link.mjs +1 -1
- package/dist/message/index.js +33 -5
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +2 -2
- package/dist/message/message.d.ts +1 -0
- package/dist/message/message.d.ts.map +1 -1
- package/dist/message/message.js +33 -5
- package/dist/message/message.js.map +1 -1
- package/dist/message/message.mjs +2 -2
- package/dist/modal/index.js +31 -3
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +2 -2
- package/dist/modal/modal.js +31 -3
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +2 -2
- package/dist/styled-html/index.js +1 -2
- package/dist/styled-html/index.js.map +1 -1
- package/dist/styled-html/index.mjs +1 -1
- package/dist/styled-html/styled-html.d.ts +0 -4
- package/dist/styled-html/styled-html.d.ts.map +1 -1
- package/dist/styled-html/styled-html.js +1 -2
- package/dist/styled-html/styled-html.js.map +1 -1
- package/dist/styled-html/styled-html.mjs +1 -1
- package/package.json +2 -2
- package/src/alert/alert.stories.tsx +2 -2
- package/src/alert/alert.tsx +36 -4
- package/src/badge/badge.tsx +34 -4
- package/src/box/box.stories.tsx +7 -1
- package/src/box/box.tsx +47 -4
- package/src/card/card.tsx +139 -13
- package/src/footer/footer.tsx +2 -1
- package/src/form/error-summary/error-summary.tsx +1 -7
- package/src/link/link.tsx +1 -1
- package/src/message/message.tsx +2 -0
- package/src/styled-html/styled-html.stories.tsx +0 -7
- package/src/styled-html/styled-html.tsx +1 -7
- package/dist/chunk-3OGHJOJF.mjs.map +0 -1
- package/dist/chunk-4P4GPVKZ.mjs.map +0 -1
- package/dist/chunk-BYFBK3J7.mjs.map +0 -1
- package/dist/chunk-EGW3RCXD.mjs.map +0 -1
- package/dist/chunk-I4NL4ESV.mjs.map +0 -1
- package/dist/chunk-JOEPTRHW.mjs.map +0 -1
- package/dist/chunk-OHDHIRAW.mjs.map +0 -1
- package/dist/chunk-OXZOGFNV.mjs +0 -37
- package/dist/chunk-OXZOGFNV.mjs.map +0 -1
- /package/dist/{chunk-EQFY63YP.mjs.map → chunk-EDPWJWQO.mjs.map} +0 -0
- /package/dist/{chunk-YZDURLEY.mjs.map → chunk-INDTHGWZ.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import "./chunk-JKCVB5TR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
StyledHtml
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I76U35YW.mjs";
|
|
13
13
|
import "./chunk-3LYJRAOC.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Table
|
|
@@ -48,14 +48,14 @@ import {
|
|
|
48
48
|
Message,
|
|
49
49
|
MessageDescription,
|
|
50
50
|
MessageTitle
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ILN2L5NX.mjs";
|
|
52
52
|
import "./chunk-FYFJ75NX.mjs";
|
|
53
53
|
import {
|
|
54
54
|
Modal,
|
|
55
55
|
ModalContent,
|
|
56
56
|
ModalFooter,
|
|
57
57
|
ModalHeader
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-EDPWJWQO.mjs";
|
|
59
59
|
import "./chunk-H3E546OT.mjs";
|
|
60
60
|
import {
|
|
61
61
|
Navbar,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
FooterLinkSection,
|
|
104
104
|
FooterLinkSections,
|
|
105
105
|
FooterLogo
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-YNGU3V4J.mjs";
|
|
107
107
|
import "./chunk-IJSEJZ3W.mjs";
|
|
108
108
|
import "./chunk-BYEJZSG5.mjs";
|
|
109
109
|
import {
|
|
@@ -147,12 +147,12 @@ import {
|
|
|
147
147
|
} from "./chunk-LHIG6RW7.mjs";
|
|
148
148
|
import {
|
|
149
149
|
ErrorSummary
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-F7MLQ6JI.mjs";
|
|
151
151
|
import "./chunk-CKAL5ZJZ.mjs";
|
|
152
152
|
import "./chunk-XLLYMQLW.mjs";
|
|
153
153
|
import {
|
|
154
154
|
Link
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-QE2ZES72.mjs";
|
|
156
156
|
import "./chunk-6QV3OV66.mjs";
|
|
157
157
|
import {
|
|
158
158
|
LinkList
|
|
@@ -164,12 +164,12 @@ import {
|
|
|
164
164
|
import "./chunk-CFAH2LID.mjs";
|
|
165
165
|
import {
|
|
166
166
|
HelpText
|
|
167
|
-
} from "./chunk-
|
|
168
|
-
import "./chunk-ISAHCU7C.mjs";
|
|
167
|
+
} from "./chunk-INDTHGWZ.mjs";
|
|
169
168
|
import "./chunk-HT2EIJAD.mjs";
|
|
169
|
+
import "./chunk-ISAHCU7C.mjs";
|
|
170
170
|
import {
|
|
171
|
-
|
|
172
|
-
} from "./chunk-
|
|
171
|
+
Breadcrumbs
|
|
172
|
+
} from "./chunk-A42PXOVR.mjs";
|
|
173
173
|
import "./chunk-Y6NOEN7R.mjs";
|
|
174
174
|
import {
|
|
175
175
|
ButtonList
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
CardBodyHeaderTitle,
|
|
187
187
|
CardMedia,
|
|
188
188
|
CardMediaImg
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-BFM6UZGI.mjs";
|
|
190
190
|
import {
|
|
191
191
|
DescriptionList
|
|
192
192
|
} from "./chunk-C7ZTOZP3.mjs";
|
|
@@ -194,15 +194,15 @@ import "./chunk-OVKUPO5U.mjs";
|
|
|
194
194
|
import "./chunk-K6PP3ACJ.mjs";
|
|
195
195
|
import {
|
|
196
196
|
Badge
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-F4VC5NPP.mjs";
|
|
198
198
|
import "./chunk-KFDS3IPB.mjs";
|
|
199
199
|
import {
|
|
200
200
|
Blockquote
|
|
201
201
|
} from "./chunk-JYN2QSN2.mjs";
|
|
202
202
|
import "./chunk-BCFV6VOE.mjs";
|
|
203
203
|
import {
|
|
204
|
-
|
|
205
|
-
} from "./chunk-
|
|
204
|
+
Button
|
|
205
|
+
} from "./chunk-TYCGAA35.mjs";
|
|
206
206
|
import "./chunk-ZKMFJZSH.mjs";
|
|
207
207
|
import {
|
|
208
208
|
Accordion
|
|
@@ -232,11 +232,11 @@ import {
|
|
|
232
232
|
Alert,
|
|
233
233
|
AlertDescription,
|
|
234
234
|
AlertTitle
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-PZUJLRG4.mjs";
|
|
236
236
|
import {
|
|
237
237
|
Box,
|
|
238
238
|
BoxCloseButton
|
|
239
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-DEABU7DB.mjs";
|
|
240
240
|
import "./chunk-YOSPWY5K.mjs";
|
|
241
241
|
export {
|
|
242
242
|
Accordion,
|
package/dist/link/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/link/index.tsx","../../src/link/link.tsx"],"sourcesContent":["export { Link } from \"./link\";\n\nexport type * from \"./link\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nexport interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The visual style of the link\n */\n variant?: \"underline\" | \"solid\" | \"
|
|
1
|
+
{"version":3,"sources":["../../src/link/index.tsx","../../src/link/link.tsx"],"sourcesContent":["export { Link } from \"./link\";\n\nexport type * from \"./link\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nexport interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The visual style of the link\n */\n variant?: \"underline\" | \"solid\" | \"no-underline\";\n\n /**\n * Font size of the link\n * @default \"default\"\n */\n size?: \"default\" | \"small\" | \"large\" | \"technical\";\n\n /**\n * Specify that there is an icon in the link.\n * `icon=\"leading\"`: There is an icon before the text.\n * `icon=\"trailing\"`: There is an icon after the text.\n *\n */\n icon?: \"leading\" | \"trailing\";\n\n children: React.ReactNode;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (\n { asChild, children, variant = \"underline\", size = \"default\", icon, className, ...rest },\n ref,\n ) => {\n const Component = asChild ? Slot : \"a\";\n\n return (\n <Component\n className={clsx(\n \"hds-link\",\n variant !== \"underline\" && `hds-link--${variant}`,\n size !== \"default\" && `hds-link--${size}`,\n { \"hds-link--trailing-icon\": icon === \"trailing\" },\n { \"hds-link--leading-icon\": icon === \"leading\" },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nLink.displayName = \"Link\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAAqB;AACrB,mBAA2B;AAC3B,wBAAqB;AAwCf;AARC,IAAM,WAAO;AAAA,EAClB,CACE,IACA,QACG;AAFH,iBAAE,WAAS,UAAU,UAAU,aAAa,OAAO,WAAW,MAAM,UArCxE,IAqCI,IAAkF,iBAAlF,IAAkF,CAAhF,WAAS,YAAU,WAAuB,QAAkB,QAAM;AAGpE,UAAM,YAAY,UAAU,yBAAO;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,YAAY,eAAe,aAAa,OAAO;AAAA,UAC/C,SAAS,aAAa,aAAa,IAAI;AAAA,UACvC,EAAE,2BAA2B,SAAS,WAAW;AAAA,UACjD,EAAE,0BAA0B,SAAS,UAAU;AAAA,UAC/C;AAAA,QACF;AAAA,QACA;AAAA,SACI,OAVL;AAAA,QAYE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,KAAK,cAAc;","names":[]}
|
package/dist/link/index.mjs
CHANGED
package/dist/link/link.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
3
3
|
/**
|
|
4
4
|
* The visual style of the link
|
|
5
5
|
*/
|
|
6
|
-
variant?: "underline" | "solid" | "
|
|
6
|
+
variant?: "underline" | "solid" | "no-underline";
|
|
7
7
|
/**
|
|
8
8
|
* Font size of the link
|
|
9
9
|
* @default "default"
|
package/dist/link/link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;IAEjD;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;IAEnD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAE9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,qFAwBhB,CAAC"}
|
package/dist/link/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/link/link.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\";\n\nexport interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The visual style of the link\n */\n variant?: \"underline\" | \"solid\" | \"
|
|
1
|
+
{"version":3,"sources":["../../src/link/link.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\";\n\nexport interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The visual style of the link\n */\n variant?: \"underline\" | \"solid\" | \"no-underline\";\n\n /**\n * Font size of the link\n * @default \"default\"\n */\n size?: \"default\" | \"small\" | \"large\" | \"technical\";\n\n /**\n * Specify that there is an icon in the link.\n * `icon=\"leading\"`: There is an icon before the text.\n * `icon=\"trailing\"`: There is an icon after the text.\n *\n */\n icon?: \"leading\" | \"trailing\";\n\n children: React.ReactNode;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n (\n { asChild, children, variant = \"underline\", size = \"default\", icon, className, ...rest },\n ref,\n ) => {\n const Component = asChild ? Slot : \"a\";\n\n return (\n <Component\n className={clsx(\n \"hds-link\",\n variant !== \"underline\" && `hds-link--${variant}`,\n size !== \"default\" && `hds-link--${size}`,\n { \"hds-link--trailing-icon\": icon === \"trailing\" },\n { \"hds-link--leading-icon\": icon === \"leading\" },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nLink.displayName = \"Link\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,6BAAqB;AACrB,mBAA2B;AAC3B,wBAAqB;AAwCf;AARC,IAAM,WAAO;AAAA,EAClB,CACE,IACA,QACG;AAFH,iBAAE,WAAS,UAAU,UAAU,aAAa,OAAO,WAAW,MAAM,UArCxE,IAqCI,IAAkF,iBAAlF,IAAkF,CAAhF,WAAS,YAAU,WAAuB,QAAkB,QAAM;AAGpE,UAAM,YAAY,UAAU,yBAAO;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,YAAY,eAAe,aAAa,OAAO;AAAA,UAC/C,SAAS,aAAa,aAAa,IAAI;AAAA,UACvC,EAAE,2BAA2B,SAAS,WAAW;AAAA,UACjD,EAAE,0BAA0B,SAAS,UAAU;AAAA,UAC/C;AAAA,QACF;AAAA,QACA;AAAA,SACI,OAVL;AAAA,QAYE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,KAAK,cAAc;","names":[]}
|
package/dist/link/link.mjs
CHANGED
package/dist/message/index.js
CHANGED
|
@@ -65,23 +65,47 @@ var import_react = require("react");
|
|
|
65
65
|
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
66
66
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
67
67
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
68
|
+
function CloseIcon() {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 32 32", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
"path",
|
|
71
|
+
{
|
|
72
|
+
d: "M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z",
|
|
73
|
+
fill: "currentColor"
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
}
|
|
68
77
|
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
69
78
|
(_a, ref) => {
|
|
70
79
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
71
80
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
81
|
"button",
|
|
73
|
-
__spreadValues({
|
|
82
|
+
__spreadProps(__spreadValues({
|
|
74
83
|
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
75
84
|
ref,
|
|
76
85
|
type: "button"
|
|
77
|
-
}, rest)
|
|
86
|
+
}, rest), {
|
|
87
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, {})
|
|
88
|
+
})
|
|
78
89
|
);
|
|
79
90
|
}
|
|
80
91
|
);
|
|
81
92
|
BoxCloseButton.displayName = "Box.CloseButton";
|
|
93
|
+
var convertVariantToColor = (variant) => {
|
|
94
|
+
switch (variant) {
|
|
95
|
+
case "lighter":
|
|
96
|
+
return "";
|
|
97
|
+
case "white":
|
|
98
|
+
return "";
|
|
99
|
+
case "warning":
|
|
100
|
+
return "warning";
|
|
101
|
+
default:
|
|
102
|
+
return "neutral";
|
|
103
|
+
}
|
|
104
|
+
};
|
|
82
105
|
var Box = (0, import_react.forwardRef)(
|
|
83
106
|
(_a, ref) => {
|
|
84
107
|
var _b = _a, {
|
|
108
|
+
"data-color": color = "",
|
|
85
109
|
asChild,
|
|
86
110
|
variant,
|
|
87
111
|
closeable = false,
|
|
@@ -91,6 +115,7 @@ var Box = (0, import_react.forwardRef)(
|
|
|
91
115
|
children,
|
|
92
116
|
className
|
|
93
117
|
} = _b, rest = __objRest(_b, [
|
|
118
|
+
"data-color",
|
|
94
119
|
"asChild",
|
|
95
120
|
"variant",
|
|
96
121
|
"closeable",
|
|
@@ -113,12 +138,15 @@ var Box = (0, import_react.forwardRef)(
|
|
|
113
138
|
}, []);
|
|
114
139
|
const closed = closedProp != null ? closedProp : closedState;
|
|
115
140
|
const Component = asChild ? import_react_slot.Slot : "div";
|
|
141
|
+
const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
|
|
116
142
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
117
143
|
Component,
|
|
118
144
|
__spreadProps(__spreadValues({
|
|
145
|
+
"data-color": resolvedColor,
|
|
119
146
|
className: (0, import_typed_classname.clsx)(
|
|
120
147
|
"hds-box",
|
|
121
|
-
|
|
148
|
+
{ "hds-box--lighter": variant === "lighter" },
|
|
149
|
+
{ "hds-box--white": variant === "white" },
|
|
122
150
|
{ "hds-box--closed": closed },
|
|
123
151
|
className
|
|
124
152
|
),
|
|
@@ -170,10 +198,10 @@ var Message = (0, import_react2.forwardRef)(
|
|
|
170
198
|
var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
|
|
171
199
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
172
200
|
Box,
|
|
173
|
-
__spreadProps(__spreadValues({
|
|
201
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, variant === "warning" ? { "data-color-scheme": "light" } : {}), {
|
|
174
202
|
className: (0, import_typed_classname2.clsx)(`hds-message`, `hds-message--${variant}`, className),
|
|
175
203
|
ref
|
|
176
|
-
}, rest), {
|
|
204
|
+
}), rest), {
|
|
177
205
|
children: [
|
|
178
206
|
variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_typed_classname2.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
|
|
179
207
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/message/index.tsx","../../src/message/message.tsx","../../src/box/box.tsx"],"sourcesContent":["export { Message, MessageTitle, MessageDescription } from \"./message\";\nexport type * from \"./message\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n />\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Color variant of the box\n *\n * @default \"light-grey\"\n */\n variant?: \"light-grey\" | \"lighter\" | \"white\" | \"warning\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n return (\n <Component\n className={clsx(\n \"hds-box\",\n variant && `hds-box--${variant}`,\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivElement, BoxProps>> & {\n CloseButton: typeof BoxCloseButton;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,mBAAkD;AAClD,6BAAqB;AACrB,wBAAgC;A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AAC,sBAAA;AAJC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UAdd,IAcG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,sBAAsB,SAAsB;AAAA,QAC5D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAUpB,IAAM,yBAAqB;AAAA,EAChC,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UApCd,IAoCG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,QAClE;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAgB1B,IAAM,cAAU;AAAA,EACrB,CAAC,IAA4E,QAAQ;AAApF,iBAAE,YAAU,WAAW,UAAU,WAAW,MAAM,cAhErD,IAgEG,IAAoE,iBAApE,IAAoE,CAAlE,YAAU,aAAW,WAAqB,QAAM;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,eAAe,gBAAgB,OAAO,IAAI,SAAsB;AAAA,QAChF;AAAA,SACI,OAHL;AAAA,QAKE;AAAA,sBAAY,aACX,6CAAC,SAAI,eAAW,8BAAK,8BAA8B,aAA0B,GAC1E,gBACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/message/index.tsx","../../src/message/message.tsx","../../src/box/box.tsx"],"sourcesContent":["export { Message, MessageTitle, MessageDescription } from \"./message\";\nexport type * from \"./message\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\n/** @deprecated Use Alert component instead */\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n {...(variant === \"warning\" ? { \"data-color-scheme\": \"light\" } : {})}\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden xmlns=\"http://www.w3.org/2000/svg\" width={32} height={32} viewBox=\"0 0 32 32\">\n <path\n d=\"M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n >\n <CloseIcon />\n </button>\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Posten/Bring-spesific variant of the box. NB: warning variant is deprecated, use data-color=\"warning\" instead.\n *\n * @default \"light-grey\"\n */\n variant?:\n | \"light-grey\"\n | \"lighter\"\n | \"white\"\n /** @deprecated use data-color=\"warning\" instead */\n | \"warning\";\n\n /**\n * Color variant of the box\n *\n */\n\n \"data-color\"?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nconst convertVariantToColor = (variant: BoxProps[\"variant\"] | \"\") => {\n switch (variant) {\n case \"lighter\":\n return \"\";\n case \"white\":\n return \"\";\n case \"warning\":\n return \"warning\";\n default:\n return \"neutral\";\n }\n};\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n \"data-color\": color = \"\",\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n const resolvedColor = color && color !== \"\" ? color : convertVariantToColor(variant);\n\n return (\n <Component\n data-color={resolvedColor}\n className={clsx(\n \"hds-box\",\n { \"hds-box--lighter\": variant === \"lighter\" },\n { \"hds-box--white\": variant === \"white\" },\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivElement, BoxProps>> & {\n CloseButton: typeof BoxCloseButton;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,mBAAkD;AAClD,6BAAqB;AACrB,wBAAgC;AAK1B;AAHN,SAAS,YAAY;AACnB,SACE,4CAAC,SAAI,eAAW,MAAC,OAAM,8BAA6B,OAAO,IAAI,QAAQ,IAAI,SAAQ,aACjF;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,MAAK;AAAA;AAAA,EACP,GACF;AAEJ;AAGO,IAAM,qBAAiB;AAAA,EAC5B,CAAC,IAAwB,QAAQ;AAAhC,iBAAE,YAjBL,IAiBG,IAAgB,iBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,6BAAK,yBAAyB,SAAsB;AAAA,QAC/D;AAAA,QACA,MAAK;AAAA,SACD,OAJL;AAAA,QAMC,sDAAC,aAAU;AAAA;AAAA,IACb;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;AA+D7B,IAAM,wBAAwB,CAA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ACA,IAAI,cAAc;AAElB,IAAI,cAAc;;;AD/IZ,IAAAC,sBAAA;AAJC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UAdd,IAcG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,sBAAsB,SAAsB;AAAA,QAC5D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAUpB,IAAM,yBAAqB;AAAA,EAChC,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UApCd,IAoCG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,QAClE;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAiB1B,IAAM,cAAU;AAAA,EACrB,CAAC,IAA4E,QAAQ;AAApF,iBAAE,YAAU,WAAW,UAAU,WAAW,MAAM,cAjErD,IAiEG,IAAoE,iBAApE,IAAoE,CAAlE,YAAU,aAAW,WAAqB,QAAM;AACjD,WACE;AAAA,MAAC;AAAA,oEACM,YAAY,YAAY,EAAE,qBAAqB,QAAQ,IAAI,CAAC,IADlE;AAAA,QAEC,eAAW,8BAAK,eAAe,gBAAgB,OAAO,IAAI,SAAsB;AAAA,QAChF;AAAA,UACI,OAJL;AAAA,QAME;AAAA,sBAAY,aACX,6CAAC,SAAI,eAAW,8BAAK,8BAA8B,aAA0B,GAC1E,gBACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime"]}
|
package/dist/message/index.mjs
CHANGED
|
@@ -27,6 +27,7 @@ export type MessageProps = ({
|
|
|
27
27
|
icon?: React.ReactNode;
|
|
28
28
|
iconClassName?: string;
|
|
29
29
|
}) & Omit<BoxProps, "variant" | "asChild">;
|
|
30
|
+
/** @deprecated Use Alert component instead */
|
|
30
31
|
export declare const Message: MessageType;
|
|
31
32
|
type MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {
|
|
32
33
|
Title: typeof MessageTitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/message/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACnF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,YAAY,oHAWxB,CAAC;AAGF,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACzF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,kBAAkB,0HAW9B,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG,CACvB;IACE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACE,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CACJ,GACC,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/message/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACnF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,YAAY,oHAWxB,CAAC;AAGF,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACzF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,kBAAkB,0HAW9B,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG,CACvB;IACE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACE,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CACJ,GACC,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAExC,8CAA8C;AAC9C,eAAO,MAAM,OAAO,EAkBf,WAAW,CAAC;AAGjB,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC,GAAG;IAC/E,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,WAAW,EAAE,OAAO,kBAAkB,CAAC;CACxC,CAAC"}
|
package/dist/message/message.js
CHANGED
|
@@ -63,23 +63,47 @@ var import_react = require("react");
|
|
|
63
63
|
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
64
64
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
65
65
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
66
|
+
function CloseIcon() {
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 32 32", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
"path",
|
|
69
|
+
{
|
|
70
|
+
d: "M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z",
|
|
71
|
+
fill: "currentColor"
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
74
|
+
}
|
|
66
75
|
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
67
76
|
(_a, ref) => {
|
|
68
77
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
69
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
79
|
"button",
|
|
71
|
-
__spreadValues({
|
|
80
|
+
__spreadProps(__spreadValues({
|
|
72
81
|
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
73
82
|
ref,
|
|
74
83
|
type: "button"
|
|
75
|
-
}, rest)
|
|
84
|
+
}, rest), {
|
|
85
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, {})
|
|
86
|
+
})
|
|
76
87
|
);
|
|
77
88
|
}
|
|
78
89
|
);
|
|
79
90
|
BoxCloseButton.displayName = "Box.CloseButton";
|
|
91
|
+
var convertVariantToColor = (variant) => {
|
|
92
|
+
switch (variant) {
|
|
93
|
+
case "lighter":
|
|
94
|
+
return "";
|
|
95
|
+
case "white":
|
|
96
|
+
return "";
|
|
97
|
+
case "warning":
|
|
98
|
+
return "warning";
|
|
99
|
+
default:
|
|
100
|
+
return "neutral";
|
|
101
|
+
}
|
|
102
|
+
};
|
|
80
103
|
var Box = (0, import_react.forwardRef)(
|
|
81
104
|
(_a, ref) => {
|
|
82
105
|
var _b = _a, {
|
|
106
|
+
"data-color": color = "",
|
|
83
107
|
asChild,
|
|
84
108
|
variant,
|
|
85
109
|
closeable = false,
|
|
@@ -89,6 +113,7 @@ var Box = (0, import_react.forwardRef)(
|
|
|
89
113
|
children,
|
|
90
114
|
className
|
|
91
115
|
} = _b, rest = __objRest(_b, [
|
|
116
|
+
"data-color",
|
|
92
117
|
"asChild",
|
|
93
118
|
"variant",
|
|
94
119
|
"closeable",
|
|
@@ -111,12 +136,15 @@ var Box = (0, import_react.forwardRef)(
|
|
|
111
136
|
}, []);
|
|
112
137
|
const closed = closedProp != null ? closedProp : closedState;
|
|
113
138
|
const Component = asChild ? import_react_slot.Slot : "div";
|
|
139
|
+
const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
|
|
114
140
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
115
141
|
Component,
|
|
116
142
|
__spreadProps(__spreadValues({
|
|
143
|
+
"data-color": resolvedColor,
|
|
117
144
|
className: (0, import_typed_classname.clsx)(
|
|
118
145
|
"hds-box",
|
|
119
|
-
|
|
146
|
+
{ "hds-box--lighter": variant === "lighter" },
|
|
147
|
+
{ "hds-box--white": variant === "white" },
|
|
120
148
|
{ "hds-box--closed": closed },
|
|
121
149
|
className
|
|
122
150
|
),
|
|
@@ -168,10 +196,10 @@ var Message = (0, import_react2.forwardRef)(
|
|
|
168
196
|
var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
|
|
169
197
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
170
198
|
Box,
|
|
171
|
-
__spreadProps(__spreadValues({
|
|
199
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, variant === "warning" ? { "data-color-scheme": "light" } : {}), {
|
|
172
200
|
className: (0, import_typed_classname2.clsx)(`hds-message`, `hds-message--${variant}`, className),
|
|
173
201
|
ref
|
|
174
|
-
}, rest), {
|
|
202
|
+
}), rest), {
|
|
175
203
|
children: [
|
|
176
204
|
variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_typed_classname2.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
|
|
177
205
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/message/message.tsx","../../src/box/box.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n />\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Color variant of the box\n *\n * @default \"light-grey\"\n */\n variant?: \"light-grey\" | \"lighter\" | \"white\" | \"warning\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n return (\n <Component\n className={clsx(\n \"hds-box\",\n variant && `hds-box--${variant}`,\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivEl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A,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/message/message.tsx","../../src/box/box.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\n/** @deprecated Use Alert component instead */\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n {...(variant === \"warning\" ? { \"data-color-scheme\": \"light\" } : {})}\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden xmlns=\"http://www.w3.org/2000/svg\" width={32} height={32} viewBox=\"0 0 32 32\">\n <path\n d=\"M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n >\n <CloseIcon />\n </button>\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Posten/Bring-spesific variant of the box. NB: warning variant is deprecated, use data-color=\"warning\" instead.\n *\n * @default \"light-grey\"\n */\n variant?:\n | \"light-grey\"\n | \"lighter\"\n | \"white\"\n /** @deprecated use data-color=\"warning\" instead */\n | \"warning\";\n\n /**\n * Color variant of the box\n *\n */\n\n \"data-color\"?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nconst convertVariantToColor = (variant: BoxProps[\"variant\"] | \"\") => {\n switch (variant) {\n case \"lighter\":\n return \"\";\n case \"white\":\n return \"\";\n case \"warning\":\n return \"warning\";\n default:\n return \"neutral\";\n }\n};\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n \"data-color\": color = \"\",\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n const resolvedColor = color && color !== \"\" ? color : convertVariantToColor(variant);\n\n return (\n <Component\n data-color={resolvedColor}\n className={clsx(\n \"hds-box\",\n { \"hds-box--lighter\": variant === \"lighter\" },\n { \"hds-box--white\": variant === \"white\" },\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivElement, BoxProps>> & {\n CloseButton: typeof BoxCloseButton;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,mBAAkD;AAClD,6BAAqB;AACrB,wBAAgC;AAK1B;AAHN,SAAS,YAAY;AACnB,SACE,4CAAC,SAAI,eAAW,MAAC,OAAM,8BAA6B,OAAO,IAAI,QAAQ,IAAI,SAAQ,aACjF;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,MAAK;AAAA;AAAA,EACP,GACF;AAEJ;AAGO,IAAM,qBAAiB;AAAA,EAC5B,CAAC,IAAwB,QAAQ;AAAhC,iBAAE,YAjBL,IAiBG,IAAgB,iBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MA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AAK,8BAA8B,aAA0B,GAC1E,gBACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime"]}
|
package/dist/message/message.mjs
CHANGED
package/dist/modal/index.js
CHANGED
|
@@ -76,23 +76,47 @@ var import_react = require("react");
|
|
|
76
76
|
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
77
77
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
78
78
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
79
|
+
function CloseIcon() {
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 32 32", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
"path",
|
|
82
|
+
{
|
|
83
|
+
d: "M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z",
|
|
84
|
+
fill: "currentColor"
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
}
|
|
79
88
|
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
80
89
|
(_a, ref) => {
|
|
81
90
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
82
91
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
92
|
"button",
|
|
84
|
-
__spreadValues({
|
|
93
|
+
__spreadProps(__spreadValues({
|
|
85
94
|
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
86
95
|
ref,
|
|
87
96
|
type: "button"
|
|
88
|
-
}, rest)
|
|
97
|
+
}, rest), {
|
|
98
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, {})
|
|
99
|
+
})
|
|
89
100
|
);
|
|
90
101
|
}
|
|
91
102
|
);
|
|
92
103
|
BoxCloseButton.displayName = "Box.CloseButton";
|
|
104
|
+
var convertVariantToColor = (variant) => {
|
|
105
|
+
switch (variant) {
|
|
106
|
+
case "lighter":
|
|
107
|
+
return "";
|
|
108
|
+
case "white":
|
|
109
|
+
return "";
|
|
110
|
+
case "warning":
|
|
111
|
+
return "warning";
|
|
112
|
+
default:
|
|
113
|
+
return "neutral";
|
|
114
|
+
}
|
|
115
|
+
};
|
|
93
116
|
var Box = (0, import_react.forwardRef)(
|
|
94
117
|
(_a, ref) => {
|
|
95
118
|
var _b = _a, {
|
|
119
|
+
"data-color": color = "",
|
|
96
120
|
asChild,
|
|
97
121
|
variant,
|
|
98
122
|
closeable = false,
|
|
@@ -102,6 +126,7 @@ var Box = (0, import_react.forwardRef)(
|
|
|
102
126
|
children,
|
|
103
127
|
className
|
|
104
128
|
} = _b, rest = __objRest(_b, [
|
|
129
|
+
"data-color",
|
|
105
130
|
"asChild",
|
|
106
131
|
"variant",
|
|
107
132
|
"closeable",
|
|
@@ -124,12 +149,15 @@ var Box = (0, import_react.forwardRef)(
|
|
|
124
149
|
}, []);
|
|
125
150
|
const closed = closedProp != null ? closedProp : closedState;
|
|
126
151
|
const Component = asChild ? import_react_slot.Slot : "div";
|
|
152
|
+
const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
|
|
127
153
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
128
154
|
Component,
|
|
129
155
|
__spreadProps(__spreadValues({
|
|
156
|
+
"data-color": resolvedColor,
|
|
130
157
|
className: (0, import_typed_classname.clsx)(
|
|
131
158
|
"hds-box",
|
|
132
|
-
|
|
159
|
+
{ "hds-box--lighter": variant === "lighter" },
|
|
160
|
+
{ "hds-box--white": variant === "white" },
|
|
133
161
|
{ "hds-box--closed": closed },
|
|
134
162
|
className
|
|
135
163
|
),
|