@dnanpm/ui-components 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/components/Accordion/Accordion.css +4 -4
- package/dist/components/Accordion/Accordion.module.css.cjs +3 -3
- package/dist/components/Accordion/Accordion.module.css.js +3 -3
- package/dist/components/AccordionItem/AccordionItem.css +18 -18
- package/dist/components/AccordionItem/AccordionItem.module.css.cjs +11 -11
- package/dist/components/AccordionItem/AccordionItem.module.css.js +11 -11
- package/dist/components/Breadcrumb/Breadcrumb.css +11 -12
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +6 -6
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js +6 -6
- package/dist/components/Button/Button.cjs +3 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.css +33 -33
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +3 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.module.css.cjs +11 -11
- package/dist/components/Button/Button.module.css.js +11 -11
- package/dist/components/Hero/Hero.cjs +29 -38
- package/dist/components/Hero/Hero.cjs.map +1 -1
- package/dist/components/Hero/Hero.css +64 -60
- package/dist/components/Hero/Hero.d.ts.map +1 -1
- package/dist/components/Hero/Hero.js +29 -38
- package/dist/components/Hero/Hero.js.map +1 -1
- package/dist/components/Hero/Hero.module.css.cjs +20 -19
- package/dist/components/Hero/Hero.module.css.cjs.map +1 -1
- package/dist/components/Hero/Hero.module.css.js +20 -19
- package/dist/components/Hero/Hero.module.css.js.map +1 -1
- package/dist/components/Hero/Hero.types.d.ts +1 -5
- package/dist/components/Hero/Hero.types.d.ts.map +1 -1
- package/dist/components/Hero/Hero.utils.cjs +2 -1
- package/dist/components/Hero/Hero.utils.cjs.map +1 -1
- package/dist/components/Hero/Hero.utils.d.ts.map +1 -1
- package/dist/components/Hero/Hero.utils.js +2 -1
- package/dist/components/Hero/Hero.utils.js.map +1 -1
- package/dist/components/IconButton/IconButton.cjs +123 -0
- package/dist/components/IconButton/IconButton.cjs.map +1 -0
- package/dist/components/IconButton/IconButton.css +181 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -0
- package/dist/components/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.js +123 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/IconButton/IconButton.module.css.cjs +15 -0
- package/dist/components/IconButton/IconButton.module.css.cjs.map +1 -0
- package/dist/components/IconButton/IconButton.module.css.js +16 -0
- package/dist/components/IconButton/IconButton.module.css.js.map +1 -0
- package/dist/components/IconButton/IconButton.types.d.ts +57 -0
- package/dist/components/IconButton/IconButton.types.d.ts.map +1 -0
- package/dist/components/IconButton/index.d.ts +3 -0
- package/dist/components/IconButton/index.d.ts.map +1 -0
- package/dist/components/Label/Label.css +13 -8
- package/dist/components/Label/Label.module.css.cjs +7 -7
- package/dist/components/Label/Label.module.css.js +7 -7
- package/dist/components/Notification/Notification.css +14 -14
- package/dist/components/Notification/Notification.module.css.cjs +9 -9
- package/dist/components/Notification/Notification.module.css.js +9 -9
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/utils/elevation.css +20 -17
- package/dist/styles/utils/elevation.module.css.cjs +4 -4
- package/dist/styles/utils/elevation.module.css.js +4 -4
- package/dist/styles/utils/focus.css +14 -14
- package/dist/styles/utils/focus.module.css.cjs +3 -3
- package/dist/styles/utils/focus.module.css.js +3 -3
- package/dist/styles.css +117 -85
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,9 @@ function App() {
|
|
|
45
45
|
|
|
46
46
|
## Implementation Model
|
|
47
47
|
|
|
48
|
-
Components are written as plain React function components with CSS Modules and BEM naming. Design tokens are available as CSS custom properties: `var(--color-semantic-foreground-default)`, `var(--spacing-
|
|
48
|
+
Components are written as plain React function components with CSS Modules and BEM naming. Design tokens are available as CSS custom properties: `var(--color-semantic-foreground-default)`, `var(--spacing-space-16)`, etc.
|
|
49
|
+
|
|
50
|
+
Typography is applied through the font shorthand presets from `@dnanpm/design-tokens` — `font: var(--typography-body-md)` — rather than by setting `font-family` and friends individually. `@dnanpm/ui-components/styles.css` includes those presets, so no extra import is needed.
|
|
49
51
|
|
|
50
52
|
### Tree-shaking
|
|
51
53
|
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* Layout wrapper that spaces AccordionItem children evenly.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
._accordion_18qm2_7 {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
._accordion--
|
|
13
|
-
gap: var(--spacing-
|
|
12
|
+
._accordion--box_18qm2_12 {
|
|
13
|
+
gap: var(--spacing-space-16);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
._accordion--
|
|
16
|
+
._accordion--panel_18qm2_16 {
|
|
17
17
|
gap: 0;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
require('./Accordion.css');
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
-
const accordion = "
|
|
4
|
+
const accordion = "_accordion_18qm2_7";
|
|
5
5
|
const styles = {
|
|
6
6
|
accordion,
|
|
7
|
-
"accordion--box": "_accordion--
|
|
8
|
-
"accordion--panel": "_accordion--
|
|
7
|
+
"accordion--box": "_accordion--box_18qm2_12",
|
|
8
|
+
"accordion--panel": "_accordion--panel_18qm2_16"
|
|
9
9
|
};
|
|
10
10
|
exports.accordion = accordion;
|
|
11
11
|
exports.default = styles;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './Accordion.css';
|
|
2
|
-
const accordion = "
|
|
2
|
+
const accordion = "_accordion_18qm2_7";
|
|
3
3
|
const styles = {
|
|
4
4
|
accordion,
|
|
5
|
-
"accordion--box": "_accordion--
|
|
6
|
-
"accordion--panel": "_accordion--
|
|
5
|
+
"accordion--box": "_accordion--box_18qm2_12",
|
|
6
|
+
"accordion--panel": "_accordion--panel_18qm2_16"
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
accordion,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
/* === Box variant === */
|
|
9
9
|
|
|
10
|
-
._accordion-item--
|
|
10
|
+
._accordion-item--box_131y1_10 {
|
|
11
11
|
background: var(--color-semantic-surface-base);
|
|
12
12
|
color: var(--color-semantic-foreground-default);
|
|
13
13
|
}
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
/* === Panel variant === */
|
|
16
16
|
/* Inherits text color from parent context intentionally */
|
|
17
17
|
|
|
18
|
-
._accordion-item--
|
|
18
|
+
._accordion-item--panel_131y1_18 {
|
|
19
19
|
border-bottom: var(--borderwidth-semantic-xs) solid var(--color-semantic-border-neutral-mid);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/* === Summary (clickable header) === */
|
|
23
23
|
|
|
24
|
-
._accordion-
|
|
24
|
+
._accordion-item__summary_131y1_24 {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
|
-
gap: var(--spacing-
|
|
28
|
-
padding: var(--spacing-
|
|
27
|
+
gap: var(--spacing-space-20);
|
|
28
|
+
padding: var(--spacing-space-16) var(--spacing-space-20);
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
list-style: none;
|
|
31
31
|
user-select: none;
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/* Remove default marker in all browsers */
|
|
36
|
-
._accordion-
|
|
37
|
-
._accordion-
|
|
36
|
+
._accordion-item__summary_131y1_24::-webkit-details-marker,
|
|
37
|
+
._accordion-item__summary_131y1_24::marker {
|
|
38
38
|
display: none;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/* === Image === */
|
|
42
42
|
|
|
43
|
-
._accordion-
|
|
43
|
+
._accordion-item__image_131y1_43 {
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
46
|
justify-content: center;
|
|
@@ -57,24 +57,24 @@
|
|
|
57
57
|
|
|
58
58
|
/* === Image size variants === */
|
|
59
59
|
|
|
60
|
-
._accordion-item__image--
|
|
60
|
+
._accordion-item__image--sm_131y1_60 {
|
|
61
61
|
width: 1.5rem;
|
|
62
62
|
height: 1.5rem;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
._accordion-item__image--
|
|
65
|
+
._accordion-item__image--md_131y1_65 {
|
|
66
66
|
width: 2.5rem;
|
|
67
67
|
height: 2.5rem;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
._accordion-item__image--
|
|
70
|
+
._accordion-item__image--lg_131y1_70 {
|
|
71
71
|
width: 5rem;
|
|
72
72
|
height: 5rem;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/* === Label === */
|
|
76
76
|
|
|
77
|
-
._accordion-
|
|
77
|
+
._accordion-item__label_131y1_77 {
|
|
78
78
|
flex: 1 1 auto;
|
|
79
79
|
min-width: 0;
|
|
80
80
|
font-weight: var(--typography-font-weight-bold);
|
|
@@ -82,21 +82,21 @@
|
|
|
82
82
|
|
|
83
83
|
/* === Chevron icon === */
|
|
84
84
|
|
|
85
|
-
._accordion-
|
|
85
|
+
._accordion-item__chevron_131y1_85 {
|
|
86
86
|
flex: 0 0 auto;
|
|
87
87
|
width: 1.5rem;
|
|
88
88
|
height: 1.5rem;
|
|
89
89
|
transition: transform 0.2s ease-in-out;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
._accordion-
|
|
92
|
+
._accordion-item_131y1_10[open] > ._accordion-item__summary_131y1_24 ._accordion-item__chevron_131y1_85 {
|
|
93
93
|
transform: rotate(180deg);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/* === Content area === */
|
|
97
97
|
|
|
98
|
-
._accordion-
|
|
99
|
-
padding: 0 var(--spacing-
|
|
98
|
+
._accordion-item__content_131y1_98 {
|
|
99
|
+
padding: 0 var(--spacing-space-20) var(--spacing-space-20);
|
|
100
100
|
|
|
101
101
|
& > *:last-child {
|
|
102
102
|
margin-bottom: 0;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/* === Animation === */
|
|
107
|
-
._accordion-
|
|
107
|
+
._accordion-item_131y1_10::details-content {
|
|
108
108
|
display: block;
|
|
109
109
|
block-size: 0;
|
|
110
110
|
opacity: 0;
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
transition-behavior: allow-discrete;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
._accordion-
|
|
119
|
+
._accordion-item_131y1_10[open]::details-content {
|
|
120
120
|
/* Fallback for browsers that don't support calc-size() function */
|
|
121
121
|
block-size: auto;
|
|
122
122
|
opacity: 1;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
require('./AccordionItem.css');
|
|
2
2
|
"use strict";
|
|
3
3
|
const styles = {
|
|
4
|
-
"accordion-item--box": "_accordion-item--
|
|
5
|
-
"accordion-item--panel": "_accordion-item--
|
|
6
|
-
"accordion-item__summary": "_accordion-
|
|
7
|
-
"accordion-item__image": "_accordion-
|
|
8
|
-
"accordion-item__image--sm": "_accordion-item__image--
|
|
9
|
-
"accordion-item__image--md": "_accordion-item__image--
|
|
10
|
-
"accordion-item__image--lg": "_accordion-item__image--
|
|
11
|
-
"accordion-item__label": "_accordion-
|
|
12
|
-
"accordion-item__chevron": "_accordion-
|
|
13
|
-
"accordion-item": "_accordion-
|
|
14
|
-
"accordion-item__content": "_accordion-
|
|
4
|
+
"accordion-item--box": "_accordion-item--box_131y1_10",
|
|
5
|
+
"accordion-item--panel": "_accordion-item--panel_131y1_18",
|
|
6
|
+
"accordion-item__summary": "_accordion-item__summary_131y1_24",
|
|
7
|
+
"accordion-item__image": "_accordion-item__image_131y1_43",
|
|
8
|
+
"accordion-item__image--sm": "_accordion-item__image--sm_131y1_60",
|
|
9
|
+
"accordion-item__image--md": "_accordion-item__image--md_131y1_65",
|
|
10
|
+
"accordion-item__image--lg": "_accordion-item__image--lg_131y1_70",
|
|
11
|
+
"accordion-item__label": "_accordion-item__label_131y1_77",
|
|
12
|
+
"accordion-item__chevron": "_accordion-item__chevron_131y1_85",
|
|
13
|
+
"accordion-item": "_accordion-item_131y1_10",
|
|
14
|
+
"accordion-item__content": "_accordion-item__content_131y1_98"
|
|
15
15
|
};
|
|
16
16
|
module.exports = styles;
|
|
17
17
|
//# sourceMappingURL=AccordionItem.module.css.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './AccordionItem.css';
|
|
2
2
|
const styles = {
|
|
3
|
-
"accordion-item--box": "_accordion-item--
|
|
4
|
-
"accordion-item--panel": "_accordion-item--
|
|
5
|
-
"accordion-item__summary": "_accordion-
|
|
6
|
-
"accordion-item__image": "_accordion-
|
|
7
|
-
"accordion-item__image--sm": "_accordion-item__image--
|
|
8
|
-
"accordion-item__image--md": "_accordion-item__image--
|
|
9
|
-
"accordion-item__image--lg": "_accordion-item__image--
|
|
10
|
-
"accordion-item__label": "_accordion-
|
|
11
|
-
"accordion-item__chevron": "_accordion-
|
|
12
|
-
"accordion-item": "_accordion-
|
|
13
|
-
"accordion-item__content": "_accordion-
|
|
3
|
+
"accordion-item--box": "_accordion-item--box_131y1_10",
|
|
4
|
+
"accordion-item--panel": "_accordion-item--panel_131y1_18",
|
|
5
|
+
"accordion-item__summary": "_accordion-item__summary_131y1_24",
|
|
6
|
+
"accordion-item__image": "_accordion-item__image_131y1_43",
|
|
7
|
+
"accordion-item__image--sm": "_accordion-item__image--sm_131y1_60",
|
|
8
|
+
"accordion-item__image--md": "_accordion-item__image--md_131y1_65",
|
|
9
|
+
"accordion-item__image--lg": "_accordion-item__image--lg_131y1_70",
|
|
10
|
+
"accordion-item__label": "_accordion-item__label_131y1_77",
|
|
11
|
+
"accordion-item__chevron": "_accordion-item__chevron_131y1_85",
|
|
12
|
+
"accordion-item": "_accordion-item_131y1_10",
|
|
13
|
+
"accordion-item__content": "_accordion-item__content_131y1_98"
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
styles as default
|
|
@@ -7,31 +7,30 @@
|
|
|
7
7
|
* Uses a container query (ch units) to switch between default and collapsed mode.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
._breadcrumb_1q2qc_10 {
|
|
11
11
|
container-name: breadcrumb;
|
|
12
12
|
container-type: inline-size;
|
|
13
13
|
width: 100%;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
._breadcrumb__list_1q2qc_17 {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
|
-
gap: var(--spacing-
|
|
21
|
-
margin: var(--spacing-
|
|
20
|
+
gap: var(--spacing-space-4);
|
|
21
|
+
margin: var(--spacing-space-20) 0;
|
|
22
22
|
padding: 0;
|
|
23
23
|
list-style: none;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
._breadcrumb__item_1q2qc_26 {
|
|
27
27
|
flex: 0 0 auto;
|
|
28
28
|
margin: 0;
|
|
29
29
|
padding: 0;
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
|
-
gap: var(--spacing-
|
|
32
|
+
gap: var(--spacing-space-4);
|
|
33
33
|
font: var(--typography-label-md);
|
|
34
|
-
line-height: 1.125rem; /* intentional: absolute line-height for visual alignment */
|
|
35
34
|
|
|
36
35
|
&:last-child {
|
|
37
36
|
min-width: 0;
|
|
@@ -43,21 +42,21 @@
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
.
|
|
45
|
+
._breadcrumb__link_1q2qc_45 {
|
|
47
46
|
color: var(--color-semantic-interactive-primary-default);
|
|
48
47
|
border-radius: var(--radius-semantic-sm);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
.
|
|
50
|
+
._breadcrumb__link_1q2qc_45:hover {
|
|
52
51
|
color: var(--color-semantic-interactive-primary-hover);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
.
|
|
54
|
+
._breadcrumb__current_1q2qc_54 {
|
|
56
55
|
overflow: hidden;
|
|
57
56
|
text-overflow: ellipsis;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
.
|
|
59
|
+
._breadcrumb__separator_1q2qc_59 {
|
|
61
60
|
flex: 0 0 auto;
|
|
62
61
|
width: 0.875rem;
|
|
63
62
|
height: 0.875rem;
|
|
@@ -66,7 +65,7 @@
|
|
|
66
65
|
|
|
67
66
|
/* Collapsed mode: hide all items except the last two */
|
|
68
67
|
@container breadcrumb (max-width: 75ch) {
|
|
69
|
-
.
|
|
68
|
+
._breadcrumb__item_1q2qc_26:not(:nth-last-child(-n + 2)) {
|
|
70
69
|
display: none;
|
|
71
70
|
}
|
|
72
71
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require('./Breadcrumb.css');
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
-
const breadcrumb = "
|
|
5
|
-
const breadcrumb__list = "
|
|
6
|
-
const breadcrumb__item = "
|
|
7
|
-
const breadcrumb__link = "
|
|
8
|
-
const breadcrumb__current = "
|
|
9
|
-
const breadcrumb__separator = "
|
|
4
|
+
const breadcrumb = "_breadcrumb_1q2qc_10";
|
|
5
|
+
const breadcrumb__list = "_breadcrumb__list_1q2qc_17";
|
|
6
|
+
const breadcrumb__item = "_breadcrumb__item_1q2qc_26";
|
|
7
|
+
const breadcrumb__link = "_breadcrumb__link_1q2qc_45";
|
|
8
|
+
const breadcrumb__current = "_breadcrumb__current_1q2qc_54";
|
|
9
|
+
const breadcrumb__separator = "_breadcrumb__separator_1q2qc_59";
|
|
10
10
|
const styles = {
|
|
11
11
|
breadcrumb,
|
|
12
12
|
breadcrumb__list,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './Breadcrumb.css';
|
|
2
|
-
const breadcrumb = "
|
|
3
|
-
const breadcrumb__list = "
|
|
4
|
-
const breadcrumb__item = "
|
|
5
|
-
const breadcrumb__link = "
|
|
6
|
-
const breadcrumb__current = "
|
|
7
|
-
const breadcrumb__separator = "
|
|
2
|
+
const breadcrumb = "_breadcrumb_1q2qc_10";
|
|
3
|
+
const breadcrumb__list = "_breadcrumb__list_1q2qc_17";
|
|
4
|
+
const breadcrumb__item = "_breadcrumb__item_1q2qc_26";
|
|
5
|
+
const breadcrumb__link = "_breadcrumb__link_1q2qc_45";
|
|
6
|
+
const breadcrumb__current = "_breadcrumb__current_1q2qc_54";
|
|
7
|
+
const breadcrumb__separator = "_breadcrumb__separator_1q2qc_59";
|
|
8
8
|
const styles = {
|
|
9
9
|
breadcrumb,
|
|
10
10
|
breadcrumb__list,
|
|
@@ -52,7 +52,9 @@ const Button = ({
|
|
|
52
52
|
const target = safeAnchorProps.target;
|
|
53
53
|
const rel = safeAnchorProps.rel;
|
|
54
54
|
const shouldHardenRel = target === "_blank";
|
|
55
|
-
const relTokens = new Set(
|
|
55
|
+
const relTokens = new Set(
|
|
56
|
+
(rel ?? "").split(/\s+/).filter(Boolean).map((token) => token.toLowerCase())
|
|
57
|
+
);
|
|
56
58
|
if (shouldHardenRel) {
|
|
57
59
|
relTokens.add("noopener");
|
|
58
60
|
relTokens.add("noreferrer");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, MouseEvent, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport styles from './Button.module.css';\nimport { Spinner } from '../Spinner';\nimport type { ButtonProps } from './Button.types';\n\nexport const Button = ({\n variant = 'primary',\n fullWidth = false,\n size = 'normal',\n loading = false,\n className,\n children,\n ref,\n ...props\n}: ButtonProps) => {\n const isDisabled = 'disabled' in props && props.disabled;\n const isAnchor = 'href' in props && props.href != null;\n\n const classes = cn(\n styles.button,\n styles[`button--${variant}`],\n { [styles['button--full-width']]: fullWidth },\n styles[`button--${size}`],\n focusStyles.focusable,\n { [styles['button--disabled']]: isDisabled },\n { [styles['button--loading']]: loading },\n className,\n );\n\n const content = (\n <>\n <span className={styles.button__content}>{children}</span>\n {loading && (\n <Spinner\n size={size === 'small' ? 'xs' : 's'}\n color=\"inherit\"\n aria-hidden=\"true\"\n aria-label={undefined}\n role=\"presentation\"\n className={styles.button__spinner}\n />\n )}\n </>\n );\n\n if (isAnchor) {\n const { href, renderLink, ...anchorProps } = props as Omit<\n typeof props,\n 'variant' | 'size' | 'loading'\n > & {\n href: string;\n renderLink?: (\n props: AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n children: ReactNode;\n },\n ) => ReactNode;\n };\n\n const {\n disabled: _disabled,\n type: _type,\n name: _name,\n ...safeAnchorProps\n } = anchorProps as typeof anchorProps & {\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n name?: string;\n };\n\n const target = safeAnchorProps.target;\n const rel = safeAnchorProps.rel;\n const shouldHardenRel = target === '_blank';\n const relTokens = new Set((rel ?? '').split(/\\s+/).filter(Boolean));\n\n if (shouldHardenRel) {\n relTokens.add('noopener');\n relTokens.add('noreferrer');\n }\n\n const hardenedRel = relTokens.size > 0 ? Array.from(relTokens).join(' ') : undefined;\n\n const linkProps = {\n ...safeAnchorProps,\n ref: ref as Ref<HTMLAnchorElement>,\n href,\n rel: hardenedRel,\n className: classes,\n 'aria-busy': loading || undefined,\n 'aria-disabled': loading || undefined,\n tabIndex: loading ? -1 : undefined,\n onClick: loading\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : safeAnchorProps.onClick,\n children: content,\n };\n\n if (renderLink) {\n return <>{renderLink(linkProps)}</>;\n }\n\n return <a {...linkProps} />;\n }\n\n const {\n type = 'button',\n disabled,\n href: _href,\n target: _target,\n rel: _rel,\n renderLink: _renderLink,\n ...buttonProps\n } = props as Omit<typeof props, 'variant' | 'size' | 'loading' | 'href'> & {\n type?: 'button' | 'submit' | 'reset';\n disabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n renderLink?: unknown;\n };\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n disabled={disabled || loading}\n className={classes}\n aria-busy={loading || undefined}\n {...buttonProps}\n >\n {content}\n </button>\n );\n};\n"],"names":["cn","styles","focusStyles","jsxs","Fragment","jsx","Spinner"],"mappings":";;;;;;;AAOO,MAAM,SAAS,CAAC;AAAA,EACnB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAAmB;AACf,QAAM,aAAa,cAAc,SAAS,MAAM;AAChD,QAAM,WAAW,UAAU,SAAS,MAAM,QAAQ;AAElD,QAAM,UAAUA,GAAAA;AAAAA,IACZC,cAAAA,QAAO;AAAA,IACPA,cAAAA,QAAO,WAAW,OAAO,EAAE;AAAA,IAC3B,EAAE,CAACA,cAAAA,QAAO,oBAAoB,CAAC,GAAG,UAAA;AAAA,IAClCA,cAAAA,QAAO,WAAW,IAAI,EAAE;AAAA,IACxBC,aAAAA,QAAY;AAAA,IACZ,EAAE,CAACD,cAAAA,QAAO,kBAAkB,CAAC,GAAG,WAAA;AAAA,IAChC,EAAE,CAACA,cAAAA,QAAO,iBAAiB,CAAC,GAAG,QAAA;AAAA,IAC/B;AAAA,EAAA;AAGJ,QAAM,UACFE,2BAAAA,KAAAC,WAAAA,UAAA,EACI,UAAA;AAAA,IAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAWJ,cAAAA,QAAO,iBAAkB,UAAS;AAAA,IAClD,WACGI,2BAAAA;AAAAA,MAACC,QAAAA;AAAAA,MAAA;AAAA,QACG,MAAM,SAAS,UAAU,OAAO;AAAA,QAChC,OAAM;AAAA,QACN,eAAY;AAAA,QACZ,cAAY;AAAA,QACZ,MAAK;AAAA,QACL,WAAWL,cAAAA,QAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EACtB,GAER;AAGJ,MAAI,UAAU;AACV,UAAM,EAAE,MAAM,YAAY,GAAG,gBAAgB;AAa7C,UAAM;AAAA,MACF,UAAU;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,MACN,GAAG;AAAA,IAAA,IACH;AAMJ,UAAM,SAAS,gBAAgB;AAC/B,UAAM,MAAM,gBAAgB;AAC5B,UAAM,kBAAkB,WAAW;AACnC,UAAM,YAAY,IAAI,
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, MouseEvent, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport styles from './Button.module.css';\nimport { Spinner } from '../Spinner';\nimport type { ButtonProps } from './Button.types';\n\nexport const Button = ({\n variant = 'primary',\n fullWidth = false,\n size = 'normal',\n loading = false,\n className,\n children,\n ref,\n ...props\n}: ButtonProps) => {\n const isDisabled = 'disabled' in props && props.disabled;\n const isAnchor = 'href' in props && props.href != null;\n\n const classes = cn(\n styles.button,\n styles[`button--${variant}`],\n { [styles['button--full-width']]: fullWidth },\n styles[`button--${size}`],\n focusStyles.focusable,\n { [styles['button--disabled']]: isDisabled },\n { [styles['button--loading']]: loading },\n className,\n );\n\n const content = (\n <>\n <span className={styles.button__content}>{children}</span>\n {loading && (\n <Spinner\n size={size === 'small' ? 'xs' : 's'}\n color=\"inherit\"\n aria-hidden=\"true\"\n aria-label={undefined}\n role=\"presentation\"\n className={styles.button__spinner}\n />\n )}\n </>\n );\n\n if (isAnchor) {\n const { href, renderLink, ...anchorProps } = props as Omit<\n typeof props,\n 'variant' | 'size' | 'loading'\n > & {\n href: string;\n renderLink?: (\n props: AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n children: ReactNode;\n },\n ) => ReactNode;\n };\n\n const {\n disabled: _disabled,\n type: _type,\n name: _name,\n ...safeAnchorProps\n } = anchorProps as typeof anchorProps & {\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n name?: string;\n };\n\n const target = safeAnchorProps.target;\n const rel = safeAnchorProps.rel;\n const shouldHardenRel = target === '_blank';\n const relTokens = new Set(\n (rel ?? '')\n .split(/\\s+/)\n .filter(Boolean)\n .map((token) => token.toLowerCase()),\n );\n\n if (shouldHardenRel) {\n relTokens.add('noopener');\n relTokens.add('noreferrer');\n }\n\n const hardenedRel = relTokens.size > 0 ? Array.from(relTokens).join(' ') : undefined;\n\n const linkProps = {\n ...safeAnchorProps,\n ref: ref as Ref<HTMLAnchorElement>,\n href,\n rel: hardenedRel,\n className: classes,\n 'aria-busy': loading || undefined,\n 'aria-disabled': loading || undefined,\n tabIndex: loading ? -1 : undefined,\n onClick: loading\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : safeAnchorProps.onClick,\n children: content,\n };\n\n if (renderLink) {\n return <>{renderLink(linkProps)}</>;\n }\n\n return <a {...linkProps} />;\n }\n\n const {\n type = 'button',\n disabled,\n href: _href,\n target: _target,\n rel: _rel,\n renderLink: _renderLink,\n ...buttonProps\n } = props as Omit<typeof props, 'variant' | 'size' | 'loading' | 'href'> & {\n type?: 'button' | 'submit' | 'reset';\n disabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n renderLink?: unknown;\n };\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n disabled={disabled || loading}\n className={classes}\n aria-busy={loading || undefined}\n {...buttonProps}\n >\n {content}\n </button>\n );\n};\n"],"names":["cn","styles","focusStyles","jsxs","Fragment","jsx","Spinner"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@layer dds-components {.
|
|
1
|
+
@layer dds-components {._button_tpbgh_1 {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
gap: var(--spacing-
|
|
5
|
+
gap: var(--spacing-space-4);
|
|
6
6
|
max-width: 100%;
|
|
7
7
|
border: none;
|
|
8
8
|
border-radius: var(--radius-semantic-full);
|
|
@@ -15,114 +15,114 @@
|
|
|
15
15
|
border-color 0.2s ease-in-out;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
._button--full-
|
|
18
|
+
._button--full-width_tpbgh_18 {
|
|
19
19
|
width: 100%;
|
|
20
20
|
min-width: 0;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/* ─── Sizes ─── */
|
|
24
24
|
|
|
25
|
-
._button--
|
|
25
|
+
._button--normal_tpbgh_25 {
|
|
26
26
|
font: var(--typography-label-lg-bold);
|
|
27
27
|
height: 40px;
|
|
28
28
|
min-width: 128px;
|
|
29
|
-
padding: var(--spacing-
|
|
29
|
+
padding: var(--spacing-space-8) var(--spacing-space-20);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
._button--
|
|
32
|
+
._button--small_tpbgh_32 {
|
|
33
33
|
font: var(--typography-label-md-bold);
|
|
34
34
|
height: 32px;
|
|
35
35
|
min-width: 100px;
|
|
36
|
-
padding: var(--spacing-
|
|
36
|
+
padding: var(--spacing-space-8) var(--spacing-space-20);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/* ─── Primary variant ─── */
|
|
40
40
|
|
|
41
|
-
._button--
|
|
41
|
+
._button--primary_tpbgh_41 {
|
|
42
42
|
background-color: var(--color-semantic-interactive-primary-default);
|
|
43
43
|
color: var(--color-semantic-foreground-inverse);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
._button--
|
|
46
|
+
._button--primary_tpbgh_41:hover {
|
|
47
47
|
background-color: var(--color-semantic-interactive-primary-hover);
|
|
48
48
|
color: var(--color-semantic-foreground-inverse);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
._button--
|
|
51
|
+
._button--primary_tpbgh_41:active {
|
|
52
52
|
background-color: var(--color-semantic-interactive-primary-active);
|
|
53
53
|
color: var(--color-semantic-foreground-inverse);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
._button--
|
|
56
|
+
._button--primary_tpbgh_41:focus-visible {
|
|
57
57
|
background-color: var(--color-semantic-interactive-primary-focus);
|
|
58
58
|
color: var(--color-semantic-foreground-inverse);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* ─── Secondary variant ─── */
|
|
62
62
|
|
|
63
|
-
._button--
|
|
63
|
+
._button--secondary_tpbgh_63 {
|
|
64
64
|
background-color: transparent;
|
|
65
65
|
border: var(--borderwidth-semantic-sm) solid var(--color-semantic-interactive-secondary-default);
|
|
66
66
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
._button--
|
|
69
|
+
._button--secondary_tpbgh_63:hover {
|
|
70
70
|
background-color: var(--color-semantic-interactive-secondary-hover);
|
|
71
71
|
border-color: var(--color-semantic-interactive-secondary-hover);
|
|
72
72
|
color: var(--color-semantic-foreground-inverse);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
._button--
|
|
75
|
+
._button--secondary_tpbgh_63:active {
|
|
76
76
|
background-color: var(--color-semantic-interactive-secondary-active);
|
|
77
77
|
border-color: var(--color-semantic-interactive-secondary-active);
|
|
78
78
|
color: var(--color-semantic-foreground-inverse);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
._button--
|
|
81
|
+
._button--secondary_tpbgh_63:focus-visible {
|
|
82
82
|
background-color: var(--color-semantic-interactive-secondary-focus);
|
|
83
83
|
color: var(--color-semantic-foreground-inverse);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/* ─── Tertiary variant ─── */
|
|
87
87
|
|
|
88
|
-
._button--
|
|
88
|
+
._button--tertiary_tpbgh_88 {
|
|
89
89
|
background-color: var(--color-semantic-interactive-neutral-default);
|
|
90
90
|
border: var(--borderwidth-semantic-sm) solid var(--color-semantic-border-neutral-mid);
|
|
91
91
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
._button--
|
|
94
|
+
._button--tertiary_tpbgh_88:hover {
|
|
95
95
|
background-color: var(--color-semantic-interactive-neutral-hover);
|
|
96
96
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
._button--
|
|
99
|
+
._button--tertiary_tpbgh_88:active {
|
|
100
100
|
background-color: var(--color-semantic-interactive-neutral-active);
|
|
101
101
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
._button--
|
|
104
|
+
._button--tertiary_tpbgh_88:focus-visible {
|
|
105
105
|
background-color: var(--color-semantic-interactive-neutral-focus);
|
|
106
106
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/* ─── Disabled state ─── */
|
|
110
110
|
|
|
111
|
-
._button--
|
|
111
|
+
._button--disabled_tpbgh_111 {
|
|
112
112
|
pointer-events: none;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
._button--
|
|
115
|
+
._button--primary_tpbgh_41._button--disabled_tpbgh_111 {
|
|
116
116
|
background-color: var(--color-semantic-interactive-primary-disabled);
|
|
117
117
|
color: var(--color-semantic-foreground-muted);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
._button--
|
|
120
|
+
._button--secondary_tpbgh_63._button--disabled_tpbgh_111 {
|
|
121
121
|
border-color: var(--color-semantic-interactive-secondary-disabled);
|
|
122
122
|
color: var(--color-semantic-foreground-muted);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
._button--
|
|
125
|
+
._button--tertiary_tpbgh_88._button--disabled_tpbgh_111 {
|
|
126
126
|
background-color: var(--color-semantic-interactive-neutral-disabled);
|
|
127
127
|
color: var(--color-semantic-foreground-muted);
|
|
128
128
|
}
|
|
@@ -131,38 +131,38 @@
|
|
|
131
131
|
/* Styles apply from [data-color-scheme="dark"] down to (but not into) [data-color-scheme="light"]. */
|
|
132
132
|
|
|
133
133
|
@scope ([data-color-scheme='dark']) to ([data-color-scheme='light']) {
|
|
134
|
-
._button--
|
|
134
|
+
._button--primary_tpbgh_41._button--disabled_tpbgh_111 {
|
|
135
135
|
color: var(--color-semantic-foreground-inverse-muted);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
._button--
|
|
138
|
+
._button--secondary_tpbgh_63 {
|
|
139
139
|
border-color: var(--color-semantic-interactive-inverse-default);
|
|
140
140
|
color: var(--color-semantic-foreground-inverse);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
._button--
|
|
143
|
+
._button--secondary_tpbgh_63:hover {
|
|
144
144
|
background-color: var(--color-semantic-interactive-inverse-hover);
|
|
145
145
|
border-color: var(--color-semantic-interactive-inverse-hover);
|
|
146
146
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
._button--
|
|
149
|
+
._button--secondary_tpbgh_63:active {
|
|
150
150
|
background-color: var(--color-semantic-interactive-inverse-active);
|
|
151
151
|
border-color: var(--color-semantic-interactive-inverse-active);
|
|
152
152
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
._button--
|
|
155
|
+
._button--secondary_tpbgh_63:focus-visible {
|
|
156
156
|
background-color: var(--color-semantic-interactive-inverse-focus);
|
|
157
157
|
color: var(--color-semantic-foreground-secondary-strong);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
._button--
|
|
160
|
+
._button--secondary_tpbgh_63._button--disabled_tpbgh_111 {
|
|
161
161
|
border-color: var(--color-semantic-interactive-inverse-disabled);
|
|
162
162
|
color: var(--color-semantic-foreground-inverse-muted);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
._button--
|
|
165
|
+
._button--tertiary_tpbgh_88._button--disabled_tpbgh_111 {
|
|
166
166
|
border-color: var(--color-semantic-interactive-neutral-disabled);
|
|
167
167
|
color: var(--color-semantic-foreground-inverse-muted);
|
|
168
168
|
}
|
|
@@ -170,11 +170,11 @@
|
|
|
170
170
|
|
|
171
171
|
/* ─── Loading state ─── */
|
|
172
172
|
|
|
173
|
-
._button--
|
|
173
|
+
._button--loading_tpbgh_173 {
|
|
174
174
|
pointer-events: none;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.
|
|
177
|
+
._button__content_tpbgh_177 {
|
|
178
178
|
flex: 0 1 auto;
|
|
179
179
|
min-width: 0;
|
|
180
180
|
overflow: hidden;
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
white-space: nowrap;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.
|
|
185
|
+
._button__spinner_tpbgh_185 {
|
|
186
186
|
flex: 0 0 auto;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,GAAI,2EASpB,WAAW,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,GAAI,2EASpB,WAAW,4CA+Hb,CAAC"}
|
|
@@ -50,7 +50,9 @@ const Button = ({
|
|
|
50
50
|
const target = safeAnchorProps.target;
|
|
51
51
|
const rel = safeAnchorProps.rel;
|
|
52
52
|
const shouldHardenRel = target === "_blank";
|
|
53
|
-
const relTokens = new Set(
|
|
53
|
+
const relTokens = new Set(
|
|
54
|
+
(rel ?? "").split(/\s+/).filter(Boolean).map((token) => token.toLowerCase())
|
|
55
|
+
);
|
|
54
56
|
if (shouldHardenRel) {
|
|
55
57
|
relTokens.add("noopener");
|
|
56
58
|
relTokens.add("noreferrer");
|