@postenbring/hedwig-react 0.0.3 → 0.0.5
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/accordion/accordion-item-content.d.mts +9 -0
- package/dist/accordion/accordion-item-content.d.ts +9 -0
- package/dist/accordion/accordion-item-content.js +98 -0
- package/dist/accordion/accordion-item-content.mjs +8 -0
- package/dist/accordion/accordion-item-trigger.d.mts +9 -0
- package/dist/accordion/accordion-item-trigger.d.ts +9 -0
- package/dist/accordion/accordion-item-trigger.js +108 -0
- package/dist/accordion/accordion-item-trigger.mjs +8 -0
- package/dist/accordion/accordion-item.d.mts +15 -0
- package/dist/accordion/accordion-item.d.ts +15 -0
- package/dist/accordion/accordion-item.js +116 -0
- package/dist/accordion/accordion-item.mjs +8 -0
- package/dist/accordion/accordion.d.mts +28 -0
- package/dist/accordion/accordion.d.ts +28 -0
- package/dist/accordion/accordion.js +93 -0
- package/dist/accordion/accordion.mjs +8 -0
- package/dist/accordion/index.d.mts +6 -0
- package/dist/accordion/index.d.ts +6 -0
- package/dist/accordion/index.js +217 -0
- package/dist/accordion/index.mjs +21 -0
- package/dist/badge/badge.d.mts +28 -0
- package/dist/badge/badge.d.ts +28 -0
- package/dist/badge/badge.js +103 -0
- package/dist/badge/badge.mjs +13 -0
- package/dist/badge/index.d.mts +3 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.js +109 -0
- package/dist/badge/index.mjs +14 -0
- package/dist/box/box.d.mts +36 -0
- package/dist/box/box.d.ts +36 -0
- package/dist/box/box.js +131 -0
- package/dist/box/box.mjs +9 -0
- package/dist/box/index.d.mts +3 -0
- package/dist/box/index.d.ts +3 -0
- package/dist/box/index.js +137 -0
- package/dist/box/index.mjs +10 -0
- package/dist/button/button.d.mts +37 -0
- package/dist/button/button.d.ts +37 -0
- package/dist/button/button.js +103 -0
- package/dist/button/button.mjs +9 -0
- package/dist/button/index.d.mts +3 -37
- package/dist/button/index.d.ts +3 -37
- package/dist/button/index.js +9 -21
- package/dist/button/index.mjs +3 -1
- package/dist/chunk-2V6SWZ5G.mjs +16 -0
- package/dist/chunk-4XWB4ZSR.mjs +6 -0
- package/dist/chunk-7F7QB4D5.mjs +50 -0
- package/dist/chunk-AYGPUYPZ.mjs +5 -0
- package/dist/chunk-B3PZUFG2.mjs +40 -0
- package/dist/chunk-CYW3DUD2.mjs +5 -0
- package/dist/chunk-EKFYWUBE.mjs +36 -0
- package/dist/chunk-EX4U7YZF.mjs +83 -0
- package/dist/chunk-FUJQIYOF.mjs +37 -0
- package/dist/chunk-GSPFHK2Z.mjs +55 -0
- package/dist/chunk-ID5KKZMK.mjs +5 -0
- package/dist/chunk-IOOSUX5O.mjs +6 -0
- package/dist/chunk-IWDN3WGQ.mjs +47 -0
- package/dist/chunk-IWV4FFE3.mjs +35 -0
- package/dist/chunk-KBVDBI2L.mjs +59 -0
- package/dist/chunk-LNYNZ4EG.mjs +40 -0
- package/dist/chunk-NMSLCM2K.mjs +18 -0
- package/dist/chunk-O3NMR6GE.mjs +53 -0
- package/dist/chunk-PCKWBORI.mjs +5 -0
- package/dist/chunk-VZNNGRKM.mjs +5 -0
- package/dist/chunk-X3OAJSS2.mjs +41 -0
- package/dist/index.d.mts +15 -27
- package/dist/index.d.ts +15 -27
- package/dist/index.js +443 -29
- package/dist/index.mjs +69 -43
- package/dist/input/input.d.mts +13 -0
- package/dist/input/input.d.ts +13 -0
- package/dist/input/input.js +109 -0
- package/dist/input/input.mjs +51 -0
- package/dist/link/index.d.mts +3 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.js +94 -0
- package/dist/link/index.mjs +8 -0
- package/dist/link/link.d.mts +26 -0
- package/dist/link/link.d.ts +26 -0
- package/dist/link/link.js +88 -0
- package/dist/link/link.mjs +7 -0
- package/dist/list/description-list.d.mts +32 -0
- package/dist/list/description-list.d.ts +32 -0
- package/dist/list/description-list.js +89 -0
- package/dist/list/description-list.mjs +13 -0
- package/dist/list/index.d.mts +5 -0
- package/dist/list/index.d.ts +5 -0
- package/dist/list/index.js +144 -0
- package/dist/list/index.mjs +22 -0
- package/dist/list/link-list.d.mts +13 -0
- package/dist/list/link-list.d.ts +13 -0
- package/dist/list/link-list.js +102 -0
- package/dist/list/link-list.mjs +8 -0
- package/dist/list/list.d.mts +25 -0
- package/dist/list/list.d.ts +25 -0
- package/dist/list/list.js +95 -0
- package/dist/list/list.mjs +9 -0
- package/dist/message/index.d.mts +4 -0
- package/dist/message/index.d.ts +4 -0
- package/dist/message/index.js +162 -0
- package/dist/message/index.mjs +9 -0
- package/dist/message/message.d.mts +16 -0
- package/dist/message/message.d.ts +16 -0
- package/dist/message/message.js +155 -0
- package/dist/message/message.mjs +8 -0
- package/dist/utils-BfZsjuFH.d.mts +17 -0
- package/dist/utils-BfZsjuFH.d.ts +17 -0
- package/package.json +17 -17
- package/dist/chunk-ZPSTPWVB.mjs +0 -103
package/dist/box/box.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/box/box.tsx
|
|
50
|
+
var box_exports = {};
|
|
51
|
+
__export(box_exports, {
|
|
52
|
+
Box: () => Box,
|
|
53
|
+
BoxCloseButton: () => BoxCloseButton
|
|
54
|
+
});
|
|
55
|
+
module.exports = __toCommonJS(box_exports);
|
|
56
|
+
var import_react = require("react");
|
|
57
|
+
var import_clsx = require("clsx");
|
|
58
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
59
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
60
|
+
var Box = (0, import_react.forwardRef)(
|
|
61
|
+
(_a, ref) => {
|
|
62
|
+
var _b = _a, {
|
|
63
|
+
as: Component = "div",
|
|
64
|
+
variant = "light-grey",
|
|
65
|
+
hideCloseButton,
|
|
66
|
+
onClose: onCloseProp,
|
|
67
|
+
closed: closedProp,
|
|
68
|
+
closeButtonProps,
|
|
69
|
+
children,
|
|
70
|
+
className
|
|
71
|
+
} = _b, rest = __objRest(_b, [
|
|
72
|
+
"as",
|
|
73
|
+
"variant",
|
|
74
|
+
"hideCloseButton",
|
|
75
|
+
"onClose",
|
|
76
|
+
"closed",
|
|
77
|
+
"closeButtonProps",
|
|
78
|
+
"children",
|
|
79
|
+
"className"
|
|
80
|
+
]);
|
|
81
|
+
const [closedState, setClosedState] = (0, import_react.useState)(false);
|
|
82
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
83
|
+
if (onCloseProp) {
|
|
84
|
+
const result = onCloseProp();
|
|
85
|
+
if (result === true) {
|
|
86
|
+
setClosedState(true);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
setClosedState(true);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
92
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
|
+
Component,
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
className: (0, import_clsx.clsx)(
|
|
97
|
+
(0, import_typed_classname.t)("hds-box"),
|
|
98
|
+
(0, import_typed_classname.t)(`hds-box--${variant}`),
|
|
99
|
+
{ [(0, import_typed_classname.t)("hds-box--closed")]: closed },
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
ref
|
|
103
|
+
}, rest), {
|
|
104
|
+
children: [
|
|
105
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)),
|
|
106
|
+
children
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
Box.displayName = "Box";
|
|
113
|
+
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
114
|
+
(_a, ref) => {
|
|
115
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
"button",
|
|
118
|
+
__spreadValues({
|
|
119
|
+
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-box__close-button"), className),
|
|
120
|
+
ref,
|
|
121
|
+
type: "button"
|
|
122
|
+
}, rest)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
BoxCloseButton.displayName = "BoxCloseButton";
|
|
127
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
128
|
+
0 && (module.exports = {
|
|
129
|
+
Box,
|
|
130
|
+
BoxCloseButton
|
|
131
|
+
});
|
package/dist/box/box.mjs
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/box/index.tsx
|
|
50
|
+
var box_exports = {};
|
|
51
|
+
__export(box_exports, {
|
|
52
|
+
Box: () => Box,
|
|
53
|
+
BoxCloseButton: () => BoxCloseButton
|
|
54
|
+
});
|
|
55
|
+
module.exports = __toCommonJS(box_exports);
|
|
56
|
+
var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css");
|
|
57
|
+
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
|
|
58
|
+
var import_base = require("@postenbring/hedwig-css/dist/base.css");
|
|
59
|
+
var import_box = require("@postenbring/hedwig-css/dist/box.css");
|
|
60
|
+
|
|
61
|
+
// src/box/box.tsx
|
|
62
|
+
var import_react = require("react");
|
|
63
|
+
var import_clsx = require("clsx");
|
|
64
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
65
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
66
|
+
var Box = (0, import_react.forwardRef)(
|
|
67
|
+
(_a, ref) => {
|
|
68
|
+
var _b = _a, {
|
|
69
|
+
as: Component = "div",
|
|
70
|
+
variant = "light-grey",
|
|
71
|
+
hideCloseButton,
|
|
72
|
+
onClose: onCloseProp,
|
|
73
|
+
closed: closedProp,
|
|
74
|
+
closeButtonProps,
|
|
75
|
+
children,
|
|
76
|
+
className
|
|
77
|
+
} = _b, rest = __objRest(_b, [
|
|
78
|
+
"as",
|
|
79
|
+
"variant",
|
|
80
|
+
"hideCloseButton",
|
|
81
|
+
"onClose",
|
|
82
|
+
"closed",
|
|
83
|
+
"closeButtonProps",
|
|
84
|
+
"children",
|
|
85
|
+
"className"
|
|
86
|
+
]);
|
|
87
|
+
const [closedState, setClosedState] = (0, import_react.useState)(false);
|
|
88
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
89
|
+
if (onCloseProp) {
|
|
90
|
+
const result = onCloseProp();
|
|
91
|
+
if (result === true) {
|
|
92
|
+
setClosedState(true);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
setClosedState(true);
|
|
96
|
+
}
|
|
97
|
+
}, []);
|
|
98
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
100
|
+
Component,
|
|
101
|
+
__spreadProps(__spreadValues({
|
|
102
|
+
className: (0, import_clsx.clsx)(
|
|
103
|
+
(0, import_typed_classname.t)("hds-box"),
|
|
104
|
+
(0, import_typed_classname.t)(`hds-box--${variant}`),
|
|
105
|
+
{ [(0, import_typed_classname.t)("hds-box--closed")]: closed },
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
ref
|
|
109
|
+
}, rest), {
|
|
110
|
+
children: [
|
|
111
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)),
|
|
112
|
+
children
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
Box.displayName = "Box";
|
|
119
|
+
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
120
|
+
(_a, ref) => {
|
|
121
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
+
"button",
|
|
124
|
+
__spreadValues({
|
|
125
|
+
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-box__close-button"), className),
|
|
126
|
+
ref,
|
|
127
|
+
type: "button"
|
|
128
|
+
}, rest)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
BoxCloseButton.displayName = "BoxCloseButton";
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
Box,
|
|
136
|
+
BoxCloseButton
|
|
137
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The height, font size and padding of the button
|
|
7
|
+
*/
|
|
8
|
+
size?: "small" | "medium" | "large";
|
|
9
|
+
/**
|
|
10
|
+
* Make the button use 100% width available.
|
|
11
|
+
* Using the "mobile" it only stretch to full width on smaller screens
|
|
12
|
+
*/
|
|
13
|
+
fullWidth?: boolean | "mobile";
|
|
14
|
+
/**
|
|
15
|
+
* The background of the button.
|
|
16
|
+
*/
|
|
17
|
+
fill?: "contained" | "outlined";
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
buttonRef?: React.ForwardedRef<HTMLButtonElement>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ## TODO
|
|
23
|
+
*
|
|
24
|
+
* - [ ] Handle links that looks like buttons
|
|
25
|
+
* - [ ] Revisit how to handle outline
|
|
26
|
+
* - [ ] Figure out outline-white
|
|
27
|
+
*/
|
|
28
|
+
declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare namespace PrimaryButton {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
declare namespace SecondaryButton {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { type ButtonProps, PrimaryButton, SecondaryButton };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The height, font size and padding of the button
|
|
7
|
+
*/
|
|
8
|
+
size?: "small" | "medium" | "large";
|
|
9
|
+
/**
|
|
10
|
+
* Make the button use 100% width available.
|
|
11
|
+
* Using the "mobile" it only stretch to full width on smaller screens
|
|
12
|
+
*/
|
|
13
|
+
fullWidth?: boolean | "mobile";
|
|
14
|
+
/**
|
|
15
|
+
* The background of the button.
|
|
16
|
+
*/
|
|
17
|
+
fill?: "contained" | "outlined";
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
buttonRef?: React.ForwardedRef<HTMLButtonElement>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ## TODO
|
|
23
|
+
*
|
|
24
|
+
* - [ ] Handle links that looks like buttons
|
|
25
|
+
* - [ ] Revisit how to handle outline
|
|
26
|
+
* - [ ] Figure out outline-white
|
|
27
|
+
*/
|
|
28
|
+
declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare namespace PrimaryButton {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
declare namespace SecondaryButton {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { type ButtonProps, PrimaryButton, SecondaryButton };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/button/button.tsx
|
|
50
|
+
var button_exports = {};
|
|
51
|
+
__export(button_exports, {
|
|
52
|
+
PrimaryButton: () => PrimaryButton,
|
|
53
|
+
SecondaryButton: () => SecondaryButton
|
|
54
|
+
});
|
|
55
|
+
module.exports = __toCommonJS(button_exports);
|
|
56
|
+
var import_clsx = require("clsx");
|
|
57
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
function BaseButton(_a) {
|
|
60
|
+
var _b = _a, {
|
|
61
|
+
children,
|
|
62
|
+
variant,
|
|
63
|
+
size = "medium",
|
|
64
|
+
fullWidth = false,
|
|
65
|
+
fill = "contained",
|
|
66
|
+
buttonRef
|
|
67
|
+
} = _b, rest = __objRest(_b, [
|
|
68
|
+
"children",
|
|
69
|
+
"variant",
|
|
70
|
+
"size",
|
|
71
|
+
"fullWidth",
|
|
72
|
+
"fill",
|
|
73
|
+
"buttonRef"
|
|
74
|
+
]);
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"button",
|
|
77
|
+
__spreadProps(__spreadValues({
|
|
78
|
+
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), {
|
|
79
|
+
[(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained",
|
|
80
|
+
[(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined",
|
|
81
|
+
[(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true,
|
|
82
|
+
[(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile"
|
|
83
|
+
}),
|
|
84
|
+
ref: buttonRef
|
|
85
|
+
}, rest), {
|
|
86
|
+
children
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
BaseButton.displayName = "BaseButton";
|
|
91
|
+
function PrimaryButton(props) {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
|
|
93
|
+
}
|
|
94
|
+
PrimaryButton.displayName = "PrimaryButton";
|
|
95
|
+
function SecondaryButton(props) {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
|
|
97
|
+
}
|
|
98
|
+
SecondaryButton.displayName = "SecondaryButton";
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
PrimaryButton,
|
|
102
|
+
SecondaryButton
|
|
103
|
+
});
|
package/dist/button/index.d.mts
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {
|
|
5
|
-
/**
|
|
6
|
-
* The height, font size and padding of the button
|
|
7
|
-
*/
|
|
8
|
-
size?: "small" | "medium" | "large";
|
|
9
|
-
/**
|
|
10
|
-
* Make the button use 100% width available.
|
|
11
|
-
* Using the "mobile" it only stretch to full width on smaller screens
|
|
12
|
-
*/
|
|
13
|
-
fullWidth?: boolean | "mobile";
|
|
14
|
-
/**
|
|
15
|
-
* The background of the button.
|
|
16
|
-
*/
|
|
17
|
-
fill?: "contained" | "outlined";
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
buttonRef?: React.ForwardedRef<HTMLButtonElement>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* ## TODO
|
|
23
|
-
*
|
|
24
|
-
* - [ ] Handle links that looks like buttons
|
|
25
|
-
* - [ ] Revisit how to handle outline
|
|
26
|
-
* - [ ] Figure out outline-white
|
|
27
|
-
*/
|
|
28
|
-
declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
-
declare namespace PrimaryButton {
|
|
30
|
-
var displayName: string;
|
|
31
|
-
}
|
|
32
|
-
declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
33
|
-
declare namespace SecondaryButton {
|
|
34
|
-
var displayName: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { PrimaryButton, SecondaryButton };
|
|
1
|
+
export { ButtonProps, PrimaryButton, SecondaryButton } from './button.mjs';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
package/dist/button/index.d.ts
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {
|
|
5
|
-
/**
|
|
6
|
-
* The height, font size and padding of the button
|
|
7
|
-
*/
|
|
8
|
-
size?: "small" | "medium" | "large";
|
|
9
|
-
/**
|
|
10
|
-
* Make the button use 100% width available.
|
|
11
|
-
* Using the "mobile" it only stretch to full width on smaller screens
|
|
12
|
-
*/
|
|
13
|
-
fullWidth?: boolean | "mobile";
|
|
14
|
-
/**
|
|
15
|
-
* The background of the button.
|
|
16
|
-
*/
|
|
17
|
-
fill?: "contained" | "outlined";
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
buttonRef?: React.ForwardedRef<HTMLButtonElement>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* ## TODO
|
|
23
|
-
*
|
|
24
|
-
* - [ ] Handle links that looks like buttons
|
|
25
|
-
* - [ ] Revisit how to handle outline
|
|
26
|
-
* - [ ] Figure out outline-white
|
|
27
|
-
*/
|
|
28
|
-
declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
-
declare namespace PrimaryButton {
|
|
30
|
-
var displayName: string;
|
|
31
|
-
}
|
|
32
|
-
declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
33
|
-
declare namespace SecondaryButton {
|
|
34
|
-
var displayName: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { PrimaryButton, SecondaryButton };
|
|
1
|
+
export { ButtonProps, PrimaryButton, SecondaryButton } from './button.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
package/dist/button/index.js
CHANGED
|
@@ -53,24 +53,14 @@ __export(button_exports, {
|
|
|
53
53
|
SecondaryButton: () => SecondaryButton
|
|
54
54
|
});
|
|
55
55
|
module.exports = __toCommonJS(button_exports);
|
|
56
|
+
var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css");
|
|
56
57
|
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
|
|
57
58
|
var import_base = require("@postenbring/hedwig-css/dist/base.css");
|
|
58
|
-
var import_button = require("@postenbring/hedwig-css/dist/button
|
|
59
|
+
var import_button = require("@postenbring/hedwig-css/dist/button.css");
|
|
59
60
|
|
|
60
61
|
// src/button/button.tsx
|
|
61
62
|
var import_clsx = require("clsx");
|
|
62
|
-
|
|
63
|
-
// src/utils.ts
|
|
64
|
-
function warnForStyleOverrides(props) {
|
|
65
|
-
if (props.className) {
|
|
66
|
-
console.warn("Overriding styles are not premited");
|
|
67
|
-
}
|
|
68
|
-
if (props.styles) {
|
|
69
|
-
console.warn("Overriding styles are not premited");
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/button/button.tsx
|
|
63
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
74
64
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
75
65
|
function BaseButton(_a) {
|
|
76
66
|
var _b = _a, {
|
|
@@ -88,18 +78,16 @@ function BaseButton(_a) {
|
|
|
88
78
|
"fill",
|
|
89
79
|
"buttonRef"
|
|
90
80
|
]);
|
|
91
|
-
warnForStyleOverrides(rest);
|
|
92
81
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
82
|
"button",
|
|
94
83
|
__spreadProps(__spreadValues({
|
|
95
|
-
className: (0, import_clsx.clsx)("hds-button", `hds-button--${size}
|
|
96
|
-
[`hds-button--${variant}`]: fill === "contained",
|
|
97
|
-
[`hds-button--outline-${variant}`]: fill === "outlined",
|
|
98
|
-
"hds-button--full": fullWidth === true,
|
|
99
|
-
"hds-button--mobile-full": fullWidth === "mobile"
|
|
84
|
+
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), {
|
|
85
|
+
[(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained",
|
|
86
|
+
[(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined",
|
|
87
|
+
[(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true,
|
|
88
|
+
[(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile"
|
|
100
89
|
}),
|
|
101
|
-
ref: buttonRef
|
|
102
|
-
type: "button"
|
|
90
|
+
ref: buttonRef
|
|
103
91
|
}, rest), {
|
|
104
92
|
children
|
|
105
93
|
})
|
package/dist/button/index.mjs
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/accordion/context.ts
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
var AccordionContext = createContext({
|
|
4
|
+
variant: "multiple",
|
|
5
|
+
mounted: false,
|
|
6
|
+
openItems: [],
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Added default section, without handling
|
|
8
|
+
toggleOpenItem: (id) => {
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var AccordionItemContext = createContext(null);
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
AccordionContext,
|
|
15
|
+
AccordionItemContext
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/message/index.tsx
|
|
2
|
+
import "@postenbring/hedwig-tokens/tokens-output/css/fonts.css";
|
|
3
|
+
import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
|
|
4
|
+
import "@postenbring/hedwig-css/dist/base.css";
|
|
5
|
+
import "@postenbring/hedwig-css/dist/box.css";
|
|
6
|
+
import "@postenbring/hedwig-css/dist/message.css";
|