@postenbring/hedwig-react 4.4.0 → 4.5.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/chunk-RF25YRXA.mjs +33 -0
- package/dist/chunk-RF25YRXA.mjs.map +1 -0
- package/dist/chunk-XELFBRQ4.mjs +1 -0
- package/dist/chunk-XELFBRQ4.mjs.map +1 -0
- package/dist/form/index.mjs +14 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -59
- package/dist/tag/index.d.ts +3 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/tag/index.js +82 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/tag/index.mjs +9 -0
- package/dist/tag/index.mjs.map +1 -0
- package/dist/tag/tag.d.ts +33 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +80 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/tag.mjs +8 -0
- package/dist/tag/tag.mjs.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/tag/index.tsx +3 -0
- package/src/tag/tag.stories.tsx +20 -0
- package/src/tag/tag.tsx +55 -0
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-JKCVB5TR.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
StyledHtml
|
|
4
|
+
} from "./chunk-I76U35YW.mjs";
|
|
5
5
|
import "./chunk-3D2MWIEX.mjs";
|
|
6
6
|
import {
|
|
7
7
|
WarningBanner
|
|
8
8
|
} from "./chunk-EMQB6JIS.mjs";
|
|
9
|
-
import "./chunk-JKCVB5TR.mjs";
|
|
10
|
-
import {
|
|
11
|
-
StyledHtml
|
|
12
|
-
} from "./chunk-I76U35YW.mjs";
|
|
13
9
|
import "./chunk-3LYJRAOC.mjs";
|
|
14
10
|
import {
|
|
15
11
|
Table
|
|
@@ -27,29 +23,47 @@ import {
|
|
|
27
23
|
TabsTab
|
|
28
24
|
} from "./chunk-WVCJV74B.mjs";
|
|
29
25
|
import "./chunk-KQITCS3U.mjs";
|
|
30
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-XELFBRQ4.mjs";
|
|
31
27
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
28
|
+
Tag
|
|
29
|
+
} from "./chunk-RF25YRXA.mjs";
|
|
30
|
+
import "./chunk-CSXSUQ2M.mjs";
|
|
31
|
+
import {
|
|
32
|
+
Text
|
|
33
|
+
} from "./chunk-DMOMTRIY.mjs";
|
|
34
|
+
import "./chunk-SRLM3K2X.mjs";
|
|
35
|
+
import {
|
|
36
|
+
ShowMoreButton
|
|
37
|
+
} from "./chunk-JUHJZLH2.mjs";
|
|
34
38
|
import "./chunk-AJFQHFQT.mjs";
|
|
35
39
|
import {
|
|
36
40
|
Spinner
|
|
37
41
|
} from "./chunk-ZTZAPNZB.mjs";
|
|
42
|
+
import "./chunk-JTZPQHKD.mjs";
|
|
43
|
+
import {
|
|
44
|
+
Skeleton
|
|
45
|
+
} from "./chunk-QTC4ATZD.mjs";
|
|
38
46
|
import "./chunk-TJH5QJMS.mjs";
|
|
39
47
|
import {
|
|
40
48
|
StepIndicator
|
|
41
49
|
} from "./chunk-XQBJ75VD.mjs";
|
|
42
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-BVG5VSZK.mjs";
|
|
43
51
|
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
ModalHeader
|
|
48
|
-
} from "./chunk-YQT2TN3U.mjs";
|
|
49
|
-
import "./chunk-SRLM3K2X.mjs";
|
|
52
|
+
Container
|
|
53
|
+
} from "./chunk-4QZR2H72.mjs";
|
|
54
|
+
import "./chunk-G65EYZFQ.mjs";
|
|
50
55
|
import {
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
Grid,
|
|
57
|
+
GridItem
|
|
58
|
+
} from "./chunk-TC5PD4TA.mjs";
|
|
59
|
+
import "./chunk-ZQHLYAJU.mjs";
|
|
60
|
+
import {
|
|
61
|
+
HStack,
|
|
62
|
+
Stack,
|
|
63
|
+
VStack
|
|
64
|
+
} from "./chunk-FUIKSOJF.mjs";
|
|
65
|
+
import "./chunk-7ROE6ADK.mjs";
|
|
66
|
+
import "./chunk-NE6W2PCD.mjs";
|
|
53
67
|
import "./chunk-H3E546OT.mjs";
|
|
54
68
|
import {
|
|
55
69
|
Navbar,
|
|
@@ -68,29 +82,19 @@ import {
|
|
|
68
82
|
useNavbarExpendableMenuContext
|
|
69
83
|
} from "./chunk-HOLFVKXQ.mjs";
|
|
70
84
|
import "./chunk-XMDDGSCF.mjs";
|
|
71
|
-
import "./chunk-BVG5VSZK.mjs";
|
|
72
|
-
import {
|
|
73
|
-
Container
|
|
74
|
-
} from "./chunk-4QZR2H72.mjs";
|
|
75
|
-
import "./chunk-G65EYZFQ.mjs";
|
|
76
|
-
import {
|
|
77
|
-
Grid,
|
|
78
|
-
GridItem
|
|
79
|
-
} from "./chunk-TC5PD4TA.mjs";
|
|
80
|
-
import "./chunk-ZQHLYAJU.mjs";
|
|
81
|
-
import {
|
|
82
|
-
HStack,
|
|
83
|
-
Stack,
|
|
84
|
-
VStack
|
|
85
|
-
} from "./chunk-FUIKSOJF.mjs";
|
|
86
|
-
import "./chunk-7ROE6ADK.mjs";
|
|
87
|
-
import "./chunk-NE6W2PCD.mjs";
|
|
88
85
|
import "./chunk-RC76SXBP.mjs";
|
|
89
86
|
import {
|
|
90
87
|
Message,
|
|
91
88
|
MessageDescription,
|
|
92
89
|
MessageTitle
|
|
93
90
|
} from "./chunk-ILN2L5NX.mjs";
|
|
91
|
+
import "./chunk-FYFJ75NX.mjs";
|
|
92
|
+
import {
|
|
93
|
+
Modal,
|
|
94
|
+
ModalContent,
|
|
95
|
+
ModalFooter,
|
|
96
|
+
ModalHeader
|
|
97
|
+
} from "./chunk-YQT2TN3U.mjs";
|
|
94
98
|
import "./chunk-2YL2MVWN.mjs";
|
|
95
99
|
import "./chunk-K2CB2NLY.mjs";
|
|
96
100
|
import {
|
|
@@ -104,11 +108,11 @@ import {
|
|
|
104
108
|
FooterLinkSections,
|
|
105
109
|
FooterLogo
|
|
106
110
|
} from "./chunk-QDG2QLFV.mjs";
|
|
107
|
-
import "./chunk-CFAH2LID.mjs";
|
|
108
|
-
import {
|
|
109
|
-
HelpText
|
|
110
|
-
} from "./chunk-INDTHGWZ.mjs";
|
|
111
111
|
import "./chunk-5J5LYE6Z.mjs";
|
|
112
|
+
import "./chunk-BYEJZSG5.mjs";
|
|
113
|
+
import {
|
|
114
|
+
Select
|
|
115
|
+
} from "./chunk-JGQTAIEP.mjs";
|
|
112
116
|
import "./chunk-XSID7YR7.mjs";
|
|
113
117
|
import {
|
|
114
118
|
Suggestions
|
|
@@ -132,25 +136,19 @@ import {
|
|
|
132
136
|
RadioGroup,
|
|
133
137
|
useRadioGroupContext
|
|
134
138
|
} from "./chunk-QER35NXN.mjs";
|
|
135
|
-
import "./chunk-BYEJZSG5.mjs";
|
|
136
|
-
import {
|
|
137
|
-
Select
|
|
138
|
-
} from "./chunk-JGQTAIEP.mjs";
|
|
139
139
|
import "./chunk-CAIGPMDS.mjs";
|
|
140
140
|
import {
|
|
141
141
|
SearchWrapper
|
|
142
142
|
} from "./chunk-RJ763KDH.mjs";
|
|
143
143
|
import "./chunk-KPPLVGZ3.mjs";
|
|
144
|
+
import {
|
|
145
|
+
ErrorSummary
|
|
146
|
+
} from "./chunk-NAXSP4VU.mjs";
|
|
147
|
+
import "./chunk-CKAL5ZJZ.mjs";
|
|
144
148
|
import "./chunk-7LPYJC6S.mjs";
|
|
145
149
|
import {
|
|
146
150
|
Input
|
|
147
151
|
} from "./chunk-62VLFCXX.mjs";
|
|
148
|
-
import "./chunk-TDLSHJ4Z.mjs";
|
|
149
|
-
import {
|
|
150
|
-
DatePicker
|
|
151
|
-
} from "./chunk-RGZSYJFL.mjs";
|
|
152
|
-
import "./chunk-Y5SUMFYJ.mjs";
|
|
153
|
-
import "./chunk-DMRQEQQK.mjs";
|
|
154
152
|
import "./chunk-YJOOSTJC.mjs";
|
|
155
153
|
import {
|
|
156
154
|
Checkbox
|
|
@@ -166,6 +164,12 @@ import {
|
|
|
166
164
|
import {
|
|
167
165
|
FieldsetLegend
|
|
168
166
|
} from "./chunk-CD4LCDK3.mjs";
|
|
167
|
+
import "./chunk-TDLSHJ4Z.mjs";
|
|
168
|
+
import {
|
|
169
|
+
DatePicker
|
|
170
|
+
} from "./chunk-RGZSYJFL.mjs";
|
|
171
|
+
import "./chunk-Y5SUMFYJ.mjs";
|
|
172
|
+
import "./chunk-DMRQEQQK.mjs";
|
|
169
173
|
import "./chunk-NSLSA7F7.mjs";
|
|
170
174
|
import {
|
|
171
175
|
ErrorMessage
|
|
@@ -174,10 +178,6 @@ import "./chunk-5M6MEYM7.mjs";
|
|
|
174
178
|
import {
|
|
175
179
|
ValidationMessage
|
|
176
180
|
} from "./chunk-F23MNQCK.mjs";
|
|
177
|
-
import {
|
|
178
|
-
ErrorSummary
|
|
179
|
-
} from "./chunk-NAXSP4VU.mjs";
|
|
180
|
-
import "./chunk-CKAL5ZJZ.mjs";
|
|
181
181
|
import "./chunk-XLLYMQLW.mjs";
|
|
182
182
|
import {
|
|
183
183
|
Link
|
|
@@ -190,11 +190,15 @@ import {
|
|
|
190
190
|
OrderedList,
|
|
191
191
|
UnorderedList
|
|
192
192
|
} from "./chunk-3QHKPEXO.mjs";
|
|
193
|
-
import "./chunk-
|
|
193
|
+
import "./chunk-CFAH2LID.mjs";
|
|
194
|
+
import {
|
|
195
|
+
HelpText
|
|
196
|
+
} from "./chunk-INDTHGWZ.mjs";
|
|
194
197
|
import "./chunk-ISAHCU7C.mjs";
|
|
198
|
+
import "./chunk-HT2EIJAD.mjs";
|
|
195
199
|
import {
|
|
196
|
-
|
|
197
|
-
} from "./chunk-
|
|
200
|
+
Button
|
|
201
|
+
} from "./chunk-45Q2TCH6.mjs";
|
|
198
202
|
import "./chunk-Y6NOEN7R.mjs";
|
|
199
203
|
import {
|
|
200
204
|
ButtonList
|
|
@@ -226,8 +230,8 @@ import {
|
|
|
226
230
|
} from "./chunk-NZB6BBFT.mjs";
|
|
227
231
|
import "./chunk-BCFV6VOE.mjs";
|
|
228
232
|
import {
|
|
229
|
-
|
|
230
|
-
} from "./chunk-
|
|
233
|
+
Breadcrumbs
|
|
234
|
+
} from "./chunk-A42PXOVR.mjs";
|
|
231
235
|
import "./chunk-ZKMFJZSH.mjs";
|
|
232
236
|
import {
|
|
233
237
|
Accordion
|
|
@@ -351,6 +355,7 @@ export {
|
|
|
351
355
|
TabsContents,
|
|
352
356
|
TabsList,
|
|
353
357
|
TabsTab,
|
|
358
|
+
Tag,
|
|
354
359
|
Text,
|
|
355
360
|
Textarea,
|
|
356
361
|
UnorderedList,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,mBAAmB,OAAO,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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/tag/index.tsx
|
|
50
|
+
var tag_exports = {};
|
|
51
|
+
__export(tag_exports, {
|
|
52
|
+
Tag: () => Tag
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(tag_exports);
|
|
55
|
+
|
|
56
|
+
// src/tag/tag.tsx
|
|
57
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
58
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
59
|
+
var import_react = require("react");
|
|
60
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
+
var Tag = (0, import_react.forwardRef)(
|
|
62
|
+
(_a, ref) => {
|
|
63
|
+
var _b = _a, { "data-color": color, children, asChild, size = "default", className } = _b, rest = __objRest(_b, ["data-color", "children", "asChild", "size", "className"]);
|
|
64
|
+
const Component = asChild ? import_react_slot.Slot : "span";
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
Component,
|
|
67
|
+
__spreadProps(__spreadValues({
|
|
68
|
+
"data-color": color,
|
|
69
|
+
ref,
|
|
70
|
+
className: (0, import_typed_classname.clsx)("hds-tag", { "hds-tag--small": size === "small" }, className)
|
|
71
|
+
}, rest), {
|
|
72
|
+
children
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
Tag.displayName = "Tag";
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
Tag
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/tag/index.tsx","../../src/tag/tag.tsx"],"sourcesContent":["export { Tag } from \"./tag\";\n\nexport type * from \"./tag\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { forwardRef } from \"react\";\n\nexport interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n\n /**\n * Color of the tag. Combines the theme color and semantic variant.\n *\n * When omitted, the color is inherited from the parent(s).\n */\n \"data-color\"?: \"posten\" | \"bring\" | \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * Size of the tag\n *\n * @default \"default\"\n */\n size?: \"small\" | \"default\";\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 * Tags are used to label, categorize or organize items using keywords to describe them.\n *\n * @example\n *\n * ```tsx\n * <Tag data-color=\"info\">Info</Tag>\n * ```\n *\n */\nexport const Tag = forwardRef<HTMLSpanElement, TagProps>(\n ({ \"data-color\": color, children, asChild, size = \"default\", className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"span\";\n return (\n <Component\n data-color={color}\n ref={ref}\n className={clsx(\"hds-tag\", { \"hds-tag--small\": size === \"small\" }, className as undefined)}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nTag.displayName = \"Tag\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,6BAAqB;AACrB,wBAAqB;AACrB,mBAA2B;AAyCrB;AAJC,IAAM,UAAM;AAAA,EACjB,CAAC,IAAkF,QAAQ;AAA1F,iBAAE,gBAAc,OAAO,UAAU,SAAS,OAAO,WAAW,UAxC/D,IAwCG,IAA0E,iBAA1E,IAA0E,CAAxE,cAAqB,YAAU,WAAS,QAAkB;AAC3D,UAAM,YAAY,UAAU,yBAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ;AAAA,QACA,eAAW,6BAAK,WAAW,EAAE,kBAAkB,SAAS,QAAQ,GAAG,SAAsB;AAAA,SACrF,OAJL;AAAA,QAME;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,IAAI,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
/**
|
|
4
|
+
* Color of the tag. Combines the theme color and semantic variant.
|
|
5
|
+
*
|
|
6
|
+
* When omitted, the color is inherited from the parent(s).
|
|
7
|
+
*/
|
|
8
|
+
"data-color"?: "posten" | "bring" | "neutral" | "info" | "success" | "warning" | "error";
|
|
9
|
+
/**
|
|
10
|
+
* Size of the tag
|
|
11
|
+
*
|
|
12
|
+
* @default "default"
|
|
13
|
+
*/
|
|
14
|
+
size?: "small" | "default";
|
|
15
|
+
/**
|
|
16
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Tags are used to label, categorize or organize items using keywords to describe them.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Tag data-color="info">Info</Tag>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
33
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAEzF;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,sGAcf,CAAC"}
|
package/dist/tag/tag.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
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/tag/tag.tsx
|
|
50
|
+
var tag_exports = {};
|
|
51
|
+
__export(tag_exports, {
|
|
52
|
+
Tag: () => Tag
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(tag_exports);
|
|
55
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
|
|
56
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
57
|
+
var import_react = require("react");
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
var Tag = (0, import_react.forwardRef)(
|
|
60
|
+
(_a, ref) => {
|
|
61
|
+
var _b = _a, { "data-color": color, children, asChild, size = "default", className } = _b, rest = __objRest(_b, ["data-color", "children", "asChild", "size", "className"]);
|
|
62
|
+
const Component = asChild ? import_react_slot.Slot : "span";
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
Component,
|
|
65
|
+
__spreadProps(__spreadValues({
|
|
66
|
+
"data-color": color,
|
|
67
|
+
ref,
|
|
68
|
+
className: (0, import_typed_classname.clsx)("hds-tag", { "hds-tag--small": size === "small" }, className)
|
|
69
|
+
}, rest), {
|
|
70
|
+
children
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
Tag.displayName = "Tag";
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
Tag
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/tag/tag.tsx"],"sourcesContent":["import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { forwardRef } from \"react\";\n\nexport interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n\n /**\n * Color of the tag. Combines the theme color and semantic variant.\n *\n * When omitted, the color is inherited from the parent(s).\n */\n \"data-color\"?: \"posten\" | \"bring\" | \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * Size of the tag\n *\n * @default \"default\"\n */\n size?: \"small\" | \"default\";\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 * Tags are used to label, categorize or organize items using keywords to describe them.\n *\n * @example\n *\n * ```tsx\n * <Tag data-color=\"info\">Info</Tag>\n * ```\n *\n */\nexport const Tag = forwardRef<HTMLSpanElement, TagProps>(\n ({ \"data-color\": color, children, asChild, size = \"default\", className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"span\";\n return (\n <Component\n data-color={color}\n ref={ref}\n className={clsx(\"hds-tag\", { \"hds-tag--small\": size === \"small\" }, className as undefined)}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nTag.displayName = \"Tag\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAqB;AACrB,wBAAqB;AACrB,mBAA2B;AAyCrB;AAJC,IAAM,UAAM;AAAA,EACjB,CAAC,IAAkF,QAAQ;AAA1F,iBAAE,gBAAc,OAAO,UAAU,SAAS,OAAO,WAAW,UAxC/D,IAwCG,IAA0E,iBAA1E,IAA0E,CAAxE,cAAqB,YAAU,WAAS,QAAkB;AAC3D,UAAM,YAAY,UAAU,yBAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ;AAAA,QACA,eAAW,6BAAK,WAAW,EAAE,kBAAkB,SAAS,QAAQ,GAAG,SAAsB;AAAA,SACrF,OAJL;AAAA,QAME;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,IAAI,cAAc;","names":[]}
|
package/dist/tag/tag.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postenbring/hedwig-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@radix-ui/react-popover": "1.1.23",
|
|
33
33
|
"@radix-ui/react-slot": "1.3.3",
|
|
34
|
-
"@postenbring/hedwig-css": "4.
|
|
34
|
+
"@postenbring/hedwig-css": "4.5.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Tag } from ".";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Tag> = {
|
|
6
|
+
title: "Tag",
|
|
7
|
+
component: Tag,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
export const Preview: StoryObj<typeof Tag> = {
|
|
13
|
+
tags: ["!dev"],
|
|
14
|
+
args: {
|
|
15
|
+
children: "Tag",
|
|
16
|
+
"data-color": "posten",
|
|
17
|
+
size: "default",
|
|
18
|
+
asChild: false,
|
|
19
|
+
},
|
|
20
|
+
};
|
package/src/tag/tag.tsx
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Color of the tag. Combines the theme color and semantic variant.
|
|
10
|
+
*
|
|
11
|
+
* When omitted, the color is inherited from the parent(s).
|
|
12
|
+
*/
|
|
13
|
+
"data-color"?: "posten" | "bring" | "neutral" | "info" | "success" | "warning" | "error";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Size of the tag
|
|
17
|
+
*
|
|
18
|
+
* @default "default"
|
|
19
|
+
*/
|
|
20
|
+
size?: "small" | "default";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Tags are used to label, categorize or organize items using keywords to describe them.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Tag data-color="info">Info</Tag>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
41
|
+
({ "data-color": color, children, asChild, size = "default", className, ...rest }, ref) => {
|
|
42
|
+
const Component = asChild ? Slot : "span";
|
|
43
|
+
return (
|
|
44
|
+
<Component
|
|
45
|
+
data-color={color}
|
|
46
|
+
ref={ref}
|
|
47
|
+
className={clsx("hds-tag", { "hds-tag--small": size === "small" }, className as undefined)}
|
|
48
|
+
{...rest}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</Component>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
Tag.displayName = "Tag";
|