jvetrau-ds 0.2.1 → 0.2.2

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.
@@ -83,25 +83,69 @@
83
83
  }
84
84
 
85
85
  .button:hover {
86
+ /* color */
87
+
88
+ /* typography */
89
+
90
+ /* size */
91
+
92
+ /* border */
93
+
94
+ /* depth */
95
+
96
+ /* motion */
86
97
  opacity: var(--button-opacity-hover);
87
98
  }
88
99
 
89
100
  .button:focus-visible {
101
+ /* color */
102
+
103
+ /* typography */
104
+
105
+ /* size */
106
+
107
+ /* border */
90
108
  outline:
91
109
  var(--button-focus-width)
92
110
  solid
93
111
  var(--button-focus-color);
94
112
  outline-offset: var(--button-focus-offset);
113
+
114
+ /* depth */
115
+
116
+ /* motion */
95
117
  }
96
118
 
97
119
  .button:active {
120
+ /* color */
121
+
122
+ /* typography */
123
+
124
+ /* size */
125
+
126
+ /* border */
127
+
128
+ /* depth */
129
+
130
+ /* motion */
98
131
  opacity: var(--button-opacity-active);
99
132
  }
100
133
 
101
134
  .button:disabled,
102
135
  .button--disabled {
136
+ /* color */
103
137
  background: var(--button-bg-disabled);
104
138
  color: var(--button-color-disabled);
139
+
140
+ /* typography */
141
+
142
+ /* size */
143
+
144
+ /* border */
145
+
146
+ /* depth */
147
+
148
+ /* motion */
105
149
  opacity: var(--button-opacity-disabled);
106
150
  cursor: not-allowed;
107
151
  }
@@ -109,25 +153,66 @@
109
153
  /* Rank */
110
154
 
111
155
  .button--primary {
156
+ /* color */
112
157
  --button-bg: var(--color-primary-2);
113
158
  --button-color: var(--color-text-primary-2);
114
159
  --button-focus-color: var(--color-primary-2);
160
+
161
+ /* typography */
162
+
163
+ /* size */
164
+
165
+ /* border */
166
+
167
+ /* depth */
168
+
169
+ /* motion */
115
170
  }
116
171
 
117
172
  .button--link {
173
+ /* color */
118
174
  --button-bg: transparent;
119
175
  --button-color: var(--color-link);
120
176
  --button-focus-color: var(--color-link);
177
+
178
+ /* typography */
179
+
180
+ /* size */
181
+ height: auto;
182
+ min-height: 0;
183
+ padding: 0;
184
+
185
+ /* border */
186
+
187
+ /* depth */
188
+
189
+ /* motion */
121
190
  }
122
191
 
123
192
  .button--link:disabled,
124
193
  .button--link.button--disabled {
194
+ /* color */
125
195
  background: transparent;
196
+
197
+ /* typography */
198
+
199
+ /* size */
200
+
201
+ /* border */
202
+
203
+ /* depth */
204
+
205
+ /* motion */
126
206
  }
127
207
 
128
208
  /* Density */
129
209
 
130
210
  .button--compact {
211
+ /* color */
212
+
213
+ /* typography */
214
+
215
+ /* size */
131
216
  /*
132
217
  * Compact presentation is intentionally left
133
218
  * token-driven but visually unfinished.
@@ -135,27 +220,66 @@
135
220
  * Add compact control dimensions when the
136
221
  * corresponding semantic tokens are available.
137
222
  */
223
+
224
+ /* border */
225
+
226
+ /* depth */
227
+
228
+ /* motion */
138
229
  }
139
230
 
140
231
  /* Mode */
141
232
 
142
233
  .button--toolbar {
234
+ /* color */
143
235
  --button-bg: transparent;
144
236
  --button-color: var(--color-text);
145
237
  --button-focus-color: var(--color-text);
146
238
 
147
239
  background: transparent;
240
+
241
+ /* typography */
242
+
243
+ /* size */
148
244
  padding-inline: 0;
245
+
246
+ /* border */
247
+
248
+ /* depth */
249
+
250
+ /* motion */
149
251
  }
150
252
 
151
253
  .button--toolbar:disabled,
152
254
  .button--toolbar.button--disabled {
255
+ /* color */
153
256
  background: transparent;
257
+
258
+ /* typography */
259
+
260
+ /* size */
261
+
262
+ /* border */
263
+
264
+ /* depth */
265
+
266
+ /* motion */
154
267
  }
155
268
 
156
269
  /* State */
157
270
 
158
271
  .button--loading {
272
+ /* color */
273
+
274
+ /* typography */
275
+
276
+ /* size */
277
+
278
+ /* border */
279
+
280
+ /* depth */
281
+
282
+ /* motion */
159
283
  /*
160
284
  * Loading behavior is already defined by the
161
285
  * component contract:
@@ -169,9 +293,31 @@
169
293
  /* Content */
170
294
 
171
295
  .button--icon-only {
296
+ /* color */
297
+
298
+ /* typography */
299
+
300
+ /* size */
172
301
  padding-inline: var(--button-padding-icon-only);
302
+
303
+ /* border */
304
+
305
+ /* depth */
306
+
307
+ /* motion */
173
308
  }
174
309
 
175
310
  .button--toolbar.button--icon-only {
311
+ /* color */
312
+
313
+ /* typography */
314
+
315
+ /* size */
176
316
  padding-inline: 0;
317
+
318
+ /* border */
319
+
320
+ /* depth */
321
+
322
+ /* motion */
177
323
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var classnames = require('../helpers/classnames');
5
+ require('./checkbox.css');
5
6
 
6
7
  const Checkbox = ({
7
8
  label,
@@ -16,6 +17,7 @@ const Checkbox = ({
16
17
  "checkbox--disabled": disabled
17
18
  }
18
19
  );
20
+ const hasLabel = label !== null && label !== void 0;
19
21
  return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: classes, children: [
20
22
  /* @__PURE__ */ jsxRuntime.jsx(
21
23
  "input",
@@ -26,7 +28,7 @@ const Checkbox = ({
26
28
  ...props
27
29
  }
28
30
  ),
29
- label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "checkbox__label", children: label })
31
+ hasLabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "checkbox__label", children: label }) : null
30
32
  ] });
