@sellmate/design-system 1.0.21 → 1.0.22
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/cjs/{select-keyboard-navigation-CtstKOb3.js → base-dropdown-event-BTPlZ1KF.js} +0 -38
- package/dist/cjs/component.button-C6xBMwHf.js +115 -0
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-button-v2.cjs.entry.js +86 -0
- package/dist/cjs/sd-button-v2.config-BK45EPK_.js +203 -0
- package/dist/cjs/sd-button_21.cjs.entry.js +119 -65
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +274 -0
- package/dist/cjs/sd-file-picker.cjs.entry.js +3 -3
- package/dist/cjs/sd-guide.cjs.entry.js +2 -2
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +3 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +4 -3
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/cjs/select-keyboard-navigation-s2wP37xZ.js +40 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/sd-button-v2/sd-button-v2.config.js +190 -0
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +120 -0
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +249 -0
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +2 -2
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +62 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +171 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +384 -0
- package/dist/collection/components/sd-field/sd-field.js +3 -3
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +3 -3
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-guide/sd-guide.js +2 -2
- package/dist/collection/components/sd-icon/sd-icon.js +1 -1
- package/dist/collection/components/sd-input/sd-input.js +1 -1
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +89 -19
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
- package/dist/components/{p-D0U1cMbs.js → p-B4p2JGMI.js} +1 -1
- package/dist/components/p-Bd9o9P1x.js +1 -0
- package/dist/components/{p-rn5S2icF.js → p-BsQEKShq.js} +1 -1
- package/dist/components/{p-CbQobmaB.js → p-CAJmL8nc.js} +1 -1
- package/dist/components/p-CWlCxabU.js +1 -0
- package/dist/components/p-Cy6HMEsK.js +1 -0
- package/dist/components/{p-C1XPuuO-.js → p-CysnHGj4.js} +1 -1
- package/dist/components/{p-qSu-ayDy.js → p-D4kmO3k7.js} +1 -1
- package/dist/components/{p-DdOM8yc2.js → p-DB52ADSW.js} +1 -1
- package/dist/components/{p-J-Yn0oS3.js → p-DExqkuUY.js} +1 -1
- package/dist/components/{p-MmKik3mL.js → p-DF2wExtn.js} +1 -1
- package/dist/components/{p-D35gOcGh.js → p-DFgtwoFG.js} +1 -1
- package/dist/components/{p-BVFlD1Lp.js → p-DYsHXden.js} +1 -1
- package/dist/components/{p-CWg2auF3.js → p-DZqrfwuw.js} +1 -1
- package/dist/components/p-Dc4UTGgQ.js +1 -0
- package/dist/components/{p-CU5TiEeI.js → p-DyeU47vV.js} +1 -1
- package/dist/components/p-Hvt2oWRk.js +1 -0
- package/dist/components/{p-Cef06v8S.js → p-JyVgfdnC.js} +1 -1
- package/dist/components/p-VKF2AWs1.js +1 -0
- package/dist/components/sd-button-v2.d.ts +11 -0
- package/dist/components/sd-button-v2.js +1 -0
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.d.ts +11 -0
- package/dist/components/sd-dropdown-button.js +1 -0
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-loading-spinner.js +1 -1
- package/dist/components/sd-modal-card.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle-button.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-2ca338f9.entry.js +1 -0
- package/dist/design-system/p-322dbf53.entry.js +1 -0
- package/dist/design-system/p-3885ca10.entry.js +1 -0
- package/dist/design-system/{p-d6b38732.entry.js → p-40da6e22.entry.js} +1 -1
- package/dist/design-system/{p-679e4367.entry.js → p-47d37199.entry.js} +1 -1
- package/dist/design-system/{p-3301c280.entry.js → p-6c34df5b.entry.js} +1 -1
- package/dist/design-system/p-7d35c7a7.entry.js +1 -0
- package/dist/design-system/{p-3d03b19e.entry.js → p-938940a7.entry.js} +1 -1
- package/dist/design-system/p-9650c304.entry.js +1 -0
- package/dist/design-system/{p-8f99cd66.entry.js → p-9ad83ffb.entry.js} +1 -1
- package/dist/design-system/p-CRdYeSBK.js +1 -0
- package/dist/design-system/p-Dc4UTGgQ.js +1 -0
- package/dist/design-system/p-VKF2AWs1.js +1 -0
- package/dist/design-system/{p-d344fa9d.entry.js → p-a547f366.entry.js} +1 -1
- package/dist/design-system/{p-3e07e92a.entry.js → p-b2ab1c50.entry.js} +1 -1
- package/dist/design-system/p-d38f59b3.entry.js +1 -0
- package/dist/design-system/{p-822233ee.entry.js → p-e5c3927f.entry.js} +1 -1
- package/dist/design-system/p-xxEHPVkL.js +1 -0
- package/dist/esm/{select-keyboard-navigation-D8-D-mJX.js → base-dropdown-event-CRdYeSBK.js} +1 -37
- package/dist/esm/component.button-Dc4UTGgQ.js +113 -0
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-button-v2.config-BWmcscrt.js +193 -0
- package/dist/esm/sd-button-v2.entry.js +84 -0
- package/dist/esm/sd-button_21.entry.js +114 -60
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-date-picker.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +272 -0
- package/dist/esm/sd-file-picker.entry.js +3 -3
- package/dist/esm/sd-guide.entry.js +2 -2
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-multiple-group.entry.js +2 -1
- package/dist/esm/sd-select-multiple.entry.js +3 -2
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/esm/select-keyboard-navigation-xxEHPVkL.js +37 -0
- package/dist/types/components/sd-button-v2/sd-button-v2.config.d.ts +178 -0
- package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +18 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +55 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.d.ts +34 -0
- package/dist/types/components/sd-portal/sd-portal.d.ts +9 -0
- package/dist/types/components.d.ts +153 -0
- package/dist/types/index.d.ts +2 -0
- package/hydrate/index.js +881 -148
- package/hydrate/index.mjs +881 -148
- package/package.json +2 -2
- package/dist/components/p-B82gJZ4z.js +0 -1
- package/dist/components/p-C6J-ZZxF.js +0 -1
- package/dist/components/p-CHAh-_qx.js +0 -1
- package/dist/design-system/p-103de692.entry.js +0 -1
- package/dist/design-system/p-55c13597.entry.js +0 -1
- package/dist/design-system/p-D8-D-mJX.js +0 -1
- package/dist/design-system/p-de339565.entry.js +0 -1
- package/dist/design-system/p-fc0e636b.entry.js +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import buttonTokens from "../../tokens/generated/component.button.json";
|
|
2
|
+
export const BUTTON_FOCUS_RING_COLOR = '#0075FF';
|
|
3
|
+
const PRESET_DEFAULT_COLORS = {
|
|
4
|
+
primary: buttonTokens.brand.strong.bg.default,
|
|
5
|
+
secondary: buttonTokens.brand.subtle.bg.default,
|
|
6
|
+
primary_outline: buttonTokens.brand.outline.bg.default,
|
|
7
|
+
neutral: buttonTokens.neutral.subtle.bg.default,
|
|
8
|
+
neutral_outline: buttonTokens.neutral.outline.bg.default,
|
|
9
|
+
danger: buttonTokens.danger.strong.bg.default,
|
|
10
|
+
danger_outline: buttonTokens.danger.outline.bg.default,
|
|
11
|
+
};
|
|
12
|
+
export const BUTTON_CONFIG = {
|
|
13
|
+
primary_xs: {
|
|
14
|
+
variant: 'primary',
|
|
15
|
+
size: 'xs',
|
|
16
|
+
color: PRESET_DEFAULT_COLORS.primary,
|
|
17
|
+
},
|
|
18
|
+
secondary_xs: {
|
|
19
|
+
variant: 'primary',
|
|
20
|
+
size: 'xs',
|
|
21
|
+
color: PRESET_DEFAULT_COLORS.secondary,
|
|
22
|
+
},
|
|
23
|
+
primary_outline_xs: {
|
|
24
|
+
variant: 'outline',
|
|
25
|
+
size: 'xs',
|
|
26
|
+
color: PRESET_DEFAULT_COLORS.primary_outline,
|
|
27
|
+
},
|
|
28
|
+
neutral_xs: {
|
|
29
|
+
variant: 'primary',
|
|
30
|
+
size: 'xs',
|
|
31
|
+
color: PRESET_DEFAULT_COLORS.neutral,
|
|
32
|
+
},
|
|
33
|
+
neutral_outline_xs: {
|
|
34
|
+
variant: 'outline',
|
|
35
|
+
size: 'xs',
|
|
36
|
+
color: PRESET_DEFAULT_COLORS.neutral_outline,
|
|
37
|
+
},
|
|
38
|
+
danger_xs: {
|
|
39
|
+
variant: 'primary',
|
|
40
|
+
size: 'xs',
|
|
41
|
+
color: PRESET_DEFAULT_COLORS.danger,
|
|
42
|
+
},
|
|
43
|
+
danger_outline_xs: {
|
|
44
|
+
variant: 'outline',
|
|
45
|
+
size: 'xs',
|
|
46
|
+
color: PRESET_DEFAULT_COLORS.danger_outline,
|
|
47
|
+
},
|
|
48
|
+
primary_sm: {
|
|
49
|
+
variant: 'primary',
|
|
50
|
+
size: 'sm',
|
|
51
|
+
color: PRESET_DEFAULT_COLORS.primary,
|
|
52
|
+
},
|
|
53
|
+
secondary_sm: {
|
|
54
|
+
variant: 'primary',
|
|
55
|
+
size: 'sm',
|
|
56
|
+
color: PRESET_DEFAULT_COLORS.secondary,
|
|
57
|
+
},
|
|
58
|
+
primary_outline_sm: {
|
|
59
|
+
variant: 'outline',
|
|
60
|
+
size: 'sm',
|
|
61
|
+
color: PRESET_DEFAULT_COLORS.primary_outline,
|
|
62
|
+
},
|
|
63
|
+
neutral_sm: {
|
|
64
|
+
variant: 'primary',
|
|
65
|
+
size: 'sm',
|
|
66
|
+
color: PRESET_DEFAULT_COLORS.neutral,
|
|
67
|
+
},
|
|
68
|
+
neutral_outline_sm: {
|
|
69
|
+
variant: 'outline',
|
|
70
|
+
size: 'sm',
|
|
71
|
+
color: PRESET_DEFAULT_COLORS.neutral_outline,
|
|
72
|
+
},
|
|
73
|
+
danger_sm: {
|
|
74
|
+
variant: 'primary',
|
|
75
|
+
size: 'sm',
|
|
76
|
+
color: PRESET_DEFAULT_COLORS.danger,
|
|
77
|
+
},
|
|
78
|
+
danger_outline_sm: {
|
|
79
|
+
variant: 'outline',
|
|
80
|
+
size: 'sm',
|
|
81
|
+
color: PRESET_DEFAULT_COLORS.danger_outline,
|
|
82
|
+
},
|
|
83
|
+
primary_md: {
|
|
84
|
+
variant: 'primary',
|
|
85
|
+
size: 'md',
|
|
86
|
+
color: PRESET_DEFAULT_COLORS.primary,
|
|
87
|
+
},
|
|
88
|
+
secondary_md: {
|
|
89
|
+
variant: 'primary',
|
|
90
|
+
size: 'md',
|
|
91
|
+
color: PRESET_DEFAULT_COLORS.secondary,
|
|
92
|
+
},
|
|
93
|
+
primary_outline_md: {
|
|
94
|
+
variant: 'outline',
|
|
95
|
+
size: 'md',
|
|
96
|
+
color: PRESET_DEFAULT_COLORS.primary_outline,
|
|
97
|
+
},
|
|
98
|
+
neutral_md: {
|
|
99
|
+
variant: 'primary',
|
|
100
|
+
size: 'md',
|
|
101
|
+
color: PRESET_DEFAULT_COLORS.neutral,
|
|
102
|
+
},
|
|
103
|
+
neutral_outline_md: {
|
|
104
|
+
variant: 'outline',
|
|
105
|
+
size: 'md',
|
|
106
|
+
color: PRESET_DEFAULT_COLORS.neutral_outline,
|
|
107
|
+
},
|
|
108
|
+
danger_md: {
|
|
109
|
+
variant: 'primary',
|
|
110
|
+
size: 'md',
|
|
111
|
+
color: PRESET_DEFAULT_COLORS.danger,
|
|
112
|
+
},
|
|
113
|
+
danger_outline_md: {
|
|
114
|
+
variant: 'outline',
|
|
115
|
+
size: 'md',
|
|
116
|
+
color: PRESET_DEFAULT_COLORS.danger_outline,
|
|
117
|
+
},
|
|
118
|
+
primary_lg: {
|
|
119
|
+
variant: 'primary',
|
|
120
|
+
size: 'lg',
|
|
121
|
+
color: PRESET_DEFAULT_COLORS.primary,
|
|
122
|
+
},
|
|
123
|
+
secondary_lg: {
|
|
124
|
+
variant: 'primary',
|
|
125
|
+
size: 'lg',
|
|
126
|
+
color: PRESET_DEFAULT_COLORS.secondary,
|
|
127
|
+
},
|
|
128
|
+
primary_outline_lg: {
|
|
129
|
+
variant: 'outline',
|
|
130
|
+
size: 'lg',
|
|
131
|
+
color: PRESET_DEFAULT_COLORS.primary_outline,
|
|
132
|
+
},
|
|
133
|
+
neutral_lg: {
|
|
134
|
+
variant: 'primary',
|
|
135
|
+
size: 'lg',
|
|
136
|
+
color: PRESET_DEFAULT_COLORS.neutral,
|
|
137
|
+
},
|
|
138
|
+
neutral_outline_lg: {
|
|
139
|
+
variant: 'outline',
|
|
140
|
+
size: 'lg',
|
|
141
|
+
color: PRESET_DEFAULT_COLORS.neutral_outline,
|
|
142
|
+
},
|
|
143
|
+
danger_lg: {
|
|
144
|
+
variant: 'primary',
|
|
145
|
+
size: 'lg',
|
|
146
|
+
color: PRESET_DEFAULT_COLORS.danger,
|
|
147
|
+
},
|
|
148
|
+
danger_outline_lg: {
|
|
149
|
+
variant: 'outline',
|
|
150
|
+
size: 'lg',
|
|
151
|
+
color: PRESET_DEFAULT_COLORS.danger_outline,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
export const BUTTON_ICON_SIZES = {
|
|
155
|
+
xs: Number(buttonTokens.size.xs.icon),
|
|
156
|
+
sm: Number(buttonTokens.size.sm.icon),
|
|
157
|
+
md: Number(buttonTokens.size.md.icon),
|
|
158
|
+
lg: Number(buttonTokens.size.lg.icon),
|
|
159
|
+
};
|
|
160
|
+
export const PRESET_HOVER_BACKGROUNDS = {
|
|
161
|
+
primary: buttonTokens.brand.strong.bg.hover,
|
|
162
|
+
secondary: buttonTokens.brand.subtle.bg.hover,
|
|
163
|
+
primary_outline: buttonTokens.brand.outline.bg.hover,
|
|
164
|
+
neutral: buttonTokens.neutral.subtle.bg.hover,
|
|
165
|
+
neutral_outline: buttonTokens.neutral.outline.bg.hover,
|
|
166
|
+
danger: buttonTokens.danger.strong.bg.hover,
|
|
167
|
+
danger_outline: buttonTokens.danger.outline.bg.hover,
|
|
168
|
+
};
|
|
169
|
+
export const PRESET_CONTENT_COLORS = {
|
|
170
|
+
primary: buttonTokens.brand.strong.content,
|
|
171
|
+
secondary: buttonTokens.brand.subtle.content,
|
|
172
|
+
primary_outline: buttonTokens.brand.outline.content,
|
|
173
|
+
neutral: buttonTokens.neutral.subtle.content,
|
|
174
|
+
neutral_outline: buttonTokens.neutral.outline.content,
|
|
175
|
+
danger: buttonTokens.danger.strong.content,
|
|
176
|
+
danger_outline: buttonTokens.danger.outline.content,
|
|
177
|
+
};
|
|
178
|
+
export const PRESET_BORDER_COLORS = {
|
|
179
|
+
primary: 'transparent',
|
|
180
|
+
secondary: 'transparent',
|
|
181
|
+
primary_outline: buttonTokens.brand.outline.border,
|
|
182
|
+
neutral: 'transparent',
|
|
183
|
+
neutral_outline: buttonTokens.neutral.outline.border,
|
|
184
|
+
danger: 'transparent',
|
|
185
|
+
danger_outline: buttonTokens.danger.outline.border,
|
|
186
|
+
};
|
|
187
|
+
export const DISABLED_CONTENT = buttonTokens.content.disabled;
|
|
188
|
+
const SIZE_SUFFIX_PATTERN = /_(xs|sm|md|lg)$/;
|
|
189
|
+
export const isButtonV2Name = (value) => value in BUTTON_CONFIG;
|
|
190
|
+
export const getPresetName = (value) => value.replace(SIZE_SUFFIX_PATTERN, '');
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
sd-button-v2 {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
width: fit-content;
|
|
4
|
+
height: fit-content;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sd-button-v2 {
|
|
8
|
+
--sd-button-v2-height: 34px;
|
|
9
|
+
--sd-button-v2-padding-x: 20px;
|
|
10
|
+
--sd-button-v2-gap: 8px;
|
|
11
|
+
--sd-button-v2-font-family: inherit;
|
|
12
|
+
--sd-button-v2-font-size: 16px;
|
|
13
|
+
--sd-button-v2-font-weight: 500;
|
|
14
|
+
--sd-button-v2-text-decoration: none;
|
|
15
|
+
--sd-button-v2-label-min-width: auto;
|
|
16
|
+
--sd-button-v2-icon-only-size: var(--sd-button-v2-height);
|
|
17
|
+
--sd-button-v2-bg: #025497;
|
|
18
|
+
--sd-button-v2-bg-hover: #004177;
|
|
19
|
+
--sd-button-v2-border: transparent;
|
|
20
|
+
--sd-button-v2-content: #ffffff;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
min-height: var(--sd-button-v2-height);
|
|
25
|
+
min-width: var(--sd-button-v2-min-width, auto);
|
|
26
|
+
padding: 0 var(--sd-button-v2-padding-x);
|
|
27
|
+
border: var(--sd-button-border-width-default, 1px) solid var(--sd-button-v2-border);
|
|
28
|
+
border-radius: var(--sd-button-radius-default, 4px);
|
|
29
|
+
background: var(--sd-button-v2-bg);
|
|
30
|
+
color: var(--sd-button-v2-content);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
font-family: var(--sd-button-v2-font-family);
|
|
34
|
+
font-size: var(--sd-button-v2-font-size);
|
|
35
|
+
font-weight: var(--sd-button-v2-font-weight);
|
|
36
|
+
line-height: 1;
|
|
37
|
+
text-decoration: var(--sd-button-v2-text-decoration);
|
|
38
|
+
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
-webkit-user-select: none;
|
|
41
|
+
user-select: none;
|
|
42
|
+
}
|
|
43
|
+
.sd-button-v2:hover:not(.sd-button-v2--disabled) {
|
|
44
|
+
background: var(--sd-button-v2-bg-hover);
|
|
45
|
+
}
|
|
46
|
+
.sd-button-v2:focus-visible {
|
|
47
|
+
outline: 0;
|
|
48
|
+
box-shadow: 0 0 0 2px var(--sd-button-v2-accent);
|
|
49
|
+
}
|
|
50
|
+
.sd-button-v2--xs {
|
|
51
|
+
--sd-button-v2-height: var(--sd-button-xs-height, 24px);
|
|
52
|
+
--sd-button-v2-padding-x: var(--sd-button-xs-padding-x, 8px);
|
|
53
|
+
--sd-button-v2-gap: var(--sd-button-xs-gap, 4px);
|
|
54
|
+
--sd-button-v2-font-family: var(--sd-button-xs-typography-font-family, inherit);
|
|
55
|
+
--sd-button-v2-font-size: var(--sd-button-xs-typography-font-size, 12px);
|
|
56
|
+
--sd-button-v2-font-weight: var(--sd-button-xs-typography-font-weight, 500);
|
|
57
|
+
--sd-button-v2-text-decoration: var(--sd-button-xs-typography-text-decoration, none);
|
|
58
|
+
--sd-button-v2-label-min-width: var(--sd-button-label-xs-min-width, auto);
|
|
59
|
+
--sd-button-v2-icon-only-size: var(--sd-button-icon-only-xs-width, var(--sd-button-v2-height));
|
|
60
|
+
}
|
|
61
|
+
.sd-button-v2--sm {
|
|
62
|
+
--sd-button-v2-height: var(--sd-button-sm-height, 28px);
|
|
63
|
+
--sd-button-v2-padding-x: var(--sd-button-sm-padding-x, 12px);
|
|
64
|
+
--sd-button-v2-gap: var(--sd-button-sm-gap, 6px);
|
|
65
|
+
--sd-button-v2-font-family: var(--sd-button-sm-typography-font-family, inherit);
|
|
66
|
+
--sd-button-v2-font-size: var(--sd-button-sm-typography-font-size, 12px);
|
|
67
|
+
--sd-button-v2-font-weight: var(--sd-button-sm-typography-font-weight, 500);
|
|
68
|
+
--sd-button-v2-text-decoration: var(--sd-button-sm-typography-text-decoration, none);
|
|
69
|
+
--sd-button-v2-label-min-width: var(--sd-button-label-sm-min-width, auto);
|
|
70
|
+
--sd-button-v2-icon-only-size: var(--sd-button-icon-only-sm-width, var(--sd-button-v2-height));
|
|
71
|
+
}
|
|
72
|
+
.sd-button-v2--md {
|
|
73
|
+
--sd-button-v2-height: var(--sd-button-md-height, 34px);
|
|
74
|
+
--sd-button-v2-padding-x: var(--sd-button-md-padding-x, 20px);
|
|
75
|
+
--sd-button-v2-gap: var(--sd-button-md-gap, 8px);
|
|
76
|
+
--sd-button-v2-font-family: var(--sd-button-md-typography-font-family, inherit);
|
|
77
|
+
--sd-button-v2-font-size: var(--sd-button-md-typography-font-size, 16px);
|
|
78
|
+
--sd-button-v2-font-weight: var(--sd-button-md-typography-font-weight, 500);
|
|
79
|
+
--sd-button-v2-text-decoration: var(--sd-button-md-typography-text-decoration, none);
|
|
80
|
+
--sd-button-v2-label-min-width: var(--sd-button-label-md-min-width, auto);
|
|
81
|
+
--sd-button-v2-icon-only-size: var(--sd-button-icon-only-md-width, var(--sd-button-v2-height));
|
|
82
|
+
}
|
|
83
|
+
.sd-button-v2--lg {
|
|
84
|
+
--sd-button-v2-height: var(--sd-button-lg-height, 62px);
|
|
85
|
+
--sd-button-v2-padding-x: var(--sd-button-lg-padding-x, 28px);
|
|
86
|
+
--sd-button-v2-gap: var(--sd-button-lg-gap, 12px);
|
|
87
|
+
--sd-button-v2-font-family: var(--sd-button-lg-typography-font-family, inherit);
|
|
88
|
+
--sd-button-v2-font-size: var(--sd-button-lg-typography-font-size, 18px);
|
|
89
|
+
--sd-button-v2-font-weight: var(--sd-button-lg-typography-font-weight, 500);
|
|
90
|
+
--sd-button-v2-text-decoration: var(--sd-button-lg-typography-text-decoration, none);
|
|
91
|
+
--sd-button-v2-label-min-width: var(--sd-button-label-lg-min-width, auto);
|
|
92
|
+
--sd-button-v2-icon-only-size: var(--sd-button-icon-only-lg-width, var(--sd-button-v2-height));
|
|
93
|
+
}
|
|
94
|
+
.sd-button-v2--has-label {
|
|
95
|
+
--sd-button-v2-min-width: var(--sd-button-v2-label-min-width, auto);
|
|
96
|
+
}
|
|
97
|
+
.sd-button-v2--icon-only {
|
|
98
|
+
width: var(--sd-button-v2-icon-only-size, var(--sd-button-v2-height));
|
|
99
|
+
min-width: var(--sd-button-v2-icon-only-size, var(--sd-button-v2-height));
|
|
100
|
+
height: var(--sd-button-v2-icon-only-size, var(--sd-button-v2-height));
|
|
101
|
+
padding: 0;
|
|
102
|
+
}
|
|
103
|
+
.sd-button-v2--icon-only .sd-button-v2__content {
|
|
104
|
+
gap: 0;
|
|
105
|
+
}
|
|
106
|
+
.sd-button-v2--disabled {
|
|
107
|
+
border-color: var(--sd-button-border-disabled, #CCCCCC);
|
|
108
|
+
background: var(--sd-button-bg-disabled, #E1E1E1);
|
|
109
|
+
color: var(--sd-button-content-disabled, #888888);
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
}
|
|
112
|
+
.sd-button-v2 .sd-button-v2__content {
|
|
113
|
+
display: inline-flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
gap: var(--sd-button-v2-gap);
|
|
117
|
+
}
|
|
118
|
+
.sd-button-v2 .sd-button-v2__label {
|
|
119
|
+
font: inherit;
|
|
120
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { BUTTON_CONFIG, BUTTON_FOCUS_RING_COLOR, BUTTON_ICON_SIZES, DISABLED_CONTENT, PRESET_BORDER_COLORS, PRESET_CONTENT_COLORS, PRESET_HOVER_BACKGROUNDS, getPresetName, isButtonV2Name, } from "./sd-button-v2.config";
|
|
3
|
+
export class SdButtonV2 {
|
|
4
|
+
name = 'primary_sm';
|
|
5
|
+
label = '';
|
|
6
|
+
icon;
|
|
7
|
+
ariaLabel = '';
|
|
8
|
+
disabled = false;
|
|
9
|
+
type = 'button';
|
|
10
|
+
click;
|
|
11
|
+
hasWarnedMissingAriaLabel = false;
|
|
12
|
+
handleClick = (event) => {
|
|
13
|
+
if (this.disabled) {
|
|
14
|
+
event.preventDefault();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this.click.emit(event);
|
|
18
|
+
};
|
|
19
|
+
get resolvedConfig() {
|
|
20
|
+
if (!isButtonV2Name(this.name)) {
|
|
21
|
+
throw new Error(`Invalid sd-button-v2 name: ${this.name}`);
|
|
22
|
+
}
|
|
23
|
+
const config = BUTTON_CONFIG[this.name];
|
|
24
|
+
const preset = getPresetName(this.name);
|
|
25
|
+
return {
|
|
26
|
+
config,
|
|
27
|
+
preset,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
getButtonClasses(preset, size, hasLabel, iconOnly) {
|
|
31
|
+
const classes = ['sd-button-v2', `sd-button-v2--${preset}`, `sd-button-v2--${size}`];
|
|
32
|
+
if (this.disabled) {
|
|
33
|
+
classes.push('sd-button-v2--disabled');
|
|
34
|
+
}
|
|
35
|
+
if (iconOnly) {
|
|
36
|
+
classes.push('sd-button-v2--icon-only');
|
|
37
|
+
}
|
|
38
|
+
if (hasLabel) {
|
|
39
|
+
classes.push('sd-button-v2--has-label');
|
|
40
|
+
}
|
|
41
|
+
return classes.join(' ');
|
|
42
|
+
}
|
|
43
|
+
componentWillRender() {
|
|
44
|
+
this.warnIfMissingAriaLabel();
|
|
45
|
+
}
|
|
46
|
+
warnIfMissingAriaLabel() {
|
|
47
|
+
const iconOnly = !this.label && Boolean(this.icon);
|
|
48
|
+
const missingAriaLabel = iconOnly && !this.ariaLabel.trim();
|
|
49
|
+
if (!missingAriaLabel) {
|
|
50
|
+
this.hasWarnedMissingAriaLabel = false;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (this.hasWarnedMissingAriaLabel) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
console.warn(`[sd-button-v2] icon-only buttons require \`ariaLabel\`. Received name="${this.name}" icon="${this.icon}".`);
|
|
57
|
+
this.hasWarnedMissingAriaLabel = true;
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const { config, preset } = this.resolvedConfig;
|
|
61
|
+
const hasLabel = Boolean(this.label);
|
|
62
|
+
const iconOnly = !this.label && Boolean(this.icon);
|
|
63
|
+
const accessibleName = iconOnly && this.ariaLabel.trim() ? this.ariaLabel : undefined;
|
|
64
|
+
const iconColor = this.disabled ? DISABLED_CONTENT : PRESET_CONTENT_COLORS[preset];
|
|
65
|
+
return (h("button", { key: 'f1c9355390568831fa0c4c7289e62e701e0174c2', class: this.getButtonClasses(preset, config.size, hasLabel, iconOnly), type: this.type, disabled: this.disabled, "aria-label": accessibleName, style: {
|
|
66
|
+
'--sd-button-v2-bg': config.variant === 'primary' ? config.color : '#FFFFFF',
|
|
67
|
+
'--sd-button-v2-bg-hover': PRESET_HOVER_BACKGROUNDS[preset],
|
|
68
|
+
'--sd-button-v2-border': PRESET_BORDER_COLORS[preset],
|
|
69
|
+
'--sd-button-v2-content': PRESET_CONTENT_COLORS[preset],
|
|
70
|
+
'--sd-button-v2-accent': BUTTON_FOCUS_RING_COLOR,
|
|
71
|
+
}, onClick: this.handleClick }, h("span", { key: '2845fbd556f326db93a27b802faa96ec60345f63', class: "sd-button-v2__content" }, this.icon && (h("sd-icon", { key: '5d90b15cbcd0c1cea10a5dc251fd13e6a0099fb0', class: "sd-button-v2__icon", name: this.icon, size: BUTTON_ICON_SIZES[config.size], color: iconColor })), this.label && h("span", { key: '76facbfe83402fd0e5b17c1b7d4132665d8aaf5b', class: "sd-button-v2__label" }, this.label))));
|
|
72
|
+
}
|
|
73
|
+
static get is() { return "sd-button-v2"; }
|
|
74
|
+
static get originalStyleUrls() {
|
|
75
|
+
return {
|
|
76
|
+
"$": ["sd-button-v2.scss"]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get styleUrls() {
|
|
80
|
+
return {
|
|
81
|
+
"$": ["sd-button-v2.css"]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
static get properties() {
|
|
85
|
+
return {
|
|
86
|
+
"name": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "ButtonV2Name",
|
|
91
|
+
"resolved": "\"danger_lg\" | \"danger_md\" | \"danger_outline_lg\" | \"danger_outline_md\" | \"danger_outline_sm\" | \"danger_outline_xs\" | \"danger_sm\" | \"danger_xs\" | \"neutral_lg\" | \"neutral_md\" | \"neutral_outline_lg\" | \"neutral_outline_md\" | \"neutral_outline_sm\" | \"neutral_outline_xs\" | \"neutral_sm\" | \"neutral_xs\" | \"primary_lg\" | \"primary_md\" | \"primary_outline_lg\" | \"primary_outline_md\" | \"primary_outline_sm\" | \"primary_outline_xs\" | \"primary_sm\" | \"primary_xs\" | \"secondary_lg\" | \"secondary_md\" | \"secondary_sm\" | \"secondary_xs\"",
|
|
92
|
+
"references": {
|
|
93
|
+
"ButtonV2Name": {
|
|
94
|
+
"location": "import",
|
|
95
|
+
"path": "./sd-button-v2.config",
|
|
96
|
+
"id": "src/components/sd-button-v2/sd-button-v2.config.ts::ButtonV2Name",
|
|
97
|
+
"referenceLocation": "ButtonV2Name"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": ""
|
|
106
|
+
},
|
|
107
|
+
"getter": false,
|
|
108
|
+
"setter": false,
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"attribute": "name",
|
|
111
|
+
"defaultValue": "'primary_sm'"
|
|
112
|
+
},
|
|
113
|
+
"label": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "string",
|
|
118
|
+
"resolved": "string",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": ""
|
|
126
|
+
},
|
|
127
|
+
"getter": false,
|
|
128
|
+
"setter": false,
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"attribute": "label",
|
|
131
|
+
"defaultValue": "''"
|
|
132
|
+
},
|
|
133
|
+
"icon": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"mutable": false,
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "IconName",
|
|
138
|
+
"resolved": "\"add\" | \"alert\" | \"alignKorean\" | \"archive\" | \"arrow2Down\" | \"arrow2Left\" | \"arrow2Right\" | \"arrow2Up\" | \"arrow2UpDown\" | \"arrowDown\" | \"arrowLeft\" | \"arrowLeftEnd\" | \"arrowRight\" | \"arrowRightEnd\" | \"arrowUp\" | \"attachFile\" | \"badgeNew\" | \"barcode\" | \"bell\" | \"board\" | \"box\" | \"cancelFilled\" | \"cancelOutline\" | \"caretDown\" | \"caretLeft\" | \"caretRight\" | \"caretUp\" | \"check\" | \"checkFilled\" | \"checkOutline\" | \"clockFilled\" | \"clockOutline\" | \"close\" | \"copy\" | \"dashboard\" | \"date\" | \"download\" | \"drag\" | \"etc\" | \"event\" | \"global\" | \"helpFilled\" | \"helpOutline\" | \"history\" | \"imageFill\" | \"imageLine\" | \"inline\" | \"line\" | \"location\" | \"logout\" | \"minus\" | \"notificationFilled\" | \"notificationOutline\" | \"notion\" | \"outLine\" | \"pageEdit\" | \"pageMove\" | \"pdf\" | \"remove\" | \"reset\" | \"robot\" | \"row\" | \"search\" | \"setting\" | \"star\" | \"synchronize\" | \"user\" | \"visibilityOff\" | \"visibilityOn\" | \"warehouseLine\" | \"warehouseSolid\" | \"warningFilled\" | \"warningOutline\" | \"youtube\" | undefined",
|
|
139
|
+
"references": {
|
|
140
|
+
"IconName": {
|
|
141
|
+
"location": "global",
|
|
142
|
+
"id": "global::IconName"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"required": false,
|
|
147
|
+
"optional": true,
|
|
148
|
+
"docs": {
|
|
149
|
+
"tags": [],
|
|
150
|
+
"text": ""
|
|
151
|
+
},
|
|
152
|
+
"getter": false,
|
|
153
|
+
"setter": false,
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"attribute": "icon"
|
|
156
|
+
},
|
|
157
|
+
"ariaLabel": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": ""
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"reflect": false,
|
|
174
|
+
"attribute": "aria-label",
|
|
175
|
+
"defaultValue": "''"
|
|
176
|
+
},
|
|
177
|
+
"disabled": {
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "boolean",
|
|
182
|
+
"resolved": "boolean",
|
|
183
|
+
"references": {}
|
|
184
|
+
},
|
|
185
|
+
"required": false,
|
|
186
|
+
"optional": false,
|
|
187
|
+
"docs": {
|
|
188
|
+
"tags": [],
|
|
189
|
+
"text": ""
|
|
190
|
+
},
|
|
191
|
+
"getter": false,
|
|
192
|
+
"setter": false,
|
|
193
|
+
"reflect": false,
|
|
194
|
+
"attribute": "disabled",
|
|
195
|
+
"defaultValue": "false"
|
|
196
|
+
},
|
|
197
|
+
"type": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"mutable": false,
|
|
200
|
+
"complexType": {
|
|
201
|
+
"original": "ButtonV2Type",
|
|
202
|
+
"resolved": "\"button\" | \"reset\" | \"submit\"",
|
|
203
|
+
"references": {
|
|
204
|
+
"ButtonV2Type": {
|
|
205
|
+
"location": "import",
|
|
206
|
+
"path": "./sd-button-v2.config",
|
|
207
|
+
"id": "src/components/sd-button-v2/sd-button-v2.config.ts::ButtonV2Type",
|
|
208
|
+
"referenceLocation": "ButtonV2Type"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": ""
|
|
217
|
+
},
|
|
218
|
+
"getter": false,
|
|
219
|
+
"setter": false,
|
|
220
|
+
"reflect": false,
|
|
221
|
+
"attribute": "type",
|
|
222
|
+
"defaultValue": "'button'"
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
static get events() {
|
|
227
|
+
return [{
|
|
228
|
+
"method": "click",
|
|
229
|
+
"name": "sdClick",
|
|
230
|
+
"bubbles": true,
|
|
231
|
+
"cancelable": true,
|
|
232
|
+
"composed": true,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [],
|
|
235
|
+
"text": ""
|
|
236
|
+
},
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "MouseEvent",
|
|
239
|
+
"resolved": "MouseEvent",
|
|
240
|
+
"references": {
|
|
241
|
+
"MouseEvent": {
|
|
242
|
+
"location": "global",
|
|
243
|
+
"id": "global::MouseEvent"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -3,7 +3,7 @@ export class SdCard {
|
|
|
3
3
|
bordered = false;
|
|
4
4
|
sdClass = '';
|
|
5
5
|
render() {
|
|
6
|
-
return (h(Fragment, { key: '
|
|
6
|
+
return (h(Fragment, { key: 'a4f5635186614df68acf04c502f804c9f0c77df5' }, h("div", { key: '99af2c33f69d069e108f7f122a6e7762ea918276', class: `sd-card ${this.bordered ? 'sd-card--bordered' : ''} ${this.sdClass}` }, h("slot", { key: '287c27708b9b80a9f04bfff87abdb65022762a6d' }))));
|
|
7
7
|
}
|
|
8
8
|
static get is() { return "sd-card"; }
|
|
9
9
|
static get originalStyleUrls() {
|
|
@@ -76,7 +76,7 @@ export class SdDatePicker {
|
|
|
76
76
|
this.isOpen = false;
|
|
77
77
|
};
|
|
78
78
|
render() {
|
|
79
|
-
return (h("div", { key: '
|
|
79
|
+
return (h("div", { key: '97baf5202e2702032b5d9035c5b07b3dafa658fa', class: { 'sd-date-picker': true, 'sd-date-picker--disabled': this.disabled } }, h("sd-input", { key: 'bba605148eec6f88829bcfff21cb1ac6efae815d', ref: el => (this.inputEl = el), value: this.value, label: this.label, "inside-label": true, readonly: true, disabled: this.disabled, placeholder: this.placeholder, inputClass: "sd-date-picker__input", onClick: () => this.openMenu() }, h("sd-icon", { key: '4c927154407efd9319b56327d83ee2012206b216', slot: "prefix", name: "date", size: "16", color: this.disabled ? 'grey_65' : 'grey_70', class: "date-icon", onClick: () => this.openMenu() })), this.isOpen && (h("sd-portal", { key: 'edc06ceeead0cab9ee3b2394097838e03aeb8703', open: this.isOpen, parentRef: this.inputEl, onSdClose: this.handleClose }, h("div", { key: 'cb71ba6e5517afa0e1e0477599449101b21ece65', class: "sd-date-picker__menu" }, h("div", { key: 'bdace5b8e99cbd4271ba76dace05f2af4d059d37', class: "sd-date-picker__header" }, h("div", { key: '3fc557c6119af299b813610e9b6ef6cd9104a302', class: "year-nav" }, h("button", { key: '82b7928c460b6bb3a163cf576977d4694fa63fdc', type: "button", name: "prev-year", title: "Previous Year", onClick: () => this.setCurrentYear(this.currentYear - 1) }, h("sd-icon", { key: 'b0eda3985494f99de52c85714b13ef45b90ef9db', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("span", { key: '24245489b718b3fb15603e9da628651b1af8b752', class: "year-nav__current" }, this.currentYear), h("button", { key: '458570d7e08af35d2c467398b89a9cb9c200141f', type: "button", name: "next-year", title: "Next Year", onClick: () => this.setCurrentYear(this.currentYear + 1) }, h("sd-icon", { key: '5f01f94d7499b0c79f2936249a295b92dfa1476d', name: "arrowRight", size: "12", color: "#CCCCCC" }))), h("div", { key: '5d1551a4149998430fd5c0262000c21e8de76a9b', class: "month-nav" }, h("button", { key: '0690296a789d67e5dc1b1ce7b882a261f1724a46', type: "button", name: "prev-month", title: "Previous ", onClick: () => this.handleUpdateMonth('prev') }, h("sd-icon", { key: '3ed6809573e28c9a40a4f26331669ce66245c076', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("span", { key: '5ae4ed6249269ba5a1d24ab986ec7c371fa356f4', class: "month-nav__current" }, this.currentMonth, "\uC6D4"), h("button", { key: '7bada1fba8abf6e483969cc5388cd333b03e8e19', type: "button", name: "next-month", title: "Next Month", onClick: () => this.handleUpdateMonth('next') }, h("sd-icon", { key: '559eec3f67ff8b47f601928d5bb9ca2064cb1c6a', name: "arrowRight", size: "12", color: "#CCCCCC" })))), h("div", { key: '5191a48970a3e9f044eaf4851e2e5d507763fe71', class: "sd-date-picker__days" }, ['일', '월', '화', '수', '목', '금', '토'].map(day => (h("div", { key: day, class: "day" }, day)))), h("div", { key: 'c124a70d9e1c3dd73c63c8ef3fd513a9cb6c24c8', class: "sd-date-picker__body" }, [
|
|
80
80
|
...this.calendar.prevMonthDays,
|
|
81
81
|
...this.calendar.days,
|
|
82
82
|
...this.calendar.afterMonthDays,
|
|
@@ -155,10 +155,10 @@ export class SdDateRangePicker {
|
|
|
155
155
|
this.setHoverDate(hoverDate);
|
|
156
156
|
}
|
|
157
157
|
render() {
|
|
158
|
-
return (h("div", { key: '
|
|
158
|
+
return (h("div", { key: 'e0eaf7463e91d3afed6ff977deb20d122e837fd4', class: {
|
|
159
159
|
'sd-date-range-picker': true,
|
|
160
160
|
'sd-date-range-picker--disabled': this.disabled,
|
|
161
|
-
} }, h("sd-input", { key: '
|
|
161
|
+
} }, h("sd-input", { key: '301a5133f5a6bcb5bd66fed546528808a96b822a', ref: el => (this.inputEl = el), value: !!this.dateRange[0] ? `${this.dateRange[0]} ~ ${this.dateRange[1]}` : '', label: this.label, "inside-label": true, readonly: true, disabled: this.disabled, placeholder: this.placeholder, inputClass: "sd-date-range-picker__input", onClick: () => this.openMenu() }, h("sd-icon", { key: 'ef7e9e74957d994a2e7a374f849ef1a5f03fe501', slot: "prefix", name: "date", size: "16", color: this.disabled ? 'grey_65' : 'grey_70', class: "date-icon", onClick: () => this.openMenu() })), this.isOpen && (h("sd-portal", { key: '0eb793bbc67d0da80bfdbb9d5e8c89857a9bd13d', open: this.isOpen, parentRef: this.inputEl, onSdClose: this.closeMenu }, h("div", { key: '6e7f6d3c0ba5d60cec929ff87f2b16c6fd1123ae', class: "sd-date-range-picker__menu" }, h("div", { key: 'bbc3b2117e226e86ad18e90d9549dfa33b8faa18', class: "sd-date-range-picker__header mb-16pxr flex flex-nowrap items-center justify-center" }, h("button", { key: 'e5246cbd684096c113a9568d42a4a86555fd55b0', type: "button", name: "prev", title: "Previous", onClick: () => this.setPrevYear(this.prevYear - 1) }, h("sd-icon", { key: '84281ab72847d7fe9352be583465b810854f2cfb', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("div", { key: '9d9394eea9a82bdcdc7918af50e98909610ab5e2', class: "header-label" }, this.prevYear), h("button", { key: '6f05a7477293b129561b1bdaa5fca46224f41af9', type: "button", name: "next", title: "Next", onClick: () => this.setPrevYear(this.prevYear + 1) }, h("sd-icon", { key: '746bc40e5d0bb72e9aa712012d411f20b459b80a', name: "arrowRight", size: "12", color: "#CCCCCC" }))), h("div", { key: '96a2c1674152f5ee31b29734b1471940b4d0f4b4', class: "sd-date-range-picker__body" }, [this.prevCalendar, this.nextCalendar].map((calendar, index) => (h(Fragment, null, index === 1 && h("div", { class: "separator" }), h("div", { key: index, class: "calendar-container" }, h("div", { class: "calendar-header" }, h("button", { type: "button", name: "month", title: "Month", class: index === 0 ? 'header-button-prev' : 'header-button-next', onClick: () => this.updateYearMonth(index === 0 ? 'prev' : 'next') }, h("sd-icon", { name: index === 0 ? 'arrowLeft' : 'arrowRight', size: "12", color: "#CCCCCC" })), index === 0
|
|
162
162
|
? `${this.prevYear}.${String(this.prevMonth).padStart(2, '0')}`
|
|
163
163
|
: `${this.nextYear}.${String(this.nextMonth).padStart(2, '0')}`), h("div", { class: "calendar-days" }, ['일', '월', '화', '수', '목', '금', '토'].map(day => (h("sd-date-box", { key: day, date: day, disabled: true, class: "day" })))), h("div", { class: "calendar-body mt-12pxr grid grid-cols-7 gap-y-8pxr" }, [...calendar.prevMonthDays, ...calendar.days, ...calendar.afterMonthDays].map((day, idx) => (h("sd-date-box", { key: `prev${day}_${idx}`, date: !day ? '' : Number(day), selected: this.dateRange.some(date => date === this.formatDate(index, Number(day))), type: this.getDateBoxType(this.formatDate(index, Number(day))), isToday: today === this.formatDate(index, Number(day)), disabled: !day ? true : this.isDisabledDate(this.formatDate(index, Number(day))), inRange: this.isDateInRange(this.formatDate(index, Number(day))), isStartDate: this.dateRange[0] === this.formatDate(index, Number(day)), isEndDate: this.dateRange[1] === this.formatDate(index, Number(day)), onSdClick: () => this.handleDateClick(index, Number(day)), onSdMouseOver: () => this.handleDateHover(index, Number(day)) }))))))))))))));
|
|
164
164
|
}
|