@postenbring/hedwig-react 4.5.1 → 4.6.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.js +82 -33
- package/dist/alert/alert.js.map +1 -1
- package/dist/alert/alert.mjs +3 -2
- package/dist/alert/index.js +82 -33
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +3 -2
- package/dist/box/box.d.ts.map +1 -1
- package/dist/box/box.js +69 -20
- package/dist/box/box.js.map +1 -1
- package/dist/box/box.mjs +2 -1
- package/dist/box/index.js +69 -20
- package/dist/box/index.js.map +1 -1
- package/dist/box/index.mjs +2 -1
- package/dist/{chunk-ILN2L5NX.mjs → chunk-B2DZ6JJ4.mjs} +2 -2
- package/dist/{chunk-INDTHGWZ.mjs → chunk-KAVKFO2R.mjs} +2 -2
- package/dist/{chunk-DEABU7DB.mjs → chunk-P4AKOVM7.mjs} +9 -9
- package/dist/chunk-P4AKOVM7.mjs.map +1 -0
- package/dist/{chunk-NAXSP4VU.mjs → chunk-PKEPSKTZ.mjs} +2 -2
- package/dist/{chunk-YQT2TN3U.mjs → chunk-QQKPLLCE.mjs} +4 -3
- package/dist/chunk-QQKPLLCE.mjs.map +1 -0
- package/dist/{chunk-QDG2QLFV.mjs → chunk-UXZKGAZ2.mjs} +4 -4
- package/dist/{chunk-PZUJLRG4.mjs → chunk-WFIS2ZYQ.mjs} +2 -2
- package/dist/footer/footer.mjs +2 -2
- package/dist/footer/index.mjs +2 -2
- package/dist/form/error-summary/error-summary.js +104 -55
- package/dist/form/error-summary/error-summary.js.map +1 -1
- package/dist/form/error-summary/error-summary.mjs +3 -2
- package/dist/form/error-summary/index.js +104 -55
- package/dist/form/error-summary/index.js.map +1 -1
- package/dist/form/error-summary/index.mjs +3 -2
- package/dist/form/index.js +166 -117
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +16 -15
- package/dist/help-text/help-text.js +79 -30
- package/dist/help-text/help-text.js.map +1 -1
- package/dist/help-text/help-text.mjs +3 -2
- package/dist/help-text/index.js +79 -30
- package/dist/help-text/index.js.map +1 -1
- package/dist/help-text/index.mjs +3 -2
- package/dist/index.js +104 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -42
- package/dist/message/index.js +83 -34
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +3 -2
- package/dist/message/message.js +83 -34
- package/dist/message/message.js.map +1 -1
- package/dist/message/message.mjs +3 -2
- package/dist/modal/index.js +95 -45
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +3 -2
- package/dist/modal/modal.d.ts +5 -0
- package/dist/modal/modal.d.ts.map +1 -1
- package/dist/modal/modal.js +95 -45
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +3 -2
- package/dist/navbar/icons.d.ts +2 -2
- package/dist/navbar/icons.d.ts.map +1 -1
- package/dist/navbar/navbar-expandable-menu.d.ts +1 -1
- package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/box/box.tsx +8 -8
- package/src/modal/modal.tsx +12 -1
- package/dist/chunk-DEABU7DB.mjs.map +0 -1
- package/dist/chunk-YQT2TN3U.mjs.map +0 -1
- /package/dist/{chunk-ILN2L5NX.mjs.map → chunk-B2DZ6JJ4.mjs.map} +0 -0
- /package/dist/{chunk-INDTHGWZ.mjs.map → chunk-KAVKFO2R.mjs.map} +0 -0
- /package/dist/{chunk-NAXSP4VU.mjs.map → chunk-PKEPSKTZ.mjs.map} +0 -0
- /package/dist/{chunk-QDG2QLFV.mjs.map → chunk-UXZKGAZ2.mjs.map} +0 -0
- /package/dist/{chunk-PZUJLRG4.mjs.map → chunk-WFIS2ZYQ.mjs.map} +0 -0
package/dist/alert/alert.js
CHANGED
|
@@ -54,35 +54,84 @@ __export(alert_exports, {
|
|
|
54
54
|
AlertTitle: () => AlertTitle
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(alert_exports);
|
|
57
|
+
var import_react3 = require("react");
|
|
58
|
+
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname");
|
|
59
|
+
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
60
|
+
|
|
61
|
+
// src/box/box.tsx
|
|
57
62
|
var import_react2 = require("react");
|
|
58
63
|
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
|
|
59
64
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
60
65
|
|
|
61
|
-
// src/
|
|
66
|
+
// src/button/button.tsx
|
|
62
67
|
var import_react = require("react");
|
|
63
68
|
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
64
69
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
65
70
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
71
|
+
var Button = (0, import_react.forwardRef)(
|
|
72
|
+
(_a, ref) => {
|
|
73
|
+
var _b = _a, {
|
|
74
|
+
asChild,
|
|
75
|
+
children,
|
|
76
|
+
variant = "primary",
|
|
77
|
+
size = "large",
|
|
78
|
+
fullWidth = false,
|
|
79
|
+
icon = false,
|
|
80
|
+
className
|
|
81
|
+
} = _b, rest = __objRest(_b, [
|
|
82
|
+
"asChild",
|
|
83
|
+
"children",
|
|
84
|
+
"variant",
|
|
85
|
+
"size",
|
|
86
|
+
"fullWidth",
|
|
87
|
+
"icon",
|
|
88
|
+
"className"
|
|
89
|
+
]);
|
|
90
|
+
const Component = asChild ? import_react_slot.Slot : "button";
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
Component,
|
|
93
|
+
__spreadProps(__spreadValues({
|
|
94
|
+
className: (0, import_typed_classname.clsx)(
|
|
95
|
+
"hds-button",
|
|
96
|
+
`hds-button--${size}`,
|
|
97
|
+
`hds-button--${variant}`,
|
|
98
|
+
{
|
|
99
|
+
"hds-button--full": fullWidth === true,
|
|
100
|
+
"hds-button--mobile-full": fullWidth === "mobile",
|
|
101
|
+
"hds-button--only-icon": icon === true,
|
|
102
|
+
"hds-button--leading-icon": icon === "leading",
|
|
103
|
+
"hds-button--trailing-icon": icon === "trailing"
|
|
104
|
+
},
|
|
105
|
+
className
|
|
106
|
+
),
|
|
107
|
+
ref
|
|
108
|
+
}, rest), {
|
|
109
|
+
children
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
Button.displayName = "Button";
|
|
115
|
+
|
|
116
|
+
// src/box/box.tsx
|
|
117
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
66
118
|
function CloseIcon() {
|
|
67
|
-
return /* @__PURE__ */ (0,
|
|
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
|
-
) });
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" }) });
|
|
74
120
|
}
|
|
75
|
-
var BoxCloseButton = (0,
|
|
121
|
+
var BoxCloseButton = (0, import_react2.forwardRef)(
|
|
76
122
|
(_a, ref) => {
|
|
77
123
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
78
|
-
return /* @__PURE__ */ (0,
|
|
79
|
-
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
125
|
+
Button,
|
|
80
126
|
__spreadProps(__spreadValues({
|
|
81
|
-
className: (0,
|
|
127
|
+
className: (0, import_typed_classname2.clsx)("hds-box__close-button", className),
|
|
128
|
+
variant: "tertiary",
|
|
129
|
+
size: "small",
|
|
130
|
+
icon: true,
|
|
82
131
|
ref,
|
|
83
132
|
type: "button"
|
|
84
133
|
}, rest), {
|
|
85
|
-
children: /* @__PURE__ */ (0,
|
|
134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {})
|
|
86
135
|
})
|
|
87
136
|
);
|
|
88
137
|
}
|
|
@@ -100,7 +149,7 @@ var convertVariantToColor = (variant) => {
|
|
|
100
149
|
return "neutral";
|
|
101
150
|
}
|
|
102
151
|
};
|
|
103
|
-
var Box = (0,
|
|
152
|
+
var Box = (0, import_react2.forwardRef)(
|
|
104
153
|
(_a, ref) => {
|
|
105
154
|
var _b = _a, {
|
|
106
155
|
"data-color": color = "",
|
|
@@ -123,8 +172,8 @@ var Box = (0, import_react.forwardRef)(
|
|
|
123
172
|
"children",
|
|
124
173
|
"className"
|
|
125
174
|
]);
|
|
126
|
-
const [closedState, setClosedState] = (0,
|
|
127
|
-
const onClose = (0,
|
|
175
|
+
const [closedState, setClosedState] = (0, import_react2.useState)(false);
|
|
176
|
+
const onClose = (0, import_react2.useCallback)(() => {
|
|
128
177
|
if (onCloseProp) {
|
|
129
178
|
const result = onCloseProp();
|
|
130
179
|
if (result === true) {
|
|
@@ -135,13 +184,13 @@ var Box = (0, import_react.forwardRef)(
|
|
|
135
184
|
}
|
|
136
185
|
}, []);
|
|
137
186
|
const closed = closedProp != null ? closedProp : closedState;
|
|
138
|
-
const Component = asChild ?
|
|
187
|
+
const Component = asChild ? import_react_slot2.Slot : "div";
|
|
139
188
|
const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
|
|
140
|
-
return /* @__PURE__ */ (0,
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
141
190
|
Component,
|
|
142
191
|
__spreadProps(__spreadValues({
|
|
143
192
|
"data-color": resolvedColor,
|
|
144
|
-
className: (0,
|
|
193
|
+
className: (0, import_typed_classname2.clsx)(
|
|
145
194
|
"hds-box",
|
|
146
195
|
{ "hds-box--lighter": variant === "lighter" },
|
|
147
196
|
{ "hds-box--white": variant === "white" },
|
|
@@ -151,8 +200,8 @@ var Box = (0, import_react.forwardRef)(
|
|
|
151
200
|
ref
|
|
152
201
|
}, rest), {
|
|
153
202
|
children: [
|
|
154
|
-
closeable ? /* @__PURE__ */ (0,
|
|
155
|
-
/* @__PURE__ */ (0,
|
|
203
|
+
closeable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_slot2.Slottable, { children })
|
|
156
205
|
]
|
|
157
206
|
})
|
|
158
207
|
);
|
|
@@ -162,23 +211,23 @@ Box.displayName = "Box";
|
|
|
162
211
|
Box.CloseButton = BoxCloseButton;
|
|
163
212
|
|
|
164
213
|
// src/alert/alert.tsx
|
|
165
|
-
var
|
|
166
|
-
var AlertTitle = (0,
|
|
214
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
215
|
+
var AlertTitle = (0, import_react3.forwardRef)(
|
|
167
216
|
(_a, ref) => {
|
|
168
217
|
var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
|
|
169
|
-
const Component = asChild ?
|
|
170
|
-
return /* @__PURE__ */ (0,
|
|
218
|
+
const Component = asChild ? import_react_slot3.Slot : "div";
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, __spreadValues({ className: (0, import_typed_classname3.clsx)("hds-alert__title", className), ref }, rest));
|
|
171
220
|
}
|
|
172
221
|
);
|
|
173
222
|
AlertTitle.displayName = "Alert.Title";
|
|
174
|
-
var AlertDescription = (0,
|
|
223
|
+
var AlertDescription = (0, import_react3.forwardRef)(
|
|
175
224
|
(_a, ref) => {
|
|
176
225
|
var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
|
|
177
|
-
const Component = asChild ?
|
|
178
|
-
return /* @__PURE__ */ (0,
|
|
226
|
+
const Component = asChild ? import_react_slot3.Slot : "div";
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
179
228
|
Component,
|
|
180
229
|
__spreadValues({
|
|
181
|
-
className: (0,
|
|
230
|
+
className: (0, import_typed_classname3.clsx)("hds-alert__description", className),
|
|
182
231
|
ref
|
|
183
232
|
}, rest)
|
|
184
233
|
);
|
|
@@ -189,21 +238,21 @@ var allowedColors = ["neutral", "info", "success", "warning", "error", void 0];
|
|
|
189
238
|
function isValidDataColor(value) {
|
|
190
239
|
return allowedColors.includes(value);
|
|
191
240
|
}
|
|
192
|
-
var Alert = (0,
|
|
241
|
+
var Alert = (0, import_react3.forwardRef)(
|
|
193
242
|
(_a, ref) => {
|
|
194
243
|
var _b = _a, { children, className, "data-color": color = void 0, icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "data-color", "icon", "iconClassName"]);
|
|
195
244
|
const _a2 = rest, { variant } = _a2, boxProps = __objRest(_a2, ["variant"]);
|
|
196
245
|
const resolvedColor = color != null ? color : variant;
|
|
197
246
|
const validColor = isValidDataColor(resolvedColor) ? resolvedColor : void 0;
|
|
198
|
-
return /* @__PURE__ */ (0,
|
|
247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
199
248
|
Box,
|
|
200
249
|
__spreadProps(__spreadValues({
|
|
201
250
|
"data-color": validColor,
|
|
202
|
-
className: (0,
|
|
251
|
+
className: (0, import_typed_classname3.clsx)(`hds-alert`, className),
|
|
203
252
|
ref
|
|
204
253
|
}, boxProps), {
|
|
205
254
|
children: [
|
|
206
|
-
validColor === "neutral" && /* @__PURE__ */ (0,
|
|
255
|
+
validColor === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_typed_classname3.clsx)("hds-alert--neutral__icon", iconClassName), children: icon }),
|
|
207
256
|
children
|
|
208
257
|
]
|
|
209
258
|
})
|
package/dist/alert/alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/alert/alert.tsx","../../src/box/box.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } 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 AlertTitleProps extends 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 AlertTitle = forwardRef<HTMLParagraphElement, AlertTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(\"hds-alert__title\", className as undefined)} ref={ref} {...rest} />\n );\n },\n);\nAlertTitle.displayName = \"Alert.Title\";\n\nexport interface AlertDescriptionProps extends 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 AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-alert__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nAlertDescription.displayName = \"Alert.Description\";\n\nexport type AlertProps = (\n | {\n /**\n * @deprecated use data-color instead\n */\n variant?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n /**\n * @deprecated use data-color instead\n */\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n | {\n \"data-color\"?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n \"data-color\": \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nconst allowedColors = [\"neutral\", \"info\", \"success\", \"warning\", \"error\", undefined] as const;\ntype DataColor = (typeof allowedColors)[number];\n\nfunction isValidDataColor(value: string | undefined): value is DataColor {\n return allowedColors.includes(value as DataColor);\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({ children, className, \"data-color\": color = undefined, icon, iconClassName, ...rest }, ref) => {\n const { variant, ...boxProps } = rest as { variant?: string };\n\n // Support deprecated 'variant' prop for backward compatibility\n const resolvedColor = color ?? variant;\n const validColor: DataColor | undefined = isValidDataColor(resolvedColor)\n ? resolvedColor\n : undefined;\n\n return (\n <Box\n data-color={validColor}\n className={clsx(`hds-alert`, className as undefined)}\n ref={ref}\n {...boxProps}\n >\n {validColor === \"neutral\" && (\n <div className={clsx(\"hds-alert--neutral__icon\", iconClassName as undefined)}>{icon}</div>\n )}\n {children}\n </Box>\n );\n },\n) as AlertType;\nAlert.displayName = \"Alert\";\n\ntype AlertType = ReturnType<typeof forwardRef<HTMLDivElement, AlertProps>> & {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n};\nAlert.Title = AlertTitle;\nAlert.Description = AlertDescription;\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,gBAAuD;AACvD,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,CAAC,YAAsC;AACnE,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;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","import_typed_classname","import_react_slot","import_jsx_runtime","_a"]}
|
|
1
|
+
{"version":3,"sources":["../../src/alert/alert.tsx","../../src/box/box.tsx","../../src/button/button.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } 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 AlertTitleProps extends 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 AlertTitle = forwardRef<HTMLParagraphElement, AlertTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(\"hds-alert__title\", className as undefined)} ref={ref} {...rest} />\n );\n },\n);\nAlertTitle.displayName = \"Alert.Title\";\n\nexport interface AlertDescriptionProps extends 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 AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-alert__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nAlertDescription.displayName = \"Alert.Description\";\n\nexport type AlertProps = (\n | {\n /**\n * @deprecated use data-color instead\n */\n variant?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n /**\n * @deprecated use data-color instead\n */\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n | {\n \"data-color\"?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n \"data-color\": \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nconst allowedColors = [\"neutral\", \"info\", \"success\", \"warning\", \"error\", undefined] as const;\ntype DataColor = (typeof allowedColors)[number];\n\nfunction isValidDataColor(value: string | undefined): value is DataColor {\n return allowedColors.includes(value as DataColor);\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({ children, className, \"data-color\": color = undefined, icon, iconClassName, ...rest }, ref) => {\n const { variant, ...boxProps } = rest as { variant?: string };\n\n // Support deprecated 'variant' prop for backward compatibility\n const resolvedColor = color ?? variant;\n const validColor: DataColor | undefined = isValidDataColor(resolvedColor)\n ? resolvedColor\n : undefined;\n\n return (\n <Box\n data-color={validColor}\n className={clsx(`hds-alert`, className as undefined)}\n ref={ref}\n {...boxProps}\n >\n {validColor === \"neutral\" && (\n <div className={clsx(\"hds-alert--neutral__icon\", iconClassName as undefined)}>{icon}</div>\n )}\n {children}\n </Box>\n );\n },\n) as AlertType;\nAlert.displayName = \"Alert\";\n\ntype AlertType = ReturnType<typeof forwardRef<HTMLDivElement, AlertProps>> & {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n};\nAlert.Title = AlertTitle;\nAlert.Description = AlertDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { Button } from \"../button/button\";\n\nfunction CloseIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\">\n <path d=\"M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z\" />\n </svg>\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 variant=\"tertiary\"\n size=\"small\"\n icon\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","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/**\n * @deprecated The \"inverted\" variant is deprecated. Use \"primary\", \"secondary\", or \"tertiary\" instead.\n */\nexport type DeprecatedVariant = \"inverted\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n *\n * @default \"large\"\n */\n size?: \"small\" | \"large\";\n\n /**\n * The background and fill of the button\n *\n * @default \"primary\"\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\" | DeprecatedVariant;\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 * Specify that there is an icon in the button.\n * `icon`: There is only an icon in the button.\n * `icon=\"leading\"`: There is an icon before the text.\n * `icon=\"trailing\"`: There is an icon after the text.\n *\n * @default false\n */\n icon?: boolean | \"leading\" | \"trailing\";\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\n/**\n * Button component\n *\n * @example\n * <Button variant=\"primary\">Primary</Button>\n * <Button variant=\"secondary\" size=\"large\">Secondary</Button>\n * <Button variant=\"tertiary\" fullWidth=\"mobile\">Tertiary</Button>\n * <Button icon=\"leading\"><LeadingIcon />Leading icon</Button>\n *\n * @example\n * // If used for navigation use the `asChild` prop with a anchor element as a child.\n * <Button asChild><a href=\"/home\">Home</a></Button>\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n asChild,\n children,\n variant = \"primary\",\n size = \"large\",\n fullWidth = false,\n icon = false,\n className,\n ...rest\n },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n `hds-button--${variant}`,\n {\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--only-icon\": icon === true,\n \"hds-button--leading-icon\": icon === \"leading\",\n \"hds-button--trailing-icon\": icon === \"trailing\",\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAAuD;AACvD,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,I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sB;AAAA,QACnD;AAAA,SACI,WAJL;AAAA,QAME;AAAA,yBAAe,aACd,6CAAC,SAAI,eAAW,8BAAK,4BAA4B,aAA0B,GAAI,gBAAK;AAAA,UAErF;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAMpB,MAAM,QAAQ;AACd,MAAM,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_react","import_typed_classname","import_react_slot","import_jsx_runtime","import_jsx_runtime","_a"]}
|
package/dist/alert/alert.mjs
CHANGED
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
Alert,
|
|
3
3
|
AlertDescription,
|
|
4
4
|
AlertTitle
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-WFIS2ZYQ.mjs";
|
|
6
|
+
import "../chunk-P4AKOVM7.mjs";
|
|
7
|
+
import "../chunk-45Q2TCH6.mjs";
|
|
7
8
|
import "../chunk-YOSPWY5K.mjs";
|
|
8
9
|
export {
|
|
9
10
|
Alert,
|
package/dist/alert/index.js
CHANGED
|
@@ -56,35 +56,84 @@ __export(alert_exports, {
|
|
|
56
56
|
module.exports = __toCommonJS(alert_exports);
|
|
57
57
|
|
|
58
58
|
// src/alert/alert.tsx
|
|
59
|
+
var import_react3 = require("react");
|
|
60
|
+
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname");
|
|
61
|
+
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
62
|
+
|
|
63
|
+
// src/box/box.tsx
|
|
59
64
|
var import_react2 = require("react");
|
|
60
65
|
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
|
|
61
66
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
62
67
|
|
|
63
|
-
// src/
|
|
68
|
+
// src/button/button.tsx
|
|
64
69
|
var import_react = require("react");
|
|
65
70
|
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
66
71
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
67
72
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
73
|
+
var Button = (0, import_react.forwardRef)(
|
|
74
|
+
(_a, ref) => {
|
|
75
|
+
var _b = _a, {
|
|
76
|
+
asChild,
|
|
77
|
+
children,
|
|
78
|
+
variant = "primary",
|
|
79
|
+
size = "large",
|
|
80
|
+
fullWidth = false,
|
|
81
|
+
icon = false,
|
|
82
|
+
className
|
|
83
|
+
} = _b, rest = __objRest(_b, [
|
|
84
|
+
"asChild",
|
|
85
|
+
"children",
|
|
86
|
+
"variant",
|
|
87
|
+
"size",
|
|
88
|
+
"fullWidth",
|
|
89
|
+
"icon",
|
|
90
|
+
"className"
|
|
91
|
+
]);
|
|
92
|
+
const Component = asChild ? import_react_slot.Slot : "button";
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
Component,
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
className: (0, import_typed_classname.clsx)(
|
|
97
|
+
"hds-button",
|
|
98
|
+
`hds-button--${size}`,
|
|
99
|
+
`hds-button--${variant}`,
|
|
100
|
+
{
|
|
101
|
+
"hds-button--full": fullWidth === true,
|
|
102
|
+
"hds-button--mobile-full": fullWidth === "mobile",
|
|
103
|
+
"hds-button--only-icon": icon === true,
|
|
104
|
+
"hds-button--leading-icon": icon === "leading",
|
|
105
|
+
"hds-button--trailing-icon": icon === "trailing"
|
|
106
|
+
},
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
ref
|
|
110
|
+
}, rest), {
|
|
111
|
+
children
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
Button.displayName = "Button";
|
|
117
|
+
|
|
118
|
+
// src/box/box.tsx
|
|
119
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
68
120
|
function CloseIcon() {
|
|
69
|
-
return /* @__PURE__ */ (0,
|
|
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
|
-
) });
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" }) });
|
|
76
122
|
}
|
|
77
|
-
var BoxCloseButton = (0,
|
|
123
|
+
var BoxCloseButton = (0, import_react2.forwardRef)(
|
|
78
124
|
(_a, ref) => {
|
|
79
125
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
80
|
-
return /* @__PURE__ */ (0,
|
|
81
|
-
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
127
|
+
Button,
|
|
82
128
|
__spreadProps(__spreadValues({
|
|
83
|
-
className: (0,
|
|
129
|
+
className: (0, import_typed_classname2.clsx)("hds-box__close-button", className),
|
|
130
|
+
variant: "tertiary",
|
|
131
|
+
size: "small",
|
|
132
|
+
icon: true,
|
|
84
133
|
ref,
|
|
85
134
|
type: "button"
|
|
86
135
|
}, rest), {
|
|
87
|
-
children: /* @__PURE__ */ (0,
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {})
|
|
88
137
|
})
|
|
89
138
|
);
|
|
90
139
|
}
|
|
@@ -102,7 +151,7 @@ var convertVariantToColor = (variant) => {
|
|
|
102
151
|
return "neutral";
|
|
103
152
|
}
|
|
104
153
|
};
|
|
105
|
-
var Box = (0,
|
|
154
|
+
var Box = (0, import_react2.forwardRef)(
|
|
106
155
|
(_a, ref) => {
|
|
107
156
|
var _b = _a, {
|
|
108
157
|
"data-color": color = "",
|
|
@@ -125,8 +174,8 @@ var Box = (0, import_react.forwardRef)(
|
|
|
125
174
|
"children",
|
|
126
175
|
"className"
|
|
127
176
|
]);
|
|
128
|
-
const [closedState, setClosedState] = (0,
|
|
129
|
-
const onClose = (0,
|
|
177
|
+
const [closedState, setClosedState] = (0, import_react2.useState)(false);
|
|
178
|
+
const onClose = (0, import_react2.useCallback)(() => {
|
|
130
179
|
if (onCloseProp) {
|
|
131
180
|
const result = onCloseProp();
|
|
132
181
|
if (result === true) {
|
|
@@ -137,13 +186,13 @@ var Box = (0, import_react.forwardRef)(
|
|
|
137
186
|
}
|
|
138
187
|
}, []);
|
|
139
188
|
const closed = closedProp != null ? closedProp : closedState;
|
|
140
|
-
const Component = asChild ?
|
|
189
|
+
const Component = asChild ? import_react_slot2.Slot : "div";
|
|
141
190
|
const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
|
|
142
|
-
return /* @__PURE__ */ (0,
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
143
192
|
Component,
|
|
144
193
|
__spreadProps(__spreadValues({
|
|
145
194
|
"data-color": resolvedColor,
|
|
146
|
-
className: (0,
|
|
195
|
+
className: (0, import_typed_classname2.clsx)(
|
|
147
196
|
"hds-box",
|
|
148
197
|
{ "hds-box--lighter": variant === "lighter" },
|
|
149
198
|
{ "hds-box--white": variant === "white" },
|
|
@@ -153,8 +202,8 @@ var Box = (0, import_react.forwardRef)(
|
|
|
153
202
|
ref
|
|
154
203
|
}, rest), {
|
|
155
204
|
children: [
|
|
156
|
-
closeable ? /* @__PURE__ */ (0,
|
|
157
|
-
/* @__PURE__ */ (0,
|
|
205
|
+
closeable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_slot2.Slottable, { children })
|
|
158
207
|
]
|
|
159
208
|
})
|
|
160
209
|
);
|
|
@@ -164,23 +213,23 @@ Box.displayName = "Box";
|
|
|
164
213
|
Box.CloseButton = BoxCloseButton;
|
|
165
214
|
|
|
166
215
|
// src/alert/alert.tsx
|
|
167
|
-
var
|
|
168
|
-
var AlertTitle = (0,
|
|
216
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
217
|
+
var AlertTitle = (0, import_react3.forwardRef)(
|
|
169
218
|
(_a, ref) => {
|
|
170
219
|
var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
|
|
171
|
-
const Component = asChild ?
|
|
172
|
-
return /* @__PURE__ */ (0,
|
|
220
|
+
const Component = asChild ? import_react_slot3.Slot : "div";
|
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, __spreadValues({ className: (0, import_typed_classname3.clsx)("hds-alert__title", className), ref }, rest));
|
|
173
222
|
}
|
|
174
223
|
);
|
|
175
224
|
AlertTitle.displayName = "Alert.Title";
|
|
176
|
-
var AlertDescription = (0,
|
|
225
|
+
var AlertDescription = (0, import_react3.forwardRef)(
|
|
177
226
|
(_a, ref) => {
|
|
178
227
|
var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
|
|
179
|
-
const Component = asChild ?
|
|
180
|
-
return /* @__PURE__ */ (0,
|
|
228
|
+
const Component = asChild ? import_react_slot3.Slot : "div";
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
181
230
|
Component,
|
|
182
231
|
__spreadValues({
|
|
183
|
-
className: (0,
|
|
232
|
+
className: (0, import_typed_classname3.clsx)("hds-alert__description", className),
|
|
184
233
|
ref
|
|
185
234
|
}, rest)
|
|
186
235
|
);
|
|
@@ -191,21 +240,21 @@ var allowedColors = ["neutral", "info", "success", "warning", "error", void 0];
|
|
|
191
240
|
function isValidDataColor(value) {
|
|
192
241
|
return allowedColors.includes(value);
|
|
193
242
|
}
|
|
194
|
-
var Alert = (0,
|
|
243
|
+
var Alert = (0, import_react3.forwardRef)(
|
|
195
244
|
(_a, ref) => {
|
|
196
245
|
var _b = _a, { children, className, "data-color": color = void 0, icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "data-color", "icon", "iconClassName"]);
|
|
197
246
|
const _a2 = rest, { variant } = _a2, boxProps = __objRest(_a2, ["variant"]);
|
|
198
247
|
const resolvedColor = color != null ? color : variant;
|
|
199
248
|
const validColor = isValidDataColor(resolvedColor) ? resolvedColor : void 0;
|
|
200
|
-
return /* @__PURE__ */ (0,
|
|
249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
201
250
|
Box,
|
|
202
251
|
__spreadProps(__spreadValues({
|
|
203
252
|
"data-color": validColor,
|
|
204
|
-
className: (0,
|
|
253
|
+
className: (0, import_typed_classname3.clsx)(`hds-alert`, className),
|
|
205
254
|
ref
|
|
206
255
|
}, boxProps), {
|
|
207
256
|
children: [
|
|
208
|
-
validColor === "neutral" && /* @__PURE__ */ (0,
|
|
257
|
+
validColor === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_typed_classname3.clsx)("hds-alert--neutral__icon", iconClassName), children: icon }),
|
|
209
258
|
children
|
|
210
259
|
]
|
|
211
260
|
})
|
package/dist/alert/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/alert/index.tsx","../../src/alert/alert.tsx","../../src/box/box.tsx"],"sourcesContent":["export { Alert, AlertTitle, AlertDescription } from \"./alert\";\nexport type * from \"./alert\";\n","import React, { forwardRef, type HTMLAttributes } 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 AlertTitleProps extends 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 AlertTitle = forwardRef<HTMLParagraphElement, AlertTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(\"hds-alert__title\", className as undefined)} ref={ref} {...rest} />\n );\n },\n);\nAlertTitle.displayName = \"Alert.Title\";\n\nexport interface AlertDescriptionProps extends 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 AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-alert__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nAlertDescription.displayName = \"Alert.Description\";\n\nexport type AlertProps = (\n | {\n /**\n * @deprecated use data-color instead\n */\n variant?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n /**\n * @deprecated use data-color instead\n */\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n | {\n \"data-color\"?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n \"data-color\": \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nconst allowedColors = [\"neutral\", \"info\", \"success\", \"warning\", \"error\", undefined] as const;\ntype DataColor = (typeof allowedColors)[number];\n\nfunction isValidDataColor(value: string | undefined): value is DataColor {\n return allowedColors.includes(value as DataColor);\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({ children, className, \"data-color\": color = undefined, icon, iconClassName, ...rest }, ref) => {\n const { variant, ...boxProps } = rest as { variant?: string };\n\n // Support deprecated 'variant' prop for backward compatibility\n const resolvedColor = color ?? variant;\n const validColor: DataColor | undefined = isValidDataColor(resolvedColor)\n ? resolvedColor\n : undefined;\n\n return (\n <Box\n data-color={validColor}\n className={clsx(`hds-alert`, className as undefined)}\n ref={ref}\n {...boxProps}\n >\n {validColor === \"neutral\" && (\n <div className={clsx(\"hds-alert--neutral__icon\", iconClassName as undefined)}>{icon}</div>\n )}\n {children}\n </Box>\n );\n },\n) as AlertType;\nAlert.displayName = \"Alert\";\n\ntype AlertType = ReturnType<typeof forwardRef<HTMLDivElement, AlertProps>> & {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n};\nAlert.Title = AlertTitle;\nAlert.Description = AlertDescription;\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":";;;;;;;;;;;;;;;;;;;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AW,8BAAK,0BAA0B,SAAsB;AAAA,QAChE;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,iBAAiB,cAAc;AAgC/B,IAAM,gBAAgB,CAAC,WAAW,QAAQ,WAAW,WAAW,SAAS,MAAS;AAGlF,SAAS,iBAAiB,OAA+C;AACvE,SAAO,cAAc,SAAS,KAAkB;AAClD;AAEO,IAAM,YAAQ;AAAA,EACnB,CAAC,IAAwF,QAAQ;AAAhG,iBAAE,YAAU,WAAW,cAAc,QAAQ,QAAW,MAAM,cAnFjE,IAmFG,IAAgF,iBAAhF,IAAgF,CAA9E,YAAU,aAAW,cAAiC,QAAM;AAC7D,UAAiCC,MAAA,MAAzB,UApFZ,IAoFqCA,KAAb,qBAAaA,KAAb,CAAZ;AAGR,UAAM,gBAAgB,wBAAS;AAC/B,UAAM,aAAoC,iBAAiB,aAAa,IACpE,gBACA;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ,eAAW,8BAAK,aAAa,SAAsB;AAAA,QACnD;AAAA,SACI,WAJL;AAAA,QAME;AAAA,yBAAe,aACd,6CAAC,SAAI,eAAW,8BAAK,4BAA4B,aAA0B,GAAI,gBAAK;AAAA,UAErF;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAMpB,MAAM,QAAQ;AACd,MAAM,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime","_a"]}
|
|
1
|
+
{"version":3,"sources":["../../src/alert/index.tsx","../../src/alert/alert.tsx","../../src/box/box.tsx","../../src/button/button.tsx"],"sourcesContent":["export { Alert, AlertTitle, AlertDescription } from \"./alert\";\nexport type * from \"./alert\";\n","import React, { forwardRef, type HTMLAttributes } 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 AlertTitleProps extends 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 AlertTitle = forwardRef<HTMLParagraphElement, AlertTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component className={clsx(\"hds-alert__title\", className as undefined)} ref={ref} {...rest} />\n );\n },\n);\nAlertTitle.displayName = \"Alert.Title\";\n\nexport interface AlertDescriptionProps extends 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 AlertDescription = forwardRef<HTMLParagraphElement, AlertDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-alert__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nAlertDescription.displayName = \"Alert.Description\";\n\nexport type AlertProps = (\n | {\n /**\n * @deprecated use data-color instead\n */\n variant?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n /**\n * @deprecated use data-color instead\n */\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n | {\n \"data-color\"?: \"info\" | \"success\" | \"warning\" | \"error\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n \"data-color\": \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\nconst allowedColors = [\"neutral\", \"info\", \"success\", \"warning\", \"error\", undefined] as const;\ntype DataColor = (typeof allowedColors)[number];\n\nfunction isValidDataColor(value: string | undefined): value is DataColor {\n return allowedColors.includes(value as DataColor);\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n ({ children, className, \"data-color\": color = undefined, icon, iconClassName, ...rest }, ref) => {\n const { variant, ...boxProps } = rest as { variant?: string };\n\n // Support deprecated 'variant' prop for backward compatibility\n const resolvedColor = color ?? variant;\n const validColor: DataColor | undefined = isValidDataColor(resolvedColor)\n ? resolvedColor\n : undefined;\n\n return (\n <Box\n data-color={validColor}\n className={clsx(`hds-alert`, className as undefined)}\n ref={ref}\n {...boxProps}\n >\n {validColor === \"neutral\" && (\n <div className={clsx(\"hds-alert--neutral__icon\", iconClassName as undefined)}>{icon}</div>\n )}\n {children}\n </Box>\n );\n },\n) as AlertType;\nAlert.displayName = \"Alert\";\n\ntype AlertType = ReturnType<typeof forwardRef<HTMLDivElement, AlertProps>> & {\n Title: typeof AlertTitle;\n Description: typeof AlertDescription;\n};\nAlert.Title = AlertTitle;\nAlert.Description = AlertDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { Button } from \"../button/button\";\n\nfunction CloseIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\">\n <path d=\"M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z\" />\n </svg>\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 variant=\"tertiary\"\n size=\"small\"\n icon\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","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/**\n * @deprecated The \"inverted\" variant is deprecated. Use \"primary\", \"secondary\", or \"tertiary\" instead.\n */\nexport type DeprecatedVariant = \"inverted\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n *\n * @default \"large\"\n */\n size?: \"small\" | \"large\";\n\n /**\n * The background and fill of the button\n *\n * @default \"primary\"\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\" | DeprecatedVariant;\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 * Specify that there is an icon in the button.\n * `icon`: There is only an icon in the button.\n * `icon=\"leading\"`: There is an icon before the text.\n * `icon=\"trailing\"`: There is an icon after the text.\n *\n * @default false\n */\n icon?: boolean | \"leading\" | \"trailing\";\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\n/**\n * Button component\n *\n * @example\n * <Button variant=\"primary\">Primary</Button>\n * <Button variant=\"secondary\" size=\"large\">Secondary</Button>\n * <Button variant=\"tertiary\" fullWidth=\"mobile\">Tertiary</Button>\n * <Button icon=\"leading\"><LeadingIcon />Leading icon</Button>\n *\n * @example\n * // If used for navigation use the `asChild` prop with a anchor element as a child.\n * <Button asChild><a href=\"/home\">Home</a></Button>\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n asChild,\n children,\n variant = \"primary\",\n size = \"large\",\n fullWidth = false,\n icon = false,\n className,\n ...rest\n },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n `hds-button--${variant}`,\n {\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--only-icon\": icon === true,\n \"hds-button--leading-icon\": icon === \"leading\",\n \"hds-button--trailing-icon\": icon === \"trailing\",\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAuD;AACvD,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,IAAAC,gBAAkD;AAClD,IAAAC,0BAAqB;AACrB,IAAAC,qBAAgC;;;ACFhC,mBAA2B;AAC3B,6BAAqB;AACrB,wBAAqB;AA4Ef;AAjBC,IAAM,aAAS;AAAA,EACpB,CACE,IAUA,QACG;AAXH,iBACE;AAAA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,IAtEN,IA+DI,IAQ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ACnC,WACE,6CAAC,4BAAU,eAAW,8BAAK,oBAAoB,SAAsB,GAAG,OAAc,KAAM;AAAA,EAEhG;AACF;AACA,WAAW,cAAc;AAUlB,IAAM,uBAAmB;AAAA,EAC9B,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UAhCd,IAgCG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,0BAA0B,SAAsB;AAAA,QAChE;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,iBAAiB,cAAc;AAgC/B,IAAM,gBAAgB,CAAC,WAAW,QAAQ,WAAW,WAAW,SAAS,MAAS;AAGlF,SAAS,iBAAiB,OAA+C;AACvE,SAAO,cAAc,SAAS,KAAkB;AAClD;AAEO,IAAM,YAAQ;AAAA,EACnB,CAAC,IAAwF,QAAQ;AAAhG,iBAAE,YAAU,WAAW,cAAc,QAAQ,QAAW,MAAM,cAnFjE,IAmFG,IAAgF,iBAAhF,IAAgF,CAA9E,YAAU,aAAW,cAAiC,QAAM;AAC7D,UAAiCC,MAAA,MAAzB,UApFZ,IAoFqCA,KAAb,qBAAaA,KAAb,CAAZ;AAGR,UAAM,gBAAgB,wBAAS;AAC/B,UAAM,aAAoC,iBAAiB,aAAa,IACpE,gBACA;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ,eAAW,8BAAK,aAAa,SAAsB;AAAA,QACnD;AAAA,SACI,WAJL;AAAA,QAME;AAAA,yBAAe,aACd,6CAAC,SAAI,eAAW,8BAAK,4BAA4B,aAA0B,GAAI,gBAAK;AAAA,UAErF;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAMpB,MAAM,QAAQ;AACd,MAAM,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_react","import_typed_classname","import_react_slot","import_jsx_runtime","import_jsx_runtime","_a"]}
|
package/dist/alert/index.mjs
CHANGED
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
Alert,
|
|
4
4
|
AlertDescription,
|
|
5
5
|
AlertTitle
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-WFIS2ZYQ.mjs";
|
|
7
|
+
import "../chunk-P4AKOVM7.mjs";
|
|
8
|
+
import "../chunk-45Q2TCH6.mjs";
|
|
8
9
|
import "../chunk-YOSPWY5K.mjs";
|
|
9
10
|
export {
|
|
10
11
|
Alert,
|
package/dist/box/box.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,OAAO,CAAC;AAY1D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;AAC5F,eAAO,MAAM,cAAc,mHAgB1B,CAAC;AAGF,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,EACJ,YAAY,GACZ,SAAS,GACT,OAAO;IACT,mDAAmD;OACjD,SAAS,CAAC;IAEd;;;OAGG;IAEH,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAEpE;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;;OASG;IAEH,OAAO,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IAEvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAeD,eAAO,MAAM,GAAG,EAmDX,OAAO,CAAC;AAKb,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,GAAG;IACvE,WAAW,EAAE,OAAO,cAAc,CAAC;CACpC,CAAC"}
|