31
33
  };
32
34
  var checkbox_default = Checkbox;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/checkbox/checkbox.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;AASA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,UAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,oBAAA,EAAsB;AAAA;AACxB,GACF;AAEA,EAAA,uBACEC,eAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,iBAAA;AAAA,QACV,IAAA,EAAK,UAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,oBAASA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mBAAmB,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EACrD,CAAA;AAEJ,CAAA;AAEA,IAAO,gBAAA,GAAQ","file":"checkbox.cjs","sourcesContent":["import React from 'react';\n//import './checkbox.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Checkbox: React.FC<CheckboxProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'checkbox',\n className,\n {\n 'checkbox--disabled': disabled,\n }\n );\n\n return (\n <label className={classes}>\n <input\n className=\"checkbox__input\"\n type=\"checkbox\"\n disabled={disabled}\n {...props}\n />\n {label && <span className=\"checkbox__label\">{label}</span>}\n </label>\n );\n};\n\nexport default Checkbox;"]}
1
+ {"version":3,"sources":["../../../src/components/checkbox/checkbox.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;;AAUA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,UAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,oBAAA,EAAsB;AAAA;AACxB,GACF;AAEA,EAAA,MAAM,QAAA,GACJ,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA;AAE9B,EAAA,uBACEC,eAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,iBAAA;AAAA,QACV,IAAA,EAAK,UAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IAEC,2BACCA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EACb,iBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,gBAAA,GAAQ","file":"checkbox.cjs","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\nimport './checkbox.css';\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Checkbox: React.FC<CheckboxProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'checkbox',\n className,\n {\n 'checkbox--disabled': disabled,\n },\n );\n\n const hasLabel =\n label !== null && label !== undefined;\n\n return (\n <label className={classes}>\n <input\n className=\"checkbox__input\"\n type=\"checkbox\"\n disabled={disabled}\n {...props}\n />\n\n {hasLabel ? (\n <span className=\"checkbox__label\">\n {label}\n </span>\n ) : null}\n </label>\n );\n};\n\nexport default Checkbox;\n"]}
@@ -1,6 +1,6 @@
1
1
  .checkbox {
2
2
  /* color */
3
- --checkbox-label-color: var(--color-text);
3
+ --checkbox-label-color: inherit;
4
4
 
5
5
  color: var(--checkbox-label-color);
6
6
 
@@ -34,6 +34,7 @@
34
34
 
35
35
  .checkbox__input {
36
36
  /* color */
37
+ accent-color: var(--color-primary-2);
37
38
 
38
39
  /* typography */
39
40
 
@@ -71,10 +72,32 @@
71
72
  }
72
73
 
73
74
  .checkbox--disabled {
75
+ /* color */
76
+
77
+ /* typography */
78
+
79
+ /* size */
80
+
81
+ /* border */
82
+
83
+ /* depth */
84
+
85
+ /* motion */
74
86
  opacity: var(--checkbox-opacity-disabled);
75
87
  cursor: not-allowed;
76
88
  }
77
89
 
78
90
  .checkbox__input:disabled {
91
+ /* color */
92
+
93
+ /* typography */
94
+
95
+ /* size */
96
+
97
+ /* border */
98
+
99
+ /* depth */
100
+
101
+ /* motion */
79
102
  cursor: not-allowed;
80
103
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import './checkbox.css';
2
3
  export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
4
  label?: React.ReactNode;
4
5
  }
@@ -1,5 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { classnames } from '../helpers/classnames';
3
+ import './checkbox.css';
3
4
 
4
5
  const Checkbox = ({
5
6
  label,
@@ -14,6 +15,7 @@ const Checkbox = ({
14
15
  "checkbox--disabled": disabled
15
16
  }
16
17
  );
18
+ const hasLabel = label !== null && label !== void 0;
17
19
  return /* @__PURE__ */ jsxs("label", { className: classes, children: [
18
20
  /* @__PURE__ */ jsx(
19
21
  "input",
@@ -24,7 +26,7 @@ const Checkbox = ({
24
26
  ...props
25
27
  }
26
28
  ),
27
- label && /* @__PURE__ */ jsx("span", { className: "checkbox__label", children: label })
29
+ hasLabel ? /* @__PURE__ */ jsx("span", { className: "checkbox__label", children: label }) : null
28
30
  ] });
29
31
  };
30
32
  var checkbox_default = Checkbox;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":";;;AASA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,UAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,oBAAA,EAAsB;AAAA;AACxB,GACF;AAEA,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,iBAAA;AAAA,QACV,IAAA,EAAK,UAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,oBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mBAAmB,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EACrD,CAAA;AAEJ,CAAA;AAEA,IAAO,gBAAA,GAAQ","file":"checkbox.js","sourcesContent":["import React from 'react';\n//import './checkbox.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Checkbox: React.FC<CheckboxProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'checkbox',\n className,\n {\n 'checkbox--disabled': disabled,\n }\n );\n\n return (\n <label className={classes}>\n <input\n className=\"checkbox__input\"\n type=\"checkbox\"\n disabled={disabled}\n {...props}\n />\n {label && <span className=\"checkbox__label\">{label}</span>}\n </label>\n );\n};\n\nexport default Checkbox;"]}
1
+ {"version":3,"sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":";;;;AAUA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,UAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,oBAAA,EAAsB;AAAA;AACxB,GACF;AAEA,EAAA,MAAM,QAAA,GACJ,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA;AAE9B,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,iBAAA;AAAA,QACV,IAAA,EAAK,UAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IAEC,2BACC,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EACb,iBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,gBAAA,GAAQ","file":"checkbox.js","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\nimport './checkbox.css';\n\nexport interface CheckboxProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Checkbox: React.FC<CheckboxProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'checkbox',\n className,\n {\n 'checkbox--disabled': disabled,\n },\n );\n\n const hasLabel =\n label !== null && label !== undefined;\n\n return (\n <label className={classes}>\n <input\n className=\"checkbox__input\"\n type=\"checkbox\"\n disabled={disabled}\n {...props}\n />\n\n {hasLabel ? (\n <span className=\"checkbox__label\">\n {label}\n </span>\n ) : null}\n </label>\n );\n};\n\nexport default Checkbox;\n"]}
@@ -3,39 +3,59 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var classnames = require('../helpers/classnames');
5
5
 
6
+ function hasContent(value) {
7
+ return value !== null && value !== void 0;
8
+ }
6
9
  const Field = ({
7
10
  label,
8
11
  hint,
9
12
  error,
13
+ action,
10
14
  required = false,
11
15
  disabled = false,
12
16
  htmlFor,
13
17
  className = "",
14
- children
18
+ children,
19
+ ...props
15
20
  }) => {
21
+ const hasLabel = hasContent(label);
22
+ const hasError = hasContent(error);
23
+ const hasHint = hasContent(hint);
24
+ const hasAction = hasContent(action);
16
25
  const classes = classnames.classnames(
17
26
  "field",
18
27
  className,
19
28
  {
20
29
  "field--disabled": disabled,
21
- "field--error": !!error
30
+ "field--error": hasError
31
+ }
32
+ );
33
+ return /* @__PURE__ */ jsxRuntime.jsxs(
34
+ "div",
35
+ {
36
+ className: classes,
37
+ ...props,
38
+ children: [
39
+ hasLabel && /* @__PURE__ */ jsxRuntime.jsxs(
40
+ "label",
41
+ {
42
+ className: "field__label",
43
+ htmlFor,
44
+ children: [
45
+ label,
46
+ required && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "field__required", children: [
47
+ " ",
48
+ "*"
49
+ ] })
50
+ ]
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__control", children }),
54
+ hasError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__message field__message--error", children: error }) : hasHint ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__message", children: hint }) : null,
55
+ hasAction && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__action", children: action })
56
+ ]
22
57
  }
23
58
  );
24
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
25
- label && /* @__PURE__ */ jsxRuntime.jsxs(
26
- "label",
27
- {
28
- className: "field__label",
29
- htmlFor,
30
- children: [
31
- label,
32
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "field__required", children: " *" })
33
- ]
34
- }
35
- ),
36
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__control", children }),
37
- error ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__message field__message--error", children: error }) : hint ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "field__message", children: hint }) : null
38
- ] });
39
59
  };
40
60
  var field_default = Field;
41
61
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/field/field.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;AAeA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,QAAA,GAAW,KAAA;AAAA,EACX,OAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB,QAAA;AAAA,MACnB,cAAA,EAAgB,CAAC,CAAC;AAAA;AACpB,GACF;AAEA,EAAA,uBACEC,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,EACb,QAAA,EAAA;AAAA,IAAA,KAAA,oBACCA,eAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,OAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA;AAAA,UACA,QAAA,oBAAYC,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mBAAkB,QAAA,EAAA,IAAA,EAAE;AAAA;AAAA;AAAA,KACnD;AAAA,oBAGFA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EACH,CAAA;AAAA,IAEC,KAAA,mBACCA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sCAAA,EACZ,QAAA,EAAA,KAAA,EACH,CAAA,GACE,IAAA,mBACFA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,gBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"field.cjs","sourcesContent":["import React from 'react';\n//import './field.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface FieldProps {\n label?: React.ReactNode;\n hint?: React.ReactNode;\n error?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n htmlFor?: string;\n className?: string;\n children: React.ReactNode;\n}\n\nconst Field: React.FC<FieldProps> = ({\n label,\n hint,\n error,\n required = false,\n disabled = false,\n htmlFor,\n className = '',\n children,\n}) => {\n const classes = classnames(\n 'field',\n className,\n {\n 'field--disabled': disabled,\n 'field--error': !!error,\n }\n );\n\n return (\n <div className={classes}>\n {label && (\n <label\n className=\"field__label\"\n htmlFor={htmlFor}\n >\n {label}\n {required && <span className=\"field__required\"> *</span>}\n </label>\n )}\n\n <div className=\"field__control\">\n {children}\n </div>\n\n {error ? (\n <div className=\"field__message field__message--error\">\n {error}\n </div>\n ) : hint ? (\n <div className=\"field__message\">\n {hint}\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Field;"]}
1
+ {"version":3,"sources":["../../../src/components/field/field.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;AAmBA,SAAS,WACP,KAAA,EAIA;AACA,EAAA,OAAO,KAAA,KAAU,QAAQ,KAAA,KAAU,MAAA;AACrC;AAEA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,QAAA,GAAW,KAAA;AAAA,EACX,OAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,QAAA,GAAW,WAAW,KAAK,CAAA;AACjC,EAAA,MAAM,QAAA,GAAW,WAAW,KAAK,CAAA;AACjC,EAAA,MAAM,OAAA,GAAU,WAAW,IAAI,CAAA;AAC/B,EAAA,MAAM,SAAA,GAAY,WAAW,MAAM,CAAA;AAEnC,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB,QAAA;AAAA,MACnB,cAAA,EAAgB;AAAA;AAClB,GACF;AAEA,EAAA,uBACEC,eAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACV,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA,oBACCA,eAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAU,cAAA;AAAA,YACV,OAAA;AAAA,YAEC,QAAA,EAAA;AAAA,cAAA,KAAA;AAAA,cAEA,QAAA,oBACCA,eAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EACb,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBAAI;AAAA,eAAA,EAEP;AAAA;AAAA;AAAA,SAEJ;AAAA,wBAGFC,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EACH,CAAA;AAAA,QAEC,QAAA,mBACCA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sCAAA,EACZ,QAAA,EAAA,KAAA,EACH,CAAA,GACE,OAAA,mBACFA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,gBACH,CAAA,GACE,IAAA;AAAA,QAEH,SAAA,oBACCA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBACZ,QAAA,EAAA,MAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"field.cjs","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\n\nexport interface FieldProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n > {\n label?: React.ReactNode;\n hint?: React.ReactNode;\n error?: React.ReactNode;\n action?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n htmlFor?: string;\n children: React.ReactNode;\n}\n\nfunction hasContent(\n value: React.ReactNode,\n): value is Exclude<\n React.ReactNode,\n null | undefined\n> {\n return value !== null && value !== undefined;\n}\n\nconst Field: React.FC<FieldProps> = ({\n label,\n hint,\n error,\n action,\n required = false,\n disabled = false,\n htmlFor,\n className = '',\n children,\n ...props\n}) => {\n const hasLabel = hasContent(label);\n const hasError = hasContent(error);\n const hasHint = hasContent(hint);\n const hasAction = hasContent(action);\n\n const classes = classnames(\n 'field',\n className,\n {\n 'field--disabled': disabled,\n 'field--error': hasError,\n },\n );\n\n return (\n <div\n className={classes}\n {...props}\n >\n {hasLabel && (\n <label\n className=\"field__label\"\n htmlFor={htmlFor}\n >\n {label}\n\n {required && (\n <span className=\"field__required\">\n {' '}\n *\n </span>\n )}\n </label>\n )}\n\n <div className=\"field__control\">\n {children}\n </div>\n\n {hasError ? (\n <div className=\"field__message field__message--error\">\n {error}\n </div>\n ) : hasHint ? (\n <div className=\"field__message\">\n {hint}\n </div>\n ) : null}\n\n {hasAction && (\n <div className=\"field__action\">\n {action}\n </div>\n )}\n </div>\n );\n};\n\nexport default Field;\n"]}
@@ -108,6 +108,23 @@
108
108
  /* motion */
109
109
  }
110
110
 
111
+ .field__action {
112
+ /* color */
113
+
114
+ /* typography */
115
+
116
+ /* size */
117
+ display: flex;
118
+ align-items: flex-start;
119
+ width: 100%;
120
+
121
+ /* border */
122
+
123
+ /* depth */
124
+
125
+ /* motion */
126
+ }
127
+
111
128
  .field--disabled {
112
129
  opacity: var(--field-opacity-disabled);
113
130
  }
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- export interface FieldProps {
2
+ export interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
3
3
  label?: React.ReactNode;
4
4
  hint?: React.ReactNode;
5
5
  error?: React.ReactNode;
6
+ action?: React.ReactNode;
6
7
  required?: boolean;
7
8
  disabled?: boolean;
8
9
  htmlFor?: string;
9
- className?: string;
10
10
  children: React.ReactNode;
11
11
  }
12
12
  declare const Field: React.FC<FieldProps>;
@@ -1,39 +1,59 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { classnames } from '../helpers/classnames';
3
3
 
4
+ function hasContent(value) {
5
+ return value !== null && value !== void 0;
6
+ }
4
7
  const Field = ({
5
8
  label,
6
9
  hint,
7
10
  error,
11
+ action,
8
12
  required = false,
9
13
  disabled = false,
10
14
  htmlFor,
11
15
  className = "",
12
- children
16
+ children,
17
+ ...props
13
18
  }) => {
19
+ const hasLabel = hasContent(label);
20
+ const hasError = hasContent(error);
21
+ const hasHint = hasContent(hint);
22
+ const hasAction = hasContent(action);
14
23
  const classes = classnames(
15
24
  "field",
16
25
  className,
17
26
  {
18
27
  "field--disabled": disabled,
19
- "field--error": !!error
28
+ "field--error": hasError
29
+ }
30
+ );
31
+ return /* @__PURE__ */ jsxs(
32
+ "div",
33
+ {
34
+ className: classes,
35
+ ...props,
36
+ children: [
37
+ hasLabel && /* @__PURE__ */ jsxs(
38
+ "label",
39
+ {
40
+ className: "field__label",
41
+ htmlFor,
42
+ children: [
43
+ label,
44
+ required && /* @__PURE__ */ jsxs("span", { className: "field__required", children: [
45
+ " ",
46
+ "*"
47
+ ] })
48
+ ]
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx("div", { className: "field__control", children }),
52
+ hasError ? /* @__PURE__ */ jsx("div", { className: "field__message field__message--error", children: error }) : hasHint ? /* @__PURE__ */ jsx("div", { className: "field__message", children: hint }) : null,
53
+ hasAction && /* @__PURE__ */ jsx("div", { className: "field__action", children: action })
54
+ ]
20
55
  }
21
56
  );
22
- return /* @__PURE__ */ jsxs("div", { className: classes, children: [
23
- label && /* @__PURE__ */ jsxs(
24
- "label",
25
- {
26
- className: "field__label",
27
- htmlFor,
28
- children: [
29
- label,
30
- required && /* @__PURE__ */ jsx("span", { className: "field__required", children: " *" })
31
- ]
32
- }
33
- ),
34
- /* @__PURE__ */ jsx("div", { className: "field__control", children }),
35
- error ? /* @__PURE__ */ jsx("div", { className: "field__message field__message--error", children: error }) : hint ? /* @__PURE__ */ jsx("div", { className: "field__message", children: hint }) : null
36
- ] });
37
57
  };
38
58
  var field_default = Field;
39
59
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/field/field.tsx"],"names":[],"mappings":";;;AAeA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,QAAA,GAAW,KAAA;AAAA,EACX,OAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB,QAAA;AAAA,MACnB,cAAA,EAAgB,CAAC,CAAC;AAAA;AACpB,GACF;AAEA,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,EACb,QAAA,EAAA;AAAA,IAAA,KAAA,oBACC,IAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,OAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA;AAAA,UACA,QAAA,oBAAY,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mBAAkB,QAAA,EAAA,IAAA,EAAE;AAAA;AAAA;AAAA,KACnD;AAAA,oBAGF,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EACH,CAAA;AAAA,IAEC,KAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sCAAA,EACZ,QAAA,EAAA,KAAA,EACH,CAAA,GACE,IAAA,mBACF,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,gBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"field.js","sourcesContent":["import React from 'react';\n//import './field.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface FieldProps {\n label?: React.ReactNode;\n hint?: React.ReactNode;\n error?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n htmlFor?: string;\n className?: string;\n children: React.ReactNode;\n}\n\nconst Field: React.FC<FieldProps> = ({\n label,\n hint,\n error,\n required = false,\n disabled = false,\n htmlFor,\n className = '',\n children,\n}) => {\n const classes = classnames(\n 'field',\n className,\n {\n 'field--disabled': disabled,\n 'field--error': !!error,\n }\n );\n\n return (\n <div className={classes}>\n {label && (\n <label\n className=\"field__label\"\n htmlFor={htmlFor}\n >\n {label}\n {required && <span className=\"field__required\"> *</span>}\n </label>\n )}\n\n <div className=\"field__control\">\n {children}\n </div>\n\n {error ? (\n <div className=\"field__message field__message--error\">\n {error}\n </div>\n ) : hint ? (\n <div className=\"field__message\">\n {hint}\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Field;"]}
1
+ {"version":3,"sources":["../../../src/components/field/field.tsx"],"names":[],"mappings":";;;AAmBA,SAAS,WACP,KAAA,EAIA;AACA,EAAA,OAAO,KAAA,KAAU,QAAQ,KAAA,KAAU,MAAA;AACrC;AAEA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,QAAA,GAAW,KAAA;AAAA,EACX,OAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,QAAA,GAAW,WAAW,KAAK,CAAA;AACjC,EAAA,MAAM,QAAA,GAAW,WAAW,KAAK,CAAA;AACjC,EAAA,MAAM,OAAA,GAAU,WAAW,IAAI,CAAA;AAC/B,EAAA,MAAM,SAAA,GAAY,WAAW,MAAM,CAAA;AAEnC,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB,QAAA;AAAA,MACnB,cAAA,EAAgB;AAAA;AAClB,GACF;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACV,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA,oBACC,IAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAU,cAAA;AAAA,YACV,OAAA;AAAA,YAEC,QAAA,EAAA;AAAA,cAAA,KAAA;AAAA,cAEA,QAAA,oBACC,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EACb,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBAAI;AAAA,eAAA,EAEP;AAAA;AAAA;AAAA,SAEJ;AAAA,wBAGF,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EACH,CAAA;AAAA,QAEC,QAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sCAAA,EACZ,QAAA,EAAA,KAAA,EACH,CAAA,GACE,OAAA,mBACF,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,gBACH,CAAA,GACE,IAAA;AAAA,QAEH,SAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBACZ,QAAA,EAAA,MAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"field.js","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\n\nexport interface FieldProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n > {\n label?: React.ReactNode;\n hint?: React.ReactNode;\n error?: React.ReactNode;\n action?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n htmlFor?: string;\n children: React.ReactNode;\n}\n\nfunction hasContent(\n value: React.ReactNode,\n): value is Exclude<\n React.ReactNode,\n null | undefined\n> {\n return value !== null && value !== undefined;\n}\n\nconst Field: React.FC<FieldProps> = ({\n label,\n hint,\n error,\n action,\n required = false,\n disabled = false,\n htmlFor,\n className = '',\n children,\n ...props\n}) => {\n const hasLabel = hasContent(label);\n const hasError = hasContent(error);\n const hasHint = hasContent(hint);\n const hasAction = hasContent(action);\n\n const classes = classnames(\n 'field',\n className,\n {\n 'field--disabled': disabled,\n 'field--error': hasError,\n },\n );\n\n return (\n <div\n className={classes}\n {...props}\n >\n {hasLabel && (\n <label\n className=\"field__label\"\n htmlFor={htmlFor}\n >\n {label}\n\n {required && (\n <span className=\"field__required\">\n {' '}\n *\n </span>\n )}\n </label>\n )}\n\n <div className=\"field__control\">\n {children}\n </div>\n\n {hasError ? (\n <div className=\"field__message field__message--error\">\n {error}\n </div>\n ) : hasHint ? (\n <div className=\"field__message\">\n {hint}\n </div>\n ) : null}\n\n {hasAction && (\n <div className=\"field__action\">\n {action}\n </div>\n )}\n </div>\n );\n};\n\nexport default Field;\n"]}
@@ -2,6 +2,7 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var classnames = require('../helpers/classnames');
5
+ require('./radio.css');
5
6
 
6
7
  const Radio = ({
7
8
  label,
@@ -16,6 +17,7 @@ const Radio = ({
16
17
  "radio--disabled": disabled
17
18
  }
18
19
  );
20
+ const hasLabel = label !== null && label !== void 0;
19
21
  return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: classes, children: [
20
22
  /* @__PURE__ */ jsxRuntime.jsx(
21
23
  "input",
@@ -26,7 +28,7 @@ const Radio = ({
26
28
  ...props
27
29
  }
28
30
  ),
29
- label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "radio__label", children: label })
31
+ hasLabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "radio__label", children: label }) : null
30
32
  ] });
31
33
  };
32
34
  var radio_default = Radio;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/radio/radio.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;AASA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB;AAAA;AACrB,GACF;AAEA,EAAA,uBACEC,eAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,IAAA,EAAK,OAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,oBAASA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,gBAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAClD,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"radio.cjs","sourcesContent":["import React from 'react';\n//import './radio.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Radio: React.FC<RadioProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'radio',\n className,\n {\n 'radio--disabled': disabled,\n }\n );\n\n return (\n <label className={classes}>\n <input\n className=\"radio__input\"\n type=\"radio\"\n disabled={disabled}\n {...props}\n />\n {label && <span className=\"radio__label\">{label}</span>}\n </label>\n );\n};\n\nexport default Radio;"]}
1
+ {"version":3,"sources":["../../../src/components/radio/radio.tsx"],"names":["classnames","jsxs","jsx"],"mappings":";;;;;;AAUA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB;AAAA;AACrB,GACF;AAEA,EAAA,MAAM,QAAA,GACJ,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA;AAE9B,EAAA,uBACEC,eAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAAC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,IAAA,EAAK,OAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IAEC,2BACCA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,cAAA,EACb,iBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"radio.cjs","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\nimport './radio.css';\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Radio: React.FC<RadioProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'radio',\n className,\n {\n 'radio--disabled': disabled,\n },\n );\n\n const hasLabel =\n label !== null && label !== undefined;\n\n return (\n <label className={classes}>\n <input\n className=\"radio__input\"\n type=\"radio\"\n disabled={disabled}\n {...props}\n />\n\n {hasLabel ? (\n <span className=\"radio__label\">\n {label}\n </span>\n ) : null}\n </label>\n );\n};\n\nexport default Radio;\n"]}
@@ -1,6 +1,6 @@
1
1
  .radio {
2
2
  /* color */
3
- --radio-label-color: var(--color-text);
3
+ --radio-label-color: auto;
4
4
 
5
5
  color: var(--radio-label-color);
6
6
 
@@ -40,6 +40,7 @@
40
40
 
41
41
  .radio__input {
42
42
  /* color */
43
+ accent-color: var(--color-primary-2);
43
44
 
44
45
  /* typography */
45
46
 
@@ -71,10 +72,32 @@
71
72
  }
72
73
 
73
74
  .radio--disabled {
75
+ /* color */
76
+
77
+ /* typography */
78
+
79
+ /* size */
80
+
81
+ /* border */
82
+
83
+ /* depth */
84
+
85
+ /* motion */
74
86
  opacity: var(--radio-opacity-disabled);
75
87
  cursor: not-allowed;
76
88
  }
77
89
 
78
90
  .radio__input:disabled {
91
+ /* color */
92
+
93
+ /* typography */
94
+
95
+ /* size */
96
+
97
+ /* border */
98
+
99
+ /* depth */
100
+
101
+ /* motion */
79
102
  cursor: not-allowed;
80
103
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import './radio.css';
2
3
  export interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
4
  label?: React.ReactNode;
4
5
  }
@@ -1,5 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { classnames } from '../helpers/classnames';
3
+ import './radio.css';
3
4
 
4
5
  const Radio = ({
5
6
  label,
@@ -14,6 +15,7 @@ const Radio = ({
14
15
  "radio--disabled": disabled
15
16
  }
16
17
  );
18
+ const hasLabel = label !== null && label !== void 0;
17
19
  return /* @__PURE__ */ jsxs("label", { className: classes, children: [
18
20
  /* @__PURE__ */ jsx(
19
21
  "input",
@@ -24,7 +26,7 @@ const Radio = ({
24
26
  ...props
25
27
  }
26
28
  ),
27
- label && /* @__PURE__ */ jsx("span", { className: "radio__label", children: label })
29
+ hasLabel ? /* @__PURE__ */ jsx("span", { className: "radio__label", children: label }) : null
28
30
  ] });
29
31
  };
30
32
  var radio_default = Radio;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/radio/radio.tsx"],"names":[],"mappings":";;;AASA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB;AAAA;AACrB,GACF;AAEA,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,IAAA,EAAK,OAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,oBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,gBAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAClD,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"radio.js","sourcesContent":["import React from 'react';\n//import './radio.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Radio: React.FC<RadioProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'radio',\n className,\n {\n 'radio--disabled': disabled,\n }\n );\n\n return (\n <label className={classes}>\n <input\n className=\"radio__input\"\n type=\"radio\"\n disabled={disabled}\n {...props}\n />\n {label && <span className=\"radio__label\">{label}</span>}\n </label>\n );\n};\n\nexport default Radio;"]}
1
+ {"version":3,"sources":["../../../src/components/radio/radio.tsx"],"names":[],"mappings":";;;;AAUA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,iBAAA,EAAmB;AAAA;AACrB,GACF;AAEA,EAAA,MAAM,QAAA,GACJ,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA;AAE9B,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,OAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,cAAA;AAAA,QACV,IAAA,EAAK,OAAA;AAAA,QACL,QAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,IAEC,2BACC,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,cAAA,EACb,iBACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"radio.js","sourcesContent":["import React from 'react';\n\nimport { classnames } from '../helpers/classnames';\nimport './radio.css';\n\nexport interface RadioProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: React.ReactNode;\n}\n\nconst Radio: React.FC<RadioProps> = ({\n label,\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames(\n 'radio',\n className,\n {\n 'radio--disabled': disabled,\n },\n );\n\n const hasLabel =\n label !== null && label !== undefined;\n\n return (\n <label className={classes}>\n <input\n className=\"radio__input\"\n type=\"radio\"\n disabled={disabled}\n {...props}\n />\n\n {hasLabel ? (\n <span className=\"radio__label\">\n {label}\n </span>\n ) : null}\n </label>\n );\n};\n\nexport default Radio;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jvetrau-ds",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Multi-brand React design system with semantic tokens",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/styles.css CHANGED
@@ -568,25 +568,69 @@
568
568
  }
569
569
 
570
570
  .button:hover {
571
+ /* color */
572
+
573
+ /* typography */
574
+
575
+ /* size */
576
+
577
+ /* border */
578
+
579
+ /* depth */
580
+
581
+ /* motion */
571
582
  opacity: var(--button-opacity-hover);
572
583
  }
573
584
 
574
585
  .button:focus-visible {
586
+ /* color */
587
+
588
+ /* typography */
589
+
590
+ /* size */
591
+
592
+ /* border */
575
593
  outline:
576
594
  var(--button-focus-width)
577
595
  solid
578
596
  var(--button-focus-color);
579
597
  outline-offset: var(--button-focus-offset);
598
+
599
+ /* depth */
600
+
601
+ /* motion */
580
602
  }
581
603
 
582
604
  .button:active {
605
+ /* color */
606
+
607
+ /* typography */
608
+
609
+ /* size */
610
+
611
+ /* border */
612
+
613
+ /* depth */
614
+
615
+ /* motion */
583
616
  opacity: var(--button-opacity-active);
584
617
  }
585
618
 
586
619
  .button:disabled,
587
620
  .button--disabled {
621
+ /* color */
588
622
  background: var(--button-bg-disabled);
589
623
  color: var(--button-color-disabled);
624
+
625
+ /* typography */
626
+
627
+ /* size */
628
+
629
+ /* border */
630
+
631
+ /* depth */
632
+
633
+ /* motion */
590
634
  opacity: var(--button-opacity-disabled);
591
635
  cursor: not-allowed;
592
636
  }
@@ -594,25 +638,66 @@
594
638
  /* Rank */
595
639
 
596
640
  .button--primary {
641
+ /* color */
597
642
  --button-bg: var(--color-primary-2);
598
643
  --button-color: var(--color-text-primary-2);
599
644
  --button-focus-color: var(--color-primary-2);
645
+
646
+ /* typography */
647
+
648
+ /* size */
649
+
650
+ /* border */
651
+
652
+ /* depth */
653
+
654
+ /* motion */
600
655
  }
601
656
 
602
657
  .button--link {
658
+ /* color */
603
659
  --button-bg: transparent;
604
660
  --button-color: var(--color-link);
605
661
  --button-focus-color: var(--color-link);
662
+
663
+ /* typography */
664
+
665
+ /* size */
666
+ height: auto;
667
+ min-height: 0;
668
+ padding: 0;
669
+
670
+ /* border */
671
+
672
+ /* depth */
673
+
674
+ /* motion */
606
675
  }
607
676
 
608
677
  .button--link:disabled,
609
678
  .button--link.button--disabled {
679
+ /* color */
610
680
  background: transparent;
681
+
682
+ /* typography */
683
+
684
+ /* size */
685
+
686
+ /* border */
687
+
688
+ /* depth */
689
+
690
+ /* motion */
611
691
  }
612
692
 
613
693
  /* Density */
614
694
 
615
695
  .button--compact {
696
+ /* color */
697
+
698
+ /* typography */
699
+
700
+ /* size */
616
701
  /*
617
702
  * Compact presentation is intentionally left
618
703
  * token-driven but visually unfinished.
@@ -620,27 +705,66 @@
620
705
  * Add compact control dimensions when the
621
706
  * corresponding semantic tokens are available.
622
707
  */
708
+
709
+ /* border */
710
+
711
+ /* depth */
712
+
713
+ /* motion */
623
714
  }
624
715
 
625
716
  /* Mode */
626
717
 
627
718
  .button--toolbar {
719
+ /* color */
628
720
  --button-bg: transparent;
629
721
  --button-color: var(--color-text);
630
722
  --button-focus-color: var(--color-text);
631
723
 
632
724
  background: transparent;
725
+
726
+ /* typography */
727
+
728
+ /* size */
633
729
  padding-inline: 0;
730
+
731
+ /* border */
732
+
733
+ /* depth */
734
+
735
+ /* motion */
634
736
  }
635
737
 
636
738
  .button--toolbar:disabled,
637
739
  .button--toolbar.button--disabled {
740
+ /* color */
638
741
  background: transparent;
742
+
743
+ /* typography */
744
+
745
+ /* size */
746
+
747
+ /* border */
748
+
749
+ /* depth */
750
+
751
+ /* motion */
639
752
  }
640
753
 
641
754
  /* State */
642
755
 
643
756
  .button--loading {
757
+ /* color */
758
+
759
+ /* typography */
760
+
761
+ /* size */
762
+
763
+ /* border */
764
+
765
+ /* depth */
766
+
767
+ /* motion */
644
768
  /*
645
769
  * Loading behavior is already defined by the
646
770
  * component contract:
@@ -654,11 +778,33 @@
654
778
  /* Content */
655
779
 
656
780
  .button--icon-only {
781
+ /* color */
782
+
783
+ /* typography */
784
+
785
+ /* size */
657
786
  padding-inline: var(--button-padding-icon-only);
787
+
788
+ /* border */
789
+
790
+ /* depth */
791
+
792
+ /* motion */
658
793
  }
659
794
 
660
795
  .button--toolbar.button--icon-only {
796
+ /* color */
797
+
798
+ /* typography */
799
+
800
+ /* size */
661
801
  padding-inline: 0;
802
+
803
+ /* border */
804
+
805
+ /* depth */
806
+
807
+ /* motion */
662
808
  }
663
809
 
664
810
  /* src/components/calendar-month/calendar-month.css */
@@ -1095,7 +1241,7 @@
1095
1241
  /* src/components/checkbox/checkbox.css */
1096
1242
  .checkbox {
1097
1243
  /* color */
1098
- --checkbox-label-color: var(--color-text);
1244
+ --checkbox-label-color: inherit;
1099
1245
 
1100
1246
  color: var(--checkbox-label-color);
1101
1247
 
@@ -1129,6 +1275,7 @@
1129
1275
 
1130
1276
  .checkbox__input {
1131
1277
  /* color */
1278
+ accent-color: var(--color-primary-2);
1132
1279
 
1133
1280
  /* typography */
1134
1281
 
@@ -1166,11 +1313,33 @@
1166
1313
  }
1167
1314
 
1168
1315
  .checkbox--disabled {
1316
+ /* color */
1317
+
1318
+ /* typography */
1319
+
1320
+ /* size */
1321
+
1322
+ /* border */
1323
+
1324
+ /* depth */
1325
+
1326
+ /* motion */
1169
1327
  opacity: var(--checkbox-opacity-disabled);
1170
1328
  cursor: not-allowed;
1171
1329
  }
1172
1330
 
1173
1331
  .checkbox__input:disabled {
1332
+ /* color */
1333
+
1334
+ /* typography */
1335
+
1336
+ /* size */
1337
+
1338
+ /* border */
1339
+
1340
+ /* depth */
1341
+
1342
+ /* motion */
1174
1343
  cursor: not-allowed;
1175
1344
  }
1176
1345
 
@@ -2230,6 +2399,23 @@
2230
2399
  /* motion */
2231
2400
  }
2232
2401
 
2402
+ .field__action {
2403
+ /* color */
2404
+
2405
+ /* typography */
2406
+
2407
+ /* size */
2408
+ display: flex;
2409
+ align-items: flex-start;
2410
+ width: 100%;
2411
+
2412
+ /* border */
2413
+
2414
+ /* depth */
2415
+
2416
+ /* motion */
2417
+ }
2418
+
2233
2419
  .field--disabled {
2234
2420
  opacity: var(--field-opacity-disabled);
2235
2421
  }
@@ -3396,7 +3582,7 @@
3396
3582
  /* src/components/radio/radio.css */
3397
3583
  .radio {
3398
3584
  /* color */
3399
- --radio-label-color: var(--color-text);
3585
+ --radio-label-color: auto;
3400
3586
 
3401
3587
  color: var(--radio-label-color);
3402
3588
 
@@ -3436,6 +3622,7 @@
3436
3622
 
3437
3623
  .radio__input {
3438
3624
  /* color */
3625
+ accent-color: var(--color-primary-2);
3439
3626
 
3440
3627
  /* typography */
3441
3628
 
@@ -3467,11 +3654,33 @@
3467
3654
  }
3468
3655
 
3469
3656
  .radio--disabled {
3657
+ /* color */
3658
+
3659
+ /* typography */
3660
+
3661
+ /* size */
3662
+
3663
+ /* border */
3664
+
3665
+ /* depth */
3666
+
3667
+ /* motion */
3470
3668
  opacity: var(--radio-opacity-disabled);
3471
3669
  cursor: not-allowed;
3472
3670
  }
3473
3671
 
3474
3672
  .radio__input:disabled {
3673
+ /* color */
3674
+
3675
+ /* typography */
3676
+
3677
+ /* size */
3678
+
3679
+ /* border */
3680
+
3681
+ /* depth */
3682
+
3683
+ /* motion */
3475
3684
  cursor: not-allowed;
3476
3685
  }
3477
3686