@proyecto-viviana/ui 0.6.1 → 0.6.3
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 +14 -16
- package/dist/_chunk/LinkButton.js +9 -9
- package/dist/_chunk/LinkButton.js.map +1 -1
- package/dist/_chunk/LinkButton.jsx +9 -9
- package/dist/_chunk/LinkButton.jsx.map +1 -1
- package/dist/_chunk/RangeCalendar.js +7 -7
- package/dist/_chunk/RangeCalendar.js.map +1 -1
- package/dist/_chunk/RangeCalendar.jsx +7 -7
- package/dist/_chunk/RangeCalendar.jsx.map +1 -1
- package/dist/_chunk/Tabs.js +2 -2
- package/dist/_chunk/Tabs.jsx +2 -2
- package/dist/_chunk/breadcrumbs.js +2 -2
- package/dist/_chunk/breadcrumbs.js.map +1 -1
- package/dist/_chunk/breadcrumbs.jsx +2 -2
- package/dist/_chunk/breadcrumbs.jsx.map +1 -1
- package/dist/_chunk/button.js +3 -3
- package/dist/_chunk/button.jsx +3 -3
- package/dist/_chunk/color.js +4 -4
- package/dist/_chunk/color.jsx +4 -4
- package/dist/_chunk/form.js +5 -7
- package/dist/_chunk/form.js.map +1 -1
- package/dist/_chunk/form.jsx +5 -8
- package/dist/_chunk/form.jsx.map +1 -1
- package/dist/_chunk/layout.js +5 -1
- package/dist/_chunk/layout.js.map +1 -1
- package/dist/_chunk/layout.jsx +5 -1
- package/dist/_chunk/layout.jsx.map +1 -1
- package/dist/_chunk/list.js +4 -4
- package/dist/_chunk/list.jsx +4 -4
- package/dist/_chunk/menu.js +1 -1
- package/dist/_chunk/menu.js.map +1 -1
- package/dist/_chunk/menu.jsx +1 -1
- package/dist/_chunk/menu.jsx.map +1 -1
- package/dist/_chunk/numberfield.js +2 -2
- package/dist/_chunk/numberfield.jsx +2 -2
- package/dist/_chunk/s2-action-button-styles.js +8 -8
- package/dist/_chunk/s2-action-button-styles.js.map +1 -1
- package/dist/_chunk/s2-action-button-styles.jsx +8 -8
- package/dist/_chunk/s2-action-button-styles.jsx.map +1 -1
- package/dist/_chunk/s2-menu-styles.js +1 -1
- package/dist/_chunk/s2-menu-styles.jsx +1 -1
- package/dist/_chunk/slider.js +6 -6
- package/dist/_chunk/slider.jsx +6 -6
- package/dist/_chunk/switch.js +2 -2
- package/dist/_chunk/switch.jsx +2 -2
- package/dist/_chunk/table.js +3 -3
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx +3 -3
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/text.js +1 -1
- package/dist/_chunk/text.jsx +1 -1
- package/dist/_chunk/textfield.js +4 -4
- package/dist/_chunk/textfield.jsx +4 -4
- package/dist/_chunk/toast.js +3 -3
- package/dist/_chunk/toast.jsx +3 -3
- package/dist/actiongroup/index.js +2 -2
- package/dist/actiongroup/index.jsx +2 -2
- package/dist/badge/index.js +6 -6
- package/dist/badge/index.jsx +6 -6
- package/dist/breadcrumbs/index.d.ts.map +1 -1
- package/dist/calendar/DateField.d.ts.map +1 -1
- package/dist/calendar/DateField.js +2 -2
- package/dist/calendar/DateField.js.map +1 -1
- package/dist/calendar/DateField.jsx +2 -2
- package/dist/calendar/DateField.jsx.map +1 -1
- package/dist/calendar/DatePicker.d.ts.map +1 -1
- package/dist/calendar/DatePicker.js +2 -2
- package/dist/calendar/DatePicker.js.map +1 -1
- package/dist/calendar/DatePicker.jsx +2 -2
- package/dist/calendar/DatePicker.jsx.map +1 -1
- package/dist/calendar/DateRangePicker.js +2 -2
- package/dist/calendar/DateRangePicker.jsx +2 -2
- package/dist/calendar/RangeCalendar.d.ts.map +1 -1
- package/dist/calendar/TimeField.d.ts.map +1 -1
- package/dist/calendar/TimeField.js +2 -2
- package/dist/calendar/TimeField.js.map +1 -1
- package/dist/calendar/TimeField.jsx +2 -2
- package/dist/calendar/TimeField.jsx.map +1 -1
- package/dist/calendar/index.js +5 -5
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.jsx +5 -5
- package/dist/calendar/index.jsx.map +1 -1
- package/dist/checkbox/index.js +3 -3
- package/dist/checkbox/index.jsx +3 -3
- package/dist/combobox/index.js +2 -2
- package/dist/combobox/index.jsx +2 -2
- package/dist/dropzone/index.js +1 -1
- package/dist/dropzone/index.jsx +1 -1
- package/dist/font-faces.css +13 -6
- package/dist/form/index.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.jsx.map +1 -1
- package/dist/inlinealert/index.js +6 -6
- package/dist/inlinealert/index.jsx +6 -6
- package/dist/labeledvalue/index.js +1 -1
- package/dist/labeledvalue/index.jsx +1 -1
- package/dist/layout/Flex.d.ts +2 -0
- package/dist/layout/Flex.d.ts.map +1 -1
- package/dist/link/index.d.ts.map +1 -1
- package/dist/link/index.js +1 -4
- package/dist/link/index.js.map +1 -1
- package/dist/link/index.jsx +1 -4
- package/dist/link/index.jsx.map +1 -1
- package/dist/listbox/index.js +3 -3
- package/dist/listbox/index.jsx +4 -4
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/meter/index.d.ts.map +1 -1
- package/dist/meter/index.js +2 -2
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.jsx +2 -2
- package/dist/meter/index.jsx.map +1 -1
- package/dist/notificationbadge/index.js +1 -1
- package/dist/notificationbadge/index.jsx +1 -1
- package/dist/picker/index.js +3 -3
- package/dist/picker/index.jsx +3 -3
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.jsx +1 -1
- package/dist/progress/ProgressCircle.js +2 -2
- package/dist/progress/ProgressCircle.js.map +1 -1
- package/dist/progress/ProgressCircle.jsx +2 -2
- package/dist/progress/ProgressCircle.jsx.map +1 -1
- package/dist/progress-bar/index.js +4 -4
- package/dist/progress-bar/index.jsx +4 -4
- package/dist/radio/index.js +2 -2
- package/dist/radio/index.jsx +2 -2
- package/dist/searchfield/index.js +2 -2
- package/dist/searchfield/index.jsx +2 -2
- package/dist/segmentedcontrol/index.js +2 -5
- package/dist/segmentedcontrol/index.js.map +1 -1
- package/dist/segmentedcontrol/index.jsx +2 -5
- package/dist/segmentedcontrol/index.jsx.map +1 -1
- package/dist/select/index.js +3 -3
- package/dist/select/index.jsx +3 -3
- package/dist/selectboxgroup/index.js +1 -1
- package/dist/selectboxgroup/index.jsx +1 -1
- package/dist/statuslight/index.js +1 -1
- package/dist/statuslight/index.jsx +1 -1
- package/dist/steplist/index.js +5 -5
- package/dist/steplist/index.jsx +5 -5
- package/dist/style/glasselated-ramps.d.ts.map +1 -1
- package/dist/style/index.js +18 -9
- package/dist/style/index.js.map +1 -1
- package/dist/style/spectrum-theme.d.ts +7 -7
- package/dist/style/spectrum-theme.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/tag-group/index.js +10 -10
- package/dist/tag-group/index.js.map +1 -1
- package/dist/tag-group/index.jsx +10 -10
- package/dist/tag-group/index.jsx.map +1 -1
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js.map +1 -1
- package/dist/toolbar/index.jsx.map +1 -1
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +5 -5
- package/dist/tree/index.js.map +1 -1
- package/dist/tree/index.jsx +5 -5
- package/dist/tree/index.jsx.map +1 -1
- package/dist/viviana-tokens.css +39 -12
- package/package.json +18 -5
- package/src/breadcrumbs/index.tsx +14 -7
- package/src/button/s2-action-button-styles.ts +8 -8
- package/src/button/s2-button-styles.ts +8 -8
- package/src/calendar/DateField.tsx +2 -6
- package/src/calendar/DatePicker.tsx +8 -1
- package/src/calendar/RangeCalendar.tsx +13 -7
- package/src/calendar/TimeField.tsx +2 -6
- package/src/calendar/index.tsx +4 -4
- package/src/font-faces.css +13 -6
- package/src/form/index.tsx +5 -6
- package/src/icon/pixel-icons/PixelChartIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCheckIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelChevronDownIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelChevronRightIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelClockIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCodeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCommunityIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCubeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelFlameIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelHomeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelLayoutIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelMessageIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavCommunityIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavExploreIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavLiveIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavPathwaysIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavPlaygroundIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavProjectsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavReferenceIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavSettingsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavTopicsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNotificationIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelPathwaysIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelPlayIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSearchIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSettingsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSparkleIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelTopicsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelUserIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelZapIcon.tsx +4 -1
- package/src/layout/Flex.tsx +7 -0
- package/src/link/index.tsx +3 -1
- package/src/menu/index.tsx +1 -3
- package/src/meter/index.tsx +1 -3
- package/src/progress/ProgressCircle.tsx +1 -1
- package/src/segmentedcontrol/index.tsx +6 -6
- package/src/style/glasselated-ramps.ts +37 -33
- package/src/style/spectrum-theme.ts +22 -17
- package/src/table/index.tsx +1 -3
- package/src/tag-group/index.tsx +8 -8
- package/src/toolbar/index.tsx +4 -1
- package/src/tree/index.tsx +3 -11
- package/src/viviana-tokens.css +39 -12
package/dist/_chunk/color.jsx
CHANGED
|
@@ -106,7 +106,7 @@ const colorSliderLabel = function anonymous(props) {
|
|
|
106
106
|
}
|
|
107
107
|
if (props.isStaticColor) rules += " pl151";
|
|
108
108
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
109
|
-
else rules += "
|
|
109
|
+
else rules += " pWQ7V3d151";
|
|
110
110
|
rules += " plb151";
|
|
111
111
|
rules += " ri151";
|
|
112
112
|
return rules;
|
|
@@ -171,7 +171,7 @@ const colorSliderOutput = function anonymous(props) {
|
|
|
171
171
|
rules += " _FnuYUweb151";
|
|
172
172
|
}
|
|
173
173
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
174
|
-
else rules += "
|
|
174
|
+
else rules += " pWQ7V3d151";
|
|
175
175
|
rules += " ri151";
|
|
176
176
|
return rules;
|
|
177
177
|
};
|
|
@@ -825,7 +825,7 @@ function createColorFieldStyles() {
|
|
|
825
825
|
}
|
|
826
826
|
if (props.isStaticColor) rules += " pl151";
|
|
827
827
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
828
|
-
else rules += "
|
|
828
|
+
else rules += " pWQ7V3d151";
|
|
829
829
|
rules += " plb151";
|
|
830
830
|
rules += " ri151";
|
|
831
831
|
return rules;
|
|
@@ -1024,7 +1024,7 @@ function createColorFieldStyles() {
|
|
|
1024
1024
|
} else if (props.isInvalid) {
|
|
1025
1025
|
rules += " pYjUhNc151";
|
|
1026
1026
|
rules += " plQBRyrc151";
|
|
1027
|
-
} else rules += "
|
|
1027
|
+
} else rules += " pWQ7V3d151";
|
|
1028
1028
|
rules += " -_8sjo0b-t5ZbAob151";
|
|
1029
1029
|
rules += " _qb151";
|
|
1030
1030
|
rules += " TgOnRt151";
|
package/dist/_chunk/form.js
CHANGED
|
@@ -54,7 +54,7 @@ const fieldLabelStyles = function anonymous(props) {
|
|
|
54
54
|
rules += " _FnuYUweb151";
|
|
55
55
|
}
|
|
56
56
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
57
|
-
else rules += "
|
|
57
|
+
else rules += " pWQ7V3d151";
|
|
58
58
|
return rules;
|
|
59
59
|
};
|
|
60
60
|
const fieldTextStyles = function anonymous(props) {
|
|
@@ -84,7 +84,7 @@ const fieldTextStyles = function anonymous(props) {
|
|
|
84
84
|
}
|
|
85
85
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
86
86
|
else if (props.isInvalid) rules += " pYjUhNc151";
|
|
87
|
-
else rules += "
|
|
87
|
+
else rules += " pWQ7V3d151";
|
|
88
88
|
return rules;
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -185,7 +185,7 @@ const helpTextStyles = function anonymous(props) {
|
|
|
185
185
|
rules += " _FnuYUweb151";
|
|
186
186
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
187
187
|
else if (props.isInvalid) rules += " pYjUhNc151";
|
|
188
|
-
else rules += "
|
|
188
|
+
else rules += " pWQ7V3d151";
|
|
189
189
|
return rules;
|
|
190
190
|
};
|
|
191
191
|
/**
|
|
@@ -307,8 +307,7 @@ function Form$1(props) {
|
|
|
307
307
|
"styles",
|
|
308
308
|
"UNSAFE_className",
|
|
309
309
|
"UNSAFE_style",
|
|
310
|
-
"ref"
|
|
311
|
-
"children"
|
|
310
|
+
"ref"
|
|
312
311
|
]);
|
|
313
312
|
const size = () => local.size ?? "M";
|
|
314
313
|
const labelPosition = () => local.labelPosition ?? "top";
|
|
@@ -349,8 +348,7 @@ function Form$1(props) {
|
|
|
349
348
|
},
|
|
350
349
|
get style() {
|
|
351
350
|
return local.UNSAFE_style;
|
|
352
|
-
}
|
|
353
|
-
children: (renderProps) => typeof local.children === "function" ? local.children(renderProps) : local.children
|
|
351
|
+
}
|
|
354
352
|
}));
|
|
355
353
|
}
|
|
356
354
|
});
|
package/dist/_chunk/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":[],"sources":["../../src/form/Field.tsx","../../src/form/HelpText.tsx","../../src/form/index.tsx"],"sourcesContent":["import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface FieldProps {\n /** The label for the field. */\n label?: string;\n /** A description or help text for the field. */\n description?: string;\n /** An error message for the field. */\n errorMessage?: string;\n /** Whether the field is required. */\n isRequired?: boolean;\n /** Whether the field is disabled. */\n isDisabled?: boolean;\n /** Whether the field is invalid. */\n isInvalid?: boolean;\n /** The size of the field. @default 'md' */\n size?: FieldSize;\n /** Additional CSS class name. */\n class?: string;\n /** The field content (input element). */\n children?: JSX.Element;\n /** ID for the label's htmlFor attribute. */\n htmlFor?: string;\n}\n\n// Vertical field stack. The label/help-text colors mirror S2's `fieldLabel()`\n// and `helpTextStyles` (`neutral-subdued`, flipping to `negative`/`disabled`);\n// sizes map sm/md/lg → the UI font's xs/sm/base steps. Routed through the\n// `style()` macro so the CSS ships in the package bundle for installed consumers.\nconst fieldStyles = style<{ size: FieldSize }>({\n display: \"flex\",\n flexDirection: \"column\",\n gap: { default: 8, size: { sm: 4, lg: 12 } },\n});\n\nconst fieldLabelStyles = style<{ size: FieldSize; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\", lg: \"ui\" } },\n color: { default: \"neutral-subdued\", isDisabled: \"disabled\" },\n});\n\nconst fieldTextStyles = style<{ size: FieldSize; isInvalid?: boolean; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\" } },\n color: { default: \"neutral-subdued\", isInvalid: \"negative\", isDisabled: \"disabled\" },\n});\n\nconst requiredStyles = style({ color: \"negative\", marginStart: 2 });\n\n/**\n * A field layout component that provides label, help text, and error message\n * around a form input.\n */\nexport function Field(props: FieldProps): JSX.Element {\n const [local] = splitProps(props, [\n \"label\",\n \"description\",\n \"errorMessage\",\n \"isRequired\",\n \"isDisabled\",\n \"isInvalid\",\n \"size\",\n \"class\",\n \"children\",\n \"htmlFor\",\n ]);\n\n const size = () => local.size ?? \"md\";\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={[fieldStyles({ size: size() }), local.class].filter(Boolean).join(\" \")}>\n <Show when={local.label}>\n <label\n for={local.htmlFor}\n class={fieldLabelStyles({ size: size(), isDisabled: local.isDisabled })}\n >\n {local.label}\n <Show when={local.isRequired}>\n <span class={requiredStyles}>*</span>\n </Show>\n </label>\n </Show>\n\n {local.children}\n\n <Show when={showError()}>\n <p class={fieldTextStyles({ size: size(), isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n\n <Show when={!showError() && local.description}>\n <p class={fieldTextStyles({ size: size(), isDisabled: local.isDisabled })}>\n {local.description}\n </p>\n </Show>\n </div>\n );\n}\n","import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport interface HelpTextProps {\n /** The description text. */\n description?: string;\n /** The error message text. */\n errorMessage?: string;\n /** Whether the field is in an error state. */\n isInvalid?: boolean;\n /** Whether the help text is disabled (dimmed). */\n isDisabled?: boolean;\n /** Additional CSS class name. */\n class?: string;\n}\n\n// Mirrors S2's `helpTextStyles` (Field.tsx): the small UI font with a\n// `neutral-subdued` description color that flips to `negative` for errors and\n// `disabled` when the field is disabled. Emitted via the `style()` macro so the\n// CSS ships in the package bundle for installed consumers.\nconst helpTextStyles = style<{ isInvalid?: boolean; isDisabled?: boolean }>({\n font: \"ui-sm\",\n color: {\n default: \"neutral-subdued\",\n isInvalid: \"negative\",\n isDisabled: \"disabled\",\n },\n});\n\n/**\n * Displays description or error text below a form field.\n */\nexport function HelpText(props: HelpTextProps): JSX.Element {\n const [local] = splitProps(props, [\n \"description\",\n \"errorMessage\",\n \"isInvalid\",\n \"isDisabled\",\n \"class\",\n ]);\n\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={local.class}>\n <Show when={showError()}>\n <p class={helpTextStyles({ isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n <Show when={!showError() && local.description}>\n <p class={helpTextStyles({ isDisabled: local.isDisabled })}>{local.description}</p>\n </Show>\n </div>\n );\n}\n","import { type JSX, createContext, splitProps, useContext } from \"solid-js\";\nimport {\n Form as HeadlessForm,\n FieldError as HeadlessFieldError,\n type FormProps as HeadlessFormProps,\n type FieldErrorProps as HeadlessFieldErrorProps,\n} from \"@proyecto-viviana/solidaria-components\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport { getAllowedOverrides } from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport { createIsSkeleton } from \"../skeleton\";\nimport { assignRef } from \"../button/spectrum-context\";\n\nexport type FormSize = \"S\" | \"M\" | \"L\" | \"XL\";\nexport type FormLabelPosition = \"top\" | \"side\";\nexport type FormLabelAlign = \"start\" | \"end\";\nexport type FormNecessityIndicator = \"icon\" | \"label\";\n\nexport interface FormStyleProps {\n /** The size of descendant Form elements. @default 'M' */\n size?: FormSize;\n /** The label's overall position relative to each field. @default 'top' */\n labelPosition?: FormLabelPosition;\n /** The label's horizontal alignment relative to each field. @default 'start' */\n labelAlign?: FormLabelAlign;\n /** Whether required fields show an icon or text label. @default 'icon' */\n necessityIndicator?: FormNecessityIndicator;\n /** Whether descendant Form elements are required. */\n isRequired?: boolean;\n /** Whether descendant Form elements are disabled. */\n isDisabled?: boolean;\n /** Whether descendant Form elements are rendered with emphasized styling. */\n isEmphasized?: boolean;\n}\n\nexport interface FormProps\n extends Omit<HeadlessFormProps, \"class\" | \"style\" | \"ref\">, FormStyleProps {\n /** Spectrum-defined generated classes. */\n styles?: StyleString;\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n ref?: HeadlessFormProps[\"ref\"];\n}\n\nexport interface FieldErrorProps extends Omit<HeadlessFieldErrorProps, \"class\"> {\n class?: string;\n}\n\nexport const FormContext = createContext<FormStyleProps | null>(null);\n\nconst formStylePropKeys = [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n] as const;\n\nexport function useIsInForm(): boolean {\n return useContext(FormContext) != null;\n}\n\nexport function useFormProps<T extends object>(props: T): T {\n const context = useContext(FormContext);\n const isSkeleton = createIsSkeleton();\n\n const getInheritedValue = (property: PropertyKey) => {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n if (typeof property !== \"string\") {\n return undefined;\n }\n\n return context?.[property as keyof FormStyleProps];\n };\n\n return new Proxy(props, {\n get(target, property, receiver) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n const localValue = Reflect.get(target, property, receiver);\n if (localValue !== undefined) {\n return localValue;\n }\n\n return getInheritedValue(property);\n },\n has(target, property) {\n return Reflect.has(target, property) || getInheritedValue(property) !== undefined;\n },\n ownKeys(target) {\n const keys = new Set<ReturnType<typeof Reflect.ownKeys>[number]>(Reflect.ownKeys(target));\n\n for (const key of formStylePropKeys) {\n if (getInheritedValue(key) !== undefined) {\n keys.add(key);\n }\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return {\n enumerable: true,\n configurable: true,\n get: () => true,\n };\n }\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (getInheritedValue(property) !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => getInheritedValue(property),\n };\n }\n\n return undefined;\n },\n }) as T;\n}\n\nconst formStyles = style<{ labelPosition: FormLabelPosition; size: FormSize }>(\n {\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"[field] 1fr\"],\n side: [\"[label] auto\", \"[field] 1fr\"],\n },\n },\n rowGap: {\n size: {\n S: 20,\n M: 24,\n L: 32,\n XL: 40,\n },\n },\n columnGap: \"text-to-control\",\n },\n getAllowedOverrides(),\n);\n\nexport function Form(props: FormProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"ref\",\n \"children\",\n ]);\n\n const size = () => local.size ?? \"M\";\n const labelPosition = () => local.labelPosition ?? \"top\";\n const labelAlign = () => local.labelAlign ?? \"start\";\n const necessityIndicator = () => local.necessityIndicator ?? \"icon\";\n\n const contextValue: FormStyleProps = {\n get size() {\n return size();\n },\n get labelPosition() {\n return labelPosition();\n },\n get labelAlign() {\n return labelAlign();\n },\n get necessityIndicator() {\n return necessityIndicator();\n },\n get isRequired() {\n return local.isRequired;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get isEmphasized() {\n return local.isEmphasized;\n },\n };\n\n return (\n <FormContext.Provider value={contextValue}>\n <HeadlessForm\n {...headlessProps}\n ref={(el) => assignRef(local.ref, el)}\n class={[\n local.UNSAFE_className,\n formStyles({ size: size(), labelPosition: labelPosition() }, local.styles),\n ]\n .filter(Boolean)\n .join(\" \")}\n style={local.UNSAFE_style}\n >\n {(renderProps) =>\n typeof local.children === \"function\" ? local.children(renderProps) : local.children\n }\n </HeadlessForm>\n </FormContext.Provider>\n );\n}\n\n// Small UI font in the `negative` color, mirroring S2's help-text error state.\nconst fieldErrorStyles = style({ font: \"ui-sm\", color: \"negative\" });\n\nexport function FieldError(props: FieldErrorProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\"class\"]);\n return (\n <HeadlessFieldError\n {...headlessProps}\n class={[fieldErrorStyles, local.class].filter(Boolean).join(\" \")}\n />\n );\n}\n\nexport { Field } from \"./Field\";\nexport type { FieldProps, FieldSize } from \"./Field\";\nexport { HelpText } from \"./HelpText\";\nexport type { HelpTextProps } from \"./HelpText\";\n"],"mappings":";;;;;;;;AAgCA,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;AAMN,MAAM,mBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM,kBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWN,SAAgB,MAAM,OAAwB;CAC5C,MAAM,CAAC,SAAS,WAAW,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAA,CACD;CAED,MAAM,aAAa,MAAM,QAAQ;CACjC,MAAM,kBAAkB,MAAM,aAAa,MAAM;CAEjD,cAAA;EAAA,IAAA,OAAA,eAAA,OAAA,GAAA,QAAA,KAAA,YAAA,CAAA,OAAA,SAAA,cAAA,MAAA,WAAA,GAAA,SAAA,MAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OAAA,WAAA,GAAA,SAAA,OAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OAAA,WAAA,GAAA,SAAA,OAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OA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A;CAAA,CAAA;AAK7F;AAGA,MAAM,mBAAA;AAEN,SAAgB,aAAW,OAA6B;CACtD,MAAM,CAAC,OAAO,iBAAiB,WAAW,OAAO,CAAC,OAAA,CAAQ;CAC1D,OAAA,gBACG,YAAA,WACK,eAAa,EAAA,KAAA,WAAA;EAAA,OACV,CAAC,kBAAkB,MAAM,KAAK,EAAE,OAAO,OAAA,EAAS,KAAK,GAAA;CAAA,EAAA,CAAA,CAAA;AAGlE"}
|
|
1
|
+
{"version":3,"file":"form.js","names":[],"sources":["../../src/form/Field.tsx","../../src/form/HelpText.tsx","../../src/form/index.tsx"],"sourcesContent":["import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface FieldProps {\n /** The label for the field. */\n label?: string;\n /** A description or help text for the field. */\n description?: string;\n /** An error message for the field. */\n errorMessage?: string;\n /** Whether the field is required. */\n isRequired?: boolean;\n /** Whether the field is disabled. */\n isDisabled?: boolean;\n /** Whether the field is invalid. */\n isInvalid?: boolean;\n /** The size of the field. @default 'md' */\n size?: FieldSize;\n /** Additional CSS class name. */\n class?: string;\n /** The field content (input element). */\n children?: JSX.Element;\n /** ID for the label's htmlFor attribute. */\n htmlFor?: string;\n}\n\n// Vertical field stack. The label/help-text colors mirror S2's `fieldLabel()`\n// and `helpTextStyles` (`neutral-subdued`, flipping to `negative`/`disabled`);\n// sizes map sm/md/lg → the UI font's xs/sm/base steps. Routed through the\n// `style()` macro so the CSS ships in the package bundle for installed consumers.\nconst fieldStyles = style<{ size: FieldSize }>({\n display: \"flex\",\n flexDirection: \"column\",\n gap: { default: 8, size: { sm: 4, lg: 12 } },\n});\n\nconst fieldLabelStyles = style<{ size: FieldSize; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\", lg: \"ui\" } },\n color: { default: \"neutral-subdued\", isDisabled: \"disabled\" },\n});\n\nconst fieldTextStyles = style<{ size: FieldSize; isInvalid?: boolean; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\" } },\n color: { default: \"neutral-subdued\", isInvalid: \"negative\", isDisabled: \"disabled\" },\n});\n\nconst requiredStyles = style({ color: \"negative\", marginStart: 2 });\n\n/**\n * A field layout component that provides label, help text, and error message\n * around a form input.\n */\nexport function Field(props: FieldProps): JSX.Element {\n const [local] = splitProps(props, [\n \"label\",\n \"description\",\n \"errorMessage\",\n \"isRequired\",\n \"isDisabled\",\n \"isInvalid\",\n \"size\",\n \"class\",\n \"children\",\n \"htmlFor\",\n ]);\n\n const size = () => local.size ?? \"md\";\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={[fieldStyles({ size: size() }), local.class].filter(Boolean).join(\" \")}>\n <Show when={local.label}>\n <label\n for={local.htmlFor}\n class={fieldLabelStyles({ size: size(), isDisabled: local.isDisabled })}\n >\n {local.label}\n <Show when={local.isRequired}>\n <span class={requiredStyles}>*</span>\n </Show>\n </label>\n </Show>\n\n {local.children}\n\n <Show when={showError()}>\n <p class={fieldTextStyles({ size: size(), isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n\n <Show when={!showError() && local.description}>\n <p class={fieldTextStyles({ size: size(), isDisabled: local.isDisabled })}>\n {local.description}\n </p>\n </Show>\n </div>\n );\n}\n","import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport interface HelpTextProps {\n /** The description text. */\n description?: string;\n /** The error message text. */\n errorMessage?: string;\n /** Whether the field is in an error state. */\n isInvalid?: boolean;\n /** Whether the help text is disabled (dimmed). */\n isDisabled?: boolean;\n /** Additional CSS class name. */\n class?: string;\n}\n\n// Mirrors S2's `helpTextStyles` (Field.tsx): the small UI font with a\n// `neutral-subdued` description color that flips to `negative` for errors and\n// `disabled` when the field is disabled. Emitted via the `style()` macro so the\n// CSS ships in the package bundle for installed consumers.\nconst helpTextStyles = style<{ isInvalid?: boolean; isDisabled?: boolean }>({\n font: \"ui-sm\",\n color: {\n default: \"neutral-subdued\",\n isInvalid: \"negative\",\n isDisabled: \"disabled\",\n },\n});\n\n/**\n * Displays description or error text below a form field.\n */\nexport function HelpText(props: HelpTextProps): JSX.Element {\n const [local] = splitProps(props, [\n \"description\",\n \"errorMessage\",\n \"isInvalid\",\n \"isDisabled\",\n \"class\",\n ]);\n\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={local.class}>\n <Show when={showError()}>\n <p class={helpTextStyles({ isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n <Show when={!showError() && local.description}>\n <p class={helpTextStyles({ isDisabled: local.isDisabled })}>{local.description}</p>\n </Show>\n </div>\n );\n}\n","import { type JSX, createContext, splitProps, useContext } from \"solid-js\";\nimport {\n Form as HeadlessForm,\n FieldError as HeadlessFieldError,\n type FormProps as HeadlessFormProps,\n type FieldErrorProps as HeadlessFieldErrorProps,\n} from \"@proyecto-viviana/solidaria-components\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport { getAllowedOverrides } from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport { createIsSkeleton } from \"../skeleton\";\nimport { assignRef } from \"../button/spectrum-context\";\n\nexport type FormSize = \"S\" | \"M\" | \"L\" | \"XL\";\nexport type FormLabelPosition = \"top\" | \"side\";\nexport type FormLabelAlign = \"start\" | \"end\";\nexport type FormNecessityIndicator = \"icon\" | \"label\";\n\nexport interface FormStyleProps {\n /** The size of descendant Form elements. @default 'M' */\n size?: FormSize;\n /** The label's overall position relative to each field. @default 'top' */\n labelPosition?: FormLabelPosition;\n /** The label's horizontal alignment relative to each field. @default 'start' */\n labelAlign?: FormLabelAlign;\n /** Whether required fields show an icon or text label. @default 'icon' */\n necessityIndicator?: FormNecessityIndicator;\n /** Whether descendant Form elements are required. */\n isRequired?: boolean;\n /** Whether descendant Form elements are disabled. */\n isDisabled?: boolean;\n /** Whether descendant Form elements are rendered with emphasized styling. */\n isEmphasized?: boolean;\n}\n\nexport interface FormProps\n extends Omit<HeadlessFormProps, \"class\" | \"style\" | \"ref\">, FormStyleProps {\n /** Spectrum-defined generated classes. */\n styles?: StyleString;\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n ref?: HeadlessFormProps[\"ref\"];\n}\n\nexport interface FieldErrorProps extends Omit<HeadlessFieldErrorProps, \"class\"> {\n class?: string;\n}\n\nexport const FormContext = createContext<FormStyleProps | null>(null);\n\nconst formStylePropKeys = [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n] as const;\n\nexport function useIsInForm(): boolean {\n return useContext(FormContext) != null;\n}\n\nexport function useFormProps<T extends object>(props: T): T {\n const context = useContext(FormContext);\n const isSkeleton = createIsSkeleton();\n\n const getInheritedValue = (property: PropertyKey) => {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n if (typeof property !== \"string\") {\n return undefined;\n }\n\n return context?.[property as keyof FormStyleProps];\n };\n\n return new Proxy(props, {\n get(target, property, receiver) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n const localValue = Reflect.get(target, property, receiver);\n if (localValue !== undefined) {\n return localValue;\n }\n\n return getInheritedValue(property);\n },\n has(target, property) {\n return Reflect.has(target, property) || getInheritedValue(property) !== undefined;\n },\n ownKeys(target) {\n const keys = new Set<ReturnType<typeof Reflect.ownKeys>[number]>(Reflect.ownKeys(target));\n\n for (const key of formStylePropKeys) {\n if (getInheritedValue(key) !== undefined) {\n keys.add(key);\n }\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return {\n enumerable: true,\n configurable: true,\n get: () => true,\n };\n }\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (getInheritedValue(property) !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => getInheritedValue(property),\n };\n }\n\n return undefined;\n },\n }) as T;\n}\n\nconst formStyles = style<{ labelPosition: FormLabelPosition; size: FormSize }>(\n {\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"[field] 1fr\"],\n side: [\"[label] auto\", \"[field] 1fr\"],\n },\n },\n rowGap: {\n size: {\n S: 20,\n M: 24,\n L: 32,\n XL: 40,\n },\n },\n columnGap: \"text-to-control\",\n },\n getAllowedOverrides(),\n);\n\nexport function Form(props: FormProps): JSX.Element {\n // Leave `children` on the headless rest props so they flow through as a\n // lazy Solid getter — do not split them off and re-wrap. A forced\n // `(rp) => children` render-prop wrapper desyncs createUniqueId between SSR\n // and client (Form+Button hydration mismatch). See solid-spectrum Form.\n const [local, headlessProps] = splitProps(props, [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"ref\",\n ]);\n\n const size = () => local.size ?? \"M\";\n const labelPosition = () => local.labelPosition ?? \"top\";\n const labelAlign = () => local.labelAlign ?? \"start\";\n const necessityIndicator = () => local.necessityIndicator ?? \"icon\";\n\n const contextValue: FormStyleProps = {\n get size() {\n return size();\n },\n get labelPosition() {\n return labelPosition();\n },\n get labelAlign() {\n return labelAlign();\n },\n get necessityIndicator() {\n return necessityIndicator();\n },\n get isRequired() {\n return local.isRequired;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get isEmphasized() {\n return local.isEmphasized;\n },\n };\n\n return (\n <FormContext.Provider value={contextValue}>\n <HeadlessForm\n {...headlessProps}\n ref={(el) => assignRef(local.ref, el)}\n class={[\n local.UNSAFE_className,\n formStyles({ size: size(), labelPosition: labelPosition() }, local.styles),\n ]\n .filter(Boolean)\n .join(\" \")}\n style={local.UNSAFE_style}\n />\n </FormContext.Provider>\n );\n}\n\n// Small UI font in the `negative` color, mirroring S2's help-text error state.\nconst fieldErrorStyles = style({ font: \"ui-sm\", color: \"negative\" });\n\nexport function FieldError(props: FieldErrorProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\"class\"]);\n return (\n <HeadlessFieldError\n {...headlessProps}\n class={[fieldErrorStyles, local.class].filter(Boolean).join(\" \")}\n />\n );\n}\n\nexport { Field } from \"./Field\";\nexport type { FieldProps, FieldSize } from \"./Field\";\nexport { HelpText } from \"./HelpText\";\nexport type { HelpTextProps } from \"./HelpText\";\n"],"mappings":";;;;;;;;AAgCA,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;AAMN,MAAM,mBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM,kBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWN,SAAgB,MAAM,OAAwB;CAC5C,MAAM,CAAC,SAAS,WAAW,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAA,CACD;CAED,MAAM,aAAa,MAAM,QAAQ;CACjC,MAAM,kBAAkB,MAAM,aAAa,MAAM;CAEjD,cAAA;EAAA,IAAA,OAAA,eAAA,OAAA,GAAA,QAAA,KAAA,YAAA,CAAA,OAAA,SAAA,cAAA,MAAA,WAAA,GAAA,SAAA,MAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OAAA,WAAA,GAAA,SAAA,OAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OAAA,WAAA,GAAA,SAAA,OAAA,aAAA,CAAA,QAAA,SAAA,cAAA,OAAA,WAAA;EAAA,OAAA,MAAA,gBAEK,MAAA;GAAA,IAAK,OAAA;IAAA,OAAM,MAAM;GAAK;GAAA,IAAA,WAAA;IAA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;EAAA,OACV,CAAC,kBAAkB,MAAM,KAAK,EAAE,OAAO,OAAA,EAAS,KAAK,GAAA;CAAA,EAAA,CAAA,CAAA;AAGlE"}
|
package/dist/_chunk/form.jsx
CHANGED
|
@@ -51,7 +51,7 @@ const fieldLabelStyles = function anonymous(props) {
|
|
|
51
51
|
rules += " _FnuYUweb151";
|
|
52
52
|
}
|
|
53
53
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
54
|
-
else rules += "
|
|
54
|
+
else rules += " pWQ7V3d151";
|
|
55
55
|
return rules;
|
|
56
56
|
};
|
|
57
57
|
const fieldTextStyles = function anonymous(props) {
|
|
@@ -81,7 +81,7 @@ const fieldTextStyles = function anonymous(props) {
|
|
|
81
81
|
}
|
|
82
82
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
83
83
|
else if (props.isInvalid) rules += " pYjUhNc151";
|
|
84
|
-
else rules += "
|
|
84
|
+
else rules += " pWQ7V3d151";
|
|
85
85
|
return rules;
|
|
86
86
|
};
|
|
87
87
|
const requiredStyles = " pYjUhNc151 Ir151";
|
|
@@ -150,7 +150,7 @@ const helpTextStyles = function anonymous(props) {
|
|
|
150
150
|
rules += " _FnuYUweb151";
|
|
151
151
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
152
152
|
else if (props.isInvalid) rules += " pYjUhNc151";
|
|
153
|
-
else rules += "
|
|
153
|
+
else rules += " pWQ7V3d151";
|
|
154
154
|
return rules;
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
@@ -254,8 +254,7 @@ function Form$1(props) {
|
|
|
254
254
|
"styles",
|
|
255
255
|
"UNSAFE_className",
|
|
256
256
|
"UNSAFE_style",
|
|
257
|
-
"ref"
|
|
258
|
-
"children"
|
|
257
|
+
"ref"
|
|
259
258
|
]);
|
|
260
259
|
const size = () => local.size ?? "M";
|
|
261
260
|
const labelPosition = () => local.labelPosition ?? "top";
|
|
@@ -288,9 +287,7 @@ function Form$1(props) {
|
|
|
288
287
|
<Form {...headlessProps} ref={(el) => assignRef(local.ref, el)} class={[local.UNSAFE_className, formStyles({
|
|
289
288
|
size: size(),
|
|
290
289
|
labelPosition: labelPosition()
|
|
291
|
-
}, local.styles)].filter(Boolean).join(" ")} style={local.UNSAFE_style}
|
|
292
|
-
{(renderProps) => typeof local.children === "function" ? local.children(renderProps) : local.children}
|
|
293
|
-
</Form>
|
|
290
|
+
}, local.styles)].filter(Boolean).join(" ")} style={local.UNSAFE_style} />
|
|
294
291
|
</FormContext.Provider>;
|
|
295
292
|
}
|
|
296
293
|
const fieldErrorStyles = " uxe7h4151 -_6BNtrc-b151 vx151 xb151 _xa151 _Fd151 _FnuYUweb151 pYjUhNc151";
|
package/dist/_chunk/form.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.jsx","names":[],"sources":["../../src/form/Field.tsx","../../src/form/HelpText.tsx","../../src/form/index.tsx"],"sourcesContent":["import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface FieldProps {\n /** The label for the field. */\n label?: string;\n /** A description or help text for the field. */\n description?: string;\n /** An error message for the field. */\n errorMessage?: string;\n /** Whether the field is required. */\n isRequired?: boolean;\n /** Whether the field is disabled. */\n isDisabled?: boolean;\n /** Whether the field is invalid. */\n isInvalid?: boolean;\n /** The size of the field. @default 'md' */\n size?: FieldSize;\n /** Additional CSS class name. */\n class?: string;\n /** The field content (input element). */\n children?: JSX.Element;\n /** ID for the label's htmlFor attribute. */\n htmlFor?: string;\n}\n\n// Vertical field stack. The label/help-text colors mirror S2's `fieldLabel()`\n// and `helpTextStyles` (`neutral-subdued`, flipping to `negative`/`disabled`);\n// sizes map sm/md/lg → the UI font's xs/sm/base steps. Routed through the\n// `style()` macro so the CSS ships in the package bundle for installed consumers.\nconst fieldStyles = style<{ size: FieldSize }>({\n display: \"flex\",\n flexDirection: \"column\",\n gap: { default: 8, size: { sm: 4, lg: 12 } },\n});\n\nconst fieldLabelStyles = style<{ size: FieldSize; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\", lg: \"ui\" } },\n color: { default: \"neutral-subdued\", isDisabled: \"disabled\" },\n});\n\nconst fieldTextStyles = style<{ size: FieldSize; isInvalid?: boolean; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\" } },\n color: { default: \"neutral-subdued\", isInvalid: \"negative\", isDisabled: \"disabled\" },\n});\n\nconst requiredStyles = style({ color: \"negative\", marginStart: 2 });\n\n/**\n * A field layout component that provides label, help text, and error message\n * around a form input.\n */\nexport function Field(props: FieldProps): JSX.Element {\n const [local] = splitProps(props, [\n \"label\",\n \"description\",\n \"errorMessage\",\n \"isRequired\",\n \"isDisabled\",\n \"isInvalid\",\n \"size\",\n \"class\",\n \"children\",\n \"htmlFor\",\n ]);\n\n const size = () => local.size ?? \"md\";\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={[fieldStyles({ size: size() }), local.class].filter(Boolean).join(\" \")}>\n <Show when={local.label}>\n <label\n for={local.htmlFor}\n class={fieldLabelStyles({ size: size(), isDisabled: local.isDisabled })}\n >\n {local.label}\n <Show when={local.isRequired}>\n <span class={requiredStyles}>*</span>\n </Show>\n </label>\n </Show>\n\n {local.children}\n\n <Show when={showError()}>\n <p class={fieldTextStyles({ size: size(), isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n\n <Show when={!showError() && local.description}>\n <p class={fieldTextStyles({ size: size(), isDisabled: local.isDisabled })}>\n {local.description}\n </p>\n </Show>\n </div>\n );\n}\n","import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport interface HelpTextProps {\n /** The description text. */\n description?: string;\n /** The error message text. */\n errorMessage?: string;\n /** Whether the field is in an error state. */\n isInvalid?: boolean;\n /** Whether the help text is disabled (dimmed). */\n isDisabled?: boolean;\n /** Additional CSS class name. */\n class?: string;\n}\n\n// Mirrors S2's `helpTextStyles` (Field.tsx): the small UI font with a\n// `neutral-subdued` description color that flips to `negative` for errors and\n// `disabled` when the field is disabled. Emitted via the `style()` macro so the\n// CSS ships in the package bundle for installed consumers.\nconst helpTextStyles = style<{ isInvalid?: boolean; isDisabled?: boolean }>({\n font: \"ui-sm\",\n color: {\n default: \"neutral-subdued\",\n isInvalid: \"negative\",\n isDisabled: \"disabled\",\n },\n});\n\n/**\n * Displays description or error text below a form field.\n */\nexport function HelpText(props: HelpTextProps): JSX.Element {\n const [local] = splitProps(props, [\n \"description\",\n \"errorMessage\",\n \"isInvalid\",\n \"isDisabled\",\n \"class\",\n ]);\n\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={local.class}>\n <Show when={showError()}>\n <p class={helpTextStyles({ isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n <Show when={!showError() && local.description}>\n <p class={helpTextStyles({ isDisabled: local.isDisabled })}>{local.description}</p>\n </Show>\n </div>\n );\n}\n","import { type JSX, createContext, splitProps, useContext } from \"solid-js\";\nimport {\n Form as HeadlessForm,\n FieldError as HeadlessFieldError,\n type FormProps as HeadlessFormProps,\n type FieldErrorProps as HeadlessFieldErrorProps,\n} from \"@proyecto-viviana/solidaria-components\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport { getAllowedOverrides } from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport { createIsSkeleton } from \"../skeleton\";\nimport { assignRef } from \"../button/spectrum-context\";\n\nexport type FormSize = \"S\" | \"M\" | \"L\" | \"XL\";\nexport type FormLabelPosition = \"top\" | \"side\";\nexport type FormLabelAlign = \"start\" | \"end\";\nexport type FormNecessityIndicator = \"icon\" | \"label\";\n\nexport interface FormStyleProps {\n /** The size of descendant Form elements. @default 'M' */\n size?: FormSize;\n /** The label's overall position relative to each field. @default 'top' */\n labelPosition?: FormLabelPosition;\n /** The label's horizontal alignment relative to each field. @default 'start' */\n labelAlign?: FormLabelAlign;\n /** Whether required fields show an icon or text label. @default 'icon' */\n necessityIndicator?: FormNecessityIndicator;\n /** Whether descendant Form elements are required. */\n isRequired?: boolean;\n /** Whether descendant Form elements are disabled. */\n isDisabled?: boolean;\n /** Whether descendant Form elements are rendered with emphasized styling. */\n isEmphasized?: boolean;\n}\n\nexport interface FormProps\n extends Omit<HeadlessFormProps, \"class\" | \"style\" | \"ref\">, FormStyleProps {\n /** Spectrum-defined generated classes. */\n styles?: StyleString;\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n ref?: HeadlessFormProps[\"ref\"];\n}\n\nexport interface FieldErrorProps extends Omit<HeadlessFieldErrorProps, \"class\"> {\n class?: string;\n}\n\nexport const FormContext = createContext<FormStyleProps | null>(null);\n\nconst formStylePropKeys = [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n] as const;\n\nexport function useIsInForm(): boolean {\n return useContext(FormContext) != null;\n}\n\nexport function useFormProps<T extends object>(props: T): T {\n const context = useContext(FormContext);\n const isSkeleton = createIsSkeleton();\n\n const getInheritedValue = (property: PropertyKey) => {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n if (typeof property !== \"string\") {\n return undefined;\n }\n\n return context?.[property as keyof FormStyleProps];\n };\n\n return new Proxy(props, {\n get(target, property, receiver) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n const localValue = Reflect.get(target, property, receiver);\n if (localValue !== undefined) {\n return localValue;\n }\n\n return getInheritedValue(property);\n },\n has(target, property) {\n return Reflect.has(target, property) || getInheritedValue(property) !== undefined;\n },\n ownKeys(target) {\n const keys = new Set<ReturnType<typeof Reflect.ownKeys>[number]>(Reflect.ownKeys(target));\n\n for (const key of formStylePropKeys) {\n if (getInheritedValue(key) !== undefined) {\n keys.add(key);\n }\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return {\n enumerable: true,\n configurable: true,\n get: () => true,\n };\n }\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (getInheritedValue(property) !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => getInheritedValue(property),\n };\n }\n\n return undefined;\n },\n }) as T;\n}\n\nconst formStyles = style<{ labelPosition: FormLabelPosition; size: FormSize }>(\n {\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"[field] 1fr\"],\n side: [\"[label] auto\", \"[field] 1fr\"],\n },\n },\n rowGap: {\n size: {\n S: 20,\n M: 24,\n L: 32,\n XL: 40,\n },\n },\n columnGap: \"text-to-control\",\n },\n getAllowedOverrides(),\n);\n\nexport function Form(props: FormProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"ref\",\n \"children\",\n ]);\n\n const size = () => local.size ?? \"M\";\n const labelPosition = () => local.labelPosition ?? \"top\";\n const labelAlign = () => local.labelAlign ?? \"start\";\n const necessityIndicator = () => local.necessityIndicator ?? \"icon\";\n\n const contextValue: FormStyleProps = {\n get size() {\n return size();\n },\n get labelPosition() {\n return labelPosition();\n },\n get labelAlign() {\n return labelAlign();\n },\n get necessityIndicator() {\n return necessityIndicator();\n },\n get isRequired() {\n return local.isRequired;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get isEmphasized() {\n return local.isEmphasized;\n },\n };\n\n return (\n <FormContext.Provider value={contextValue}>\n <HeadlessForm\n {...headlessProps}\n ref={(el) => assignRef(local.ref, el)}\n class={[\n local.UNSAFE_className,\n formStyles({ size: size(), labelPosition: labelPosition() }, local.styles),\n ]\n .filter(Boolean)\n .join(\" \")}\n style={local.UNSAFE_style}\n >\n {(renderProps) =>\n typeof local.children === \"function\" ? local.children(renderProps) : local.children\n }\n </HeadlessForm>\n </FormContext.Provider>\n );\n}\n\n// Small UI font in the `negative` color, mirroring S2's help-text error state.\nconst fieldErrorStyles = style({ font: \"ui-sm\", color: \"negative\" });\n\nexport function FieldError(props: FieldErrorProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\"class\"]);\n return (\n <HeadlessFieldError\n {...headlessProps}\n class={[fieldErrorStyles, local.class].filter(Boolean).join(\" \")}\n />\n );\n}\n\nexport { Field } from \"./Field\";\nexport type { FieldProps, FieldSize } from \"./Field\";\nexport { HelpText } from \"./HelpText\";\nexport type { HelpTextProps } from \"./HelpText\";\n"],"mappings":";;;;;AAkBA,MAAM,cAAY,SAAW,UAAU,OAAK;CAC1C,IAAM,QAAC;CACL,SAAE;CACJ,SAAQ;CACN,IAAE,MAAI,SAAa,MACrB,SAAe;MACR,IAAI,MAAI,SAAQ,MACvB,SAAU;;CAIT,IAAK,MAAA,SAAe,MACf,SAAQ;MACL,IAAE,MAAQ,SAAS,MACxB,SAAW;MAEf,SAAe;CAEf,OAAA;;AAEF,MAAM,mBAAmB,SAAQ,UAAM,OAAW;CAChD,IAAM,QAAE;CACR,IAAM,MAAG,SAAU,MACnB,SAAA;+BAEI,SAAA;MAEE,SAAG;;EAGL,SAAA;;CAEJ,OAAA,IAAA,MAAA,SAAA,MAAA;EACG,SAAY;EACd,SAAc;CACf,OAAA;EACK,SAAS;EACR,SAAS;CACb;CACA,IAAC,MAAA,SAAY,MAAA;EACZ,SAAY;EACZ,SAAW;CACZ,OAAC,IAAU,MAAC,SAAA,MAAA;EACX,SAAU;EACV,SAAK;CACN,OAAO;EACN,SAAS;EACT,SAAQ;CACT;;EAEI,SAAS;EACT,SAAS;;EAET,SAAC;EACD,SAA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A;EACA;EACA;EACA;EACA;EACF;;EAEA;EACD;CACD,CAAC;CACL,MAAA,aAAA,MAAA,QAAA;;CAEA,MAAM,mBAAqB,MAAA,cAAe;CACxC,MAAA,2BAAA,MAAA,sBAAA;CACE,MAAA,eAAe;EACf,IAAA,OAAA;GACE,OAAa,KAAE;EACb;EACA,IAAI,gBAAiB;GACtB,OAAA,cAAA;EACF;EACD,IAAQ,aAAA;GACA,OAAA,WAAA;EACJ;EACA,IAAG,qBAAE;GACF,OAAE,mBAAA;EACL;EACD,IAAA,aAAA;GACF,OAAA,MAAA;EACD;EACD,IAAA,aAAA;GACD,OAAA,MAAqB;EACtB;;GAEM,OAAS,MAAK;EACb;CACJ;CACA,OAAC,CAAA,YAAc,SAAA,OAAA,cAAA;MACd,CAAA,SAAW,eAAA,MAAA,OAAA,UAAA,MAAA,KAAA,EAAA,GAAA,OAAA,CACX,MAAA,kBACA,WAAW;EACX,MAAW,KAAA;EACX,eAAa,cAAA;CACb,GAAM,MAAC,MAAA,CACR,EAAC,OAAA,OAAA,EAAiB,KAAA,GAAA,GAAA,OAAA,MAAA,cAAA;UACjB,gBAAa,OAAA,MAAA,aAAA,aAAA,MAAA,SAAA,WAAA,IAAA,MAAA,SAAA;MACb,EAAG,KAAC;IACL,EAAC,YAAS;AACd;AAEA,MAAE,mBAAmB;AACrB,SAAQ,aAAmB,OAA+B;CACxD,MAAM,CAAA,OAAU,iBAAe,WAAa,OAAO,CAC7C,OAAA,CAAA;CAEN,OAAM,CAAA,eAA4B,eAAG,OAAA,CAC/B,kBACF,MAAO,KACT,EAAC,OAAA,OAAA,EAAA,KAAA,GAAA;AACL"}
|
|
1
|
+
{"version":3,"file":"form.jsx","names":[],"sources":["../../src/form/Field.tsx","../../src/form/HelpText.tsx","../../src/form/index.tsx"],"sourcesContent":["import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface FieldProps {\n /** The label for the field. */\n label?: string;\n /** A description or help text for the field. */\n description?: string;\n /** An error message for the field. */\n errorMessage?: string;\n /** Whether the field is required. */\n isRequired?: boolean;\n /** Whether the field is disabled. */\n isDisabled?: boolean;\n /** Whether the field is invalid. */\n isInvalid?: boolean;\n /** The size of the field. @default 'md' */\n size?: FieldSize;\n /** Additional CSS class name. */\n class?: string;\n /** The field content (input element). */\n children?: JSX.Element;\n /** ID for the label's htmlFor attribute. */\n htmlFor?: string;\n}\n\n// Vertical field stack. The label/help-text colors mirror S2's `fieldLabel()`\n// and `helpTextStyles` (`neutral-subdued`, flipping to `negative`/`disabled`);\n// sizes map sm/md/lg → the UI font's xs/sm/base steps. Routed through the\n// `style()` macro so the CSS ships in the package bundle for installed consumers.\nconst fieldStyles = style<{ size: FieldSize }>({\n display: \"flex\",\n flexDirection: \"column\",\n gap: { default: 8, size: { sm: 4, lg: 12 } },\n});\n\nconst fieldLabelStyles = style<{ size: FieldSize; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\", lg: \"ui\" } },\n color: { default: \"neutral-subdued\", isDisabled: \"disabled\" },\n});\n\nconst fieldTextStyles = style<{ size: FieldSize; isInvalid?: boolean; isDisabled?: boolean }>({\n font: { default: \"ui-sm\", size: { sm: \"ui-xs\" } },\n color: { default: \"neutral-subdued\", isInvalid: \"negative\", isDisabled: \"disabled\" },\n});\n\nconst requiredStyles = style({ color: \"negative\", marginStart: 2 });\n\n/**\n * A field layout component that provides label, help text, and error message\n * around a form input.\n */\nexport function Field(props: FieldProps): JSX.Element {\n const [local] = splitProps(props, [\n \"label\",\n \"description\",\n \"errorMessage\",\n \"isRequired\",\n \"isDisabled\",\n \"isInvalid\",\n \"size\",\n \"class\",\n \"children\",\n \"htmlFor\",\n ]);\n\n const size = () => local.size ?? \"md\";\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={[fieldStyles({ size: size() }), local.class].filter(Boolean).join(\" \")}>\n <Show when={local.label}>\n <label\n for={local.htmlFor}\n class={fieldLabelStyles({ size: size(), isDisabled: local.isDisabled })}\n >\n {local.label}\n <Show when={local.isRequired}>\n <span class={requiredStyles}>*</span>\n </Show>\n </label>\n </Show>\n\n {local.children}\n\n <Show when={showError()}>\n <p class={fieldTextStyles({ size: size(), isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n\n <Show when={!showError() && local.description}>\n <p class={fieldTextStyles({ size: size(), isDisabled: local.isDisabled })}>\n {local.description}\n </p>\n </Show>\n </div>\n );\n}\n","import { type JSX, splitProps, Show } from \"solid-js\";\nimport { style } from \"../style\" with { type: \"macro\" };\n\nexport interface HelpTextProps {\n /** The description text. */\n description?: string;\n /** The error message text. */\n errorMessage?: string;\n /** Whether the field is in an error state. */\n isInvalid?: boolean;\n /** Whether the help text is disabled (dimmed). */\n isDisabled?: boolean;\n /** Additional CSS class name. */\n class?: string;\n}\n\n// Mirrors S2's `helpTextStyles` (Field.tsx): the small UI font with a\n// `neutral-subdued` description color that flips to `negative` for errors and\n// `disabled` when the field is disabled. Emitted via the `style()` macro so the\n// CSS ships in the package bundle for installed consumers.\nconst helpTextStyles = style<{ isInvalid?: boolean; isDisabled?: boolean }>({\n font: \"ui-sm\",\n color: {\n default: \"neutral-subdued\",\n isInvalid: \"negative\",\n isDisabled: \"disabled\",\n },\n});\n\n/**\n * Displays description or error text below a form field.\n */\nexport function HelpText(props: HelpTextProps): JSX.Element {\n const [local] = splitProps(props, [\n \"description\",\n \"errorMessage\",\n \"isInvalid\",\n \"isDisabled\",\n \"class\",\n ]);\n\n const showError = () => local.isInvalid && local.errorMessage;\n\n return (\n <div class={local.class}>\n <Show when={showError()}>\n <p class={helpTextStyles({ isInvalid: true })} role=\"alert\">\n {local.errorMessage}\n </p>\n </Show>\n <Show when={!showError() && local.description}>\n <p class={helpTextStyles({ isDisabled: local.isDisabled })}>{local.description}</p>\n </Show>\n </div>\n );\n}\n","import { type JSX, createContext, splitProps, useContext } from \"solid-js\";\nimport {\n Form as HeadlessForm,\n FieldError as HeadlessFieldError,\n type FormProps as HeadlessFormProps,\n type FieldErrorProps as HeadlessFieldErrorProps,\n} from \"@proyecto-viviana/solidaria-components\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport { getAllowedOverrides } from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport { createIsSkeleton } from \"../skeleton\";\nimport { assignRef } from \"../button/spectrum-context\";\n\nexport type FormSize = \"S\" | \"M\" | \"L\" | \"XL\";\nexport type FormLabelPosition = \"top\" | \"side\";\nexport type FormLabelAlign = \"start\" | \"end\";\nexport type FormNecessityIndicator = \"icon\" | \"label\";\n\nexport interface FormStyleProps {\n /** The size of descendant Form elements. @default 'M' */\n size?: FormSize;\n /** The label's overall position relative to each field. @default 'top' */\n labelPosition?: FormLabelPosition;\n /** The label's horizontal alignment relative to each field. @default 'start' */\n labelAlign?: FormLabelAlign;\n /** Whether required fields show an icon or text label. @default 'icon' */\n necessityIndicator?: FormNecessityIndicator;\n /** Whether descendant Form elements are required. */\n isRequired?: boolean;\n /** Whether descendant Form elements are disabled. */\n isDisabled?: boolean;\n /** Whether descendant Form elements are rendered with emphasized styling. */\n isEmphasized?: boolean;\n}\n\nexport interface FormProps\n extends Omit<HeadlessFormProps, \"class\" | \"style\" | \"ref\">, FormStyleProps {\n /** Spectrum-defined generated classes. */\n styles?: StyleString;\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n ref?: HeadlessFormProps[\"ref\"];\n}\n\nexport interface FieldErrorProps extends Omit<HeadlessFieldErrorProps, \"class\"> {\n class?: string;\n}\n\nexport const FormContext = createContext<FormStyleProps | null>(null);\n\nconst formStylePropKeys = [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n] as const;\n\nexport function useIsInForm(): boolean {\n return useContext(FormContext) != null;\n}\n\nexport function useFormProps<T extends object>(props: T): T {\n const context = useContext(FormContext);\n const isSkeleton = createIsSkeleton();\n\n const getInheritedValue = (property: PropertyKey) => {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n if (typeof property !== \"string\") {\n return undefined;\n }\n\n return context?.[property as keyof FormStyleProps];\n };\n\n return new Proxy(props, {\n get(target, property, receiver) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return true;\n }\n\n const localValue = Reflect.get(target, property, receiver);\n if (localValue !== undefined) {\n return localValue;\n }\n\n return getInheritedValue(property);\n },\n has(target, property) {\n return Reflect.has(target, property) || getInheritedValue(property) !== undefined;\n },\n ownKeys(target) {\n const keys = new Set<ReturnType<typeof Reflect.ownKeys>[number]>(Reflect.ownKeys(target));\n\n for (const key of formStylePropKeys) {\n if (getInheritedValue(key) !== undefined) {\n keys.add(key);\n }\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n if (property === \"isDisabled\" && isSkeleton()) {\n return {\n enumerable: true,\n configurable: true,\n get: () => true,\n };\n }\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (getInheritedValue(property) !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => getInheritedValue(property),\n };\n }\n\n return undefined;\n },\n }) as T;\n}\n\nconst formStyles = style<{ labelPosition: FormLabelPosition; size: FormSize }>(\n {\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"[field] 1fr\"],\n side: [\"[label] auto\", \"[field] 1fr\"],\n },\n },\n rowGap: {\n size: {\n S: 20,\n M: 24,\n L: 32,\n XL: 40,\n },\n },\n columnGap: \"text-to-control\",\n },\n getAllowedOverrides(),\n);\n\nexport function Form(props: FormProps): JSX.Element {\n // Leave `children` on the headless rest props so they flow through as a\n // lazy Solid getter — do not split them off and re-wrap. A forced\n // `(rp) => children` render-prop wrapper desyncs createUniqueId between SSR\n // and client (Form+Button hydration mismatch). See solid-spectrum Form.\n const [local, headlessProps] = splitProps(props, [\n \"size\",\n \"labelPosition\",\n \"labelAlign\",\n \"necessityIndicator\",\n \"isRequired\",\n \"isDisabled\",\n \"isEmphasized\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"ref\",\n ]);\n\n const size = () => local.size ?? \"M\";\n const labelPosition = () => local.labelPosition ?? \"top\";\n const labelAlign = () => local.labelAlign ?? \"start\";\n const necessityIndicator = () => local.necessityIndicator ?? \"icon\";\n\n const contextValue: FormStyleProps = {\n get size() {\n return size();\n },\n get labelPosition() {\n return labelPosition();\n },\n get labelAlign() {\n return labelAlign();\n },\n get necessityIndicator() {\n return necessityIndicator();\n },\n get isRequired() {\n return local.isRequired;\n },\n get isDisabled() {\n return local.isDisabled;\n },\n get isEmphasized() {\n return local.isEmphasized;\n },\n };\n\n return (\n <FormContext.Provider value={contextValue}>\n <HeadlessForm\n {...headlessProps}\n ref={(el) => assignRef(local.ref, el)}\n class={[\n local.UNSAFE_className,\n formStyles({ size: size(), labelPosition: labelPosition() }, local.styles),\n ]\n .filter(Boolean)\n .join(\" \")}\n style={local.UNSAFE_style}\n />\n </FormContext.Provider>\n );\n}\n\n// Small UI font in the `negative` color, mirroring S2's help-text error state.\nconst fieldErrorStyles = style({ font: \"ui-sm\", color: \"negative\" });\n\nexport function FieldError(props: FieldErrorProps): JSX.Element {\n const [local, headlessProps] = splitProps(props, [\"class\"]);\n return (\n <HeadlessFieldError\n {...headlessProps}\n class={[fieldErrorStyles, local.class].filter(Boolean).join(\" \")}\n />\n );\n}\n\nexport { Field } from \"./Field\";\nexport type { FieldProps, FieldSize } from \"./Field\";\nexport { HelpText } from \"./HelpText\";\nexport type { HelpTextProps } from \"./HelpText\";\n"],"mappings":";;;;;AAkBA,MAAM,cAAY,SAAW,UAAU,OAAK;CAC1C,IAAM,QAAC;C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,eAAW,cAAA;CACX,GAAA,MAAY,MAAC,CACd,EAAC,OAAO,OAAA,EAAA,KAAA,GAAA,GAAA,OAAA,MAAA,gBAAA;IACR,EAAC,YAAA;AACL;AAEA,MAAI,mBAAA;;CAEF,MAAM,CAAA,OAAU,iBAAiB,WAAG,OAAA,CAC9B,OACN,CAAA;CACA,OAAM,CAAA,eAA2B,eAAM,OAAA,CAAA,kBAEjC,MAAA,KACJ,EAAA,OAAS,OAAE,EAAA,KAAA,GAAA;AACf"}
|
package/dist/_chunk/layout.js
CHANGED
|
@@ -42,10 +42,14 @@ function Flex(props) {
|
|
|
42
42
|
"justifyContent",
|
|
43
43
|
"inline",
|
|
44
44
|
"class",
|
|
45
|
+
"style",
|
|
45
46
|
"children"
|
|
46
47
|
]);
|
|
47
48
|
const flexStyle = () => {
|
|
48
|
-
const s = {
|
|
49
|
+
const s = {
|
|
50
|
+
display: local.inline ? "inline-flex" : "flex",
|
|
51
|
+
...local.style
|
|
52
|
+
};
|
|
49
53
|
if (local.direction) s["flex-direction"] = local.direction;
|
|
50
54
|
if (local.gap !== void 0) s.gap = resolveGap(local.gap);
|
|
51
55
|
if (local.wrap) s["flex-wrap"] = local.wrap === true || local.wrap === "wrap" ? "wrap" : local.wrap === "wrap-reverse" ? "wrap-reverse" : "nowrap";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","names":["JSX","splitProps","FlexProps","direction","gap","wrap","alignItems","justifyContent","inline","class","children","Element","alignMap","Record","start","center","end","stretch","baseline","justifyMap","between","around","evenly","gapTokens","xs","sm","md","lg","xl","resolveGap","value","test","parseFloat","Flex","props","local","rest","flexStyle","CSSProperties","s","display","undefined","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","style","_$insert","_$runHydrationEvents","JSX","splitProps","resolveGap","GridProps","columns","rows","gap","columnGap","rowGap","areas","alignItems","justifyItems","inline","class","style","CSSProperties","children","Element","Grid","props","local","rest","gridStyle","s","display","undefined","map","a","join","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","_$insert","_$runHydrationEvents"],"sources":["../../src/layout/Flex.tsx","../../src/layout/Grid.tsx","../../src/layout/css-utils.ts"],"sourcesContent":["import { type JSX, splitProps } from \"solid-js\";\n\nexport interface FlexProps {\n /** The flex direction. @default 'row' */\n direction?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. @default '0' */\n gap?: string | number;\n /** Whether items should wrap. @default false */\n wrap?: boolean | \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** The justification of items. */\n justifyContent?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Whether the flex container is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\nconst alignMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n baseline: \"baseline\",\n};\n\nconst justifyMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n\n// t-shirt gap tokens map to the Spectrum spacing scale; a bare number follows\n// Tailwind's spacing scale (1 unit = 0.25rem); anything else is a raw CSS length.\nconst gapTokens: Record<string, string> = {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n};\n\nexport function resolveGap(value: string | number): string {\n if (typeof value === \"number\") return `${value * 0.25}rem`;\n if (value in gapTokens) return gapTokens[value];\n if (/^\\d+(?:\\.\\d+)?$/.test(value)) return `${parseFloat(value) * 0.25}rem`;\n return value;\n}\n\n/**\n * A flex container layout component.\n */\nexport function Flex(props: FlexProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"direction\",\n \"gap\",\n \"wrap\",\n \"alignItems\",\n \"justifyContent\",\n \"inline\",\n \"class\",\n \"children\",\n ]);\n\n const flexStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-flex\" : \"flex\",\n };\n\n if (local.direction) s[\"flex-direction\"] = local.direction;\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.wrap) {\n s[\"flex-wrap\"] =\n local.wrap === true || local.wrap === \"wrap\"\n ? \"wrap\"\n : local.wrap === \"wrap-reverse\"\n ? \"wrap-reverse\"\n : \"nowrap\";\n }\n if (local.alignItems) s[\"align-items\"] = alignMap[local.alignItems];\n if (local.justifyContent) s[\"justify-content\"] = justifyMap[local.justifyContent];\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={flexStyle()}>\n {local.children}\n </div>\n );\n}\n","import { type JSX, splitProps } from \"solid-js\";\nimport { resolveGap } from \"./Flex\";\n\nexport interface GridProps {\n /** The number of columns, or a grid-template-columns value. */\n columns?: number | string;\n /** The number of rows, or a grid-template-rows value. */\n rows?: number | string;\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. */\n gap?: string | number;\n /** The column gap. */\n columnGap?: string | number;\n /** The row gap. */\n rowGap?: string | number;\n /** Named grid areas (grid-template-areas). */\n areas?: string[];\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** The justification of items. */\n justifyItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Whether the grid is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\n/**\n * A CSS Grid layout component.\n */\nexport function Grid(props: GridProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"columns\",\n \"rows\",\n \"gap\",\n \"columnGap\",\n \"rowGap\",\n \"areas\",\n \"alignItems\",\n \"justifyItems\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n const gridStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-grid\" : \"grid\",\n ...local.style,\n };\n\n if (local.columns !== undefined) {\n s[\"grid-template-columns\"] =\n typeof local.columns === \"number\" ? `repeat(${local.columns}, 1fr)` : local.columns;\n }\n if (local.rows !== undefined) {\n s[\"grid-template-rows\"] =\n typeof local.rows === \"number\" ? `repeat(${local.rows}, 1fr)` : local.rows;\n }\n if (local.areas) {\n s[\"grid-template-areas\"] = local.areas.map((a) => `\"${a}\"`).join(\" \");\n }\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.columnGap !== undefined) s[\"column-gap\"] = resolveGap(local.columnGap);\n if (local.rowGap !== undefined) s[\"row-gap\"] = resolveGap(local.rowGap);\n if (local.alignItems) s[\"align-items\"] = local.alignItems;\n if (local.justifyItems) s[\"justify-items\"] = local.justifyItems;\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={gridStyle()}>\n {local.children}\n </div>\n );\n}\n","/**\n * Creates a CSS `fit-content()` value.\n * @param value - The max content size (e.g., '200px', '50%')\n */\nexport function fitContent(value: string): string {\n return `fit-content(${value})`;\n}\n\n/**\n * Creates a CSS `minmax()` value.\n * @param min - The minimum size\n * @param max - The maximum size\n */\nexport function minmax(min: string, max: string): string {\n return `minmax(${min}, ${max})`;\n}\n\n/**\n * Creates a CSS `repeat()` value.\n * @param count - The repetition count or 'auto-fill' / 'auto-fit'\n * @param track - The track definition\n */\nexport function repeat(count: number | \"auto-fill\" | \"auto-fit\", track: string): string {\n return `repeat(${count}, ${track})`;\n}\n"],"mappings":";;;;AAyBA,MAAMY,WAAmC;CACvCE,OAAO;CACPC,QAAQ;CACRC,KAAK;CACLC,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EC,QAAK;IAAA,OAAEQ,UAAU;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAAY,OAAAL,YAClDT,MAAMJ,QAAQ;EAAAmB,mBAAA;EAAA,OAAAN;CAAA,GAAA;AAGrB;;;;;;;AChFA,SAAgB,WAAW,OAAuB;CAChD,OAAO,eAAe,MAAM;AAC9B;;;;;;AAOA,SAAgB,OAAO,KAAa,KAAqB;CACvD,OAAO,UAAU,IAAI,IAAI,IAAI;AAC/B;;;;;;AAOA,SAAgB,OAAO,OAA0C,OAAuB;CACtF,OAAO,UAAU,MAAM,IAAI,MAAM;AACnC"}
|
|
1
|
+
{"version":3,"file":"layout.js","names":["JSX","splitProps","FlexProps","direction","gap","wrap","alignItems","justifyContent","inline","class","style","CSSProperties","children","Element","alignMap","Record","start","center","end","stretch","baseline","justifyMap","between","around","evenly","gapTokens","xs","sm","md","lg","xl","resolveGap","value","test","parseFloat","Flex","props","local","rest","flexStyle","s","display","undefined","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","_$insert","_$runHydrationEvents","JSX","splitProps","resolveGap","GridProps","columns","rows","gap","columnGap","rowGap","areas","alignItems","justifyItems","inline","class","style","CSSProperties","children","Element","Grid","props","local","rest","gridStyle","s","display","undefined","map","a","join","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","_$insert","_$runHydrationEvents"],"sources":["../../src/layout/Flex.tsx","../../src/layout/Grid.tsx","../../src/layout/css-utils.ts"],"sourcesContent":["import { type JSX, splitProps } from \"solid-js\";\n\nexport interface FlexProps {\n /** The flex direction. @default 'row' */\n direction?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. @default '0' */\n gap?: string | number;\n /** Whether items should wrap. @default false */\n wrap?: boolean | \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** The justification of items. */\n justifyContent?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Whether the flex container is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\nconst alignMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n baseline: \"baseline\",\n};\n\nconst justifyMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n\n// t-shirt gap tokens map to the Spectrum spacing scale; a bare number follows\n// Tailwind's spacing scale (1 unit = 0.25rem); anything else is a raw CSS length.\nconst gapTokens: Record<string, string> = {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n};\n\nexport function resolveGap(value: string | number): string {\n if (typeof value === \"number\") return `${value * 0.25}rem`;\n if (value in gapTokens) return gapTokens[value];\n if (/^\\d+(?:\\.\\d+)?$/.test(value)) return `${parseFloat(value) * 0.25}rem`;\n return value;\n}\n\n/**\n * A flex container layout component.\n */\nexport function Flex(props: FlexProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"direction\",\n \"gap\",\n \"wrap\",\n \"alignItems\",\n \"justifyContent\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n // `style` is merged rather than left in `rest`, where the assignment below would have\n // silently dropped it. Grid already accepted one; the two primitives are meant to be\n // interchangeable, and without it every decorated row has to fall back to a bare div.\n const flexStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-flex\" : \"flex\",\n ...local.style,\n };\n\n if (local.direction) s[\"flex-direction\"] = local.direction;\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.wrap) {\n s[\"flex-wrap\"] =\n local.wrap === true || local.wrap === \"wrap\"\n ? \"wrap\"\n : local.wrap === \"wrap-reverse\"\n ? \"wrap-reverse\"\n : \"nowrap\";\n }\n if (local.alignItems) s[\"align-items\"] = alignMap[local.alignItems];\n if (local.justifyContent) s[\"justify-content\"] = justifyMap[local.justifyContent];\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={flexStyle()}>\n {local.children}\n </div>\n );\n}\n","import { type JSX, splitProps } from \"solid-js\";\nimport { resolveGap } from \"./Flex\";\n\nexport interface GridProps {\n /** The number of columns, or a grid-template-columns value. */\n columns?: number | string;\n /** The number of rows, or a grid-template-rows value. */\n rows?: number | string;\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. */\n gap?: string | number;\n /** The column gap. */\n columnGap?: string | number;\n /** The row gap. */\n rowGap?: string | number;\n /** Named grid areas (grid-template-areas). */\n areas?: string[];\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** The justification of items. */\n justifyItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Whether the grid is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\n/**\n * A CSS Grid layout component.\n */\nexport function Grid(props: GridProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"columns\",\n \"rows\",\n \"gap\",\n \"columnGap\",\n \"rowGap\",\n \"areas\",\n \"alignItems\",\n \"justifyItems\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n const gridStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-grid\" : \"grid\",\n ...local.style,\n };\n\n if (local.columns !== undefined) {\n s[\"grid-template-columns\"] =\n typeof local.columns === \"number\" ? `repeat(${local.columns}, 1fr)` : local.columns;\n }\n if (local.rows !== undefined) {\n s[\"grid-template-rows\"] =\n typeof local.rows === \"number\" ? `repeat(${local.rows}, 1fr)` : local.rows;\n }\n if (local.areas) {\n s[\"grid-template-areas\"] = local.areas.map((a) => `\"${a}\"`).join(\" \");\n }\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.columnGap !== undefined) s[\"column-gap\"] = resolveGap(local.columnGap);\n if (local.rowGap !== undefined) s[\"row-gap\"] = resolveGap(local.rowGap);\n if (local.alignItems) s[\"align-items\"] = local.alignItems;\n if (local.justifyItems) s[\"justify-items\"] = local.justifyItems;\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={gridStyle()}>\n {local.children}\n </div>\n );\n}\n","/**\n * Creates a CSS `fit-content()` value.\n * @param value - The max content size (e.g., '200px', '50%')\n */\nexport function fitContent(value: string): string {\n return `fit-content(${value})`;\n}\n\n/**\n * Creates a CSS `minmax()` value.\n * @param min - The minimum size\n * @param max - The maximum size\n */\nexport function minmax(min: string, max: string): string {\n return `minmax(${min}, ${max})`;\n}\n\n/**\n * Creates a CSS `repeat()` value.\n * @param count - The repetition count or 'auto-fill' / 'auto-fit'\n * @param track - The track definition\n */\nexport function repeat(count: number | \"auto-fill\" | \"auto-fit\", track: string): string {\n return `repeat(${count}, ${track})`;\n}\n"],"mappings":";;;;AA2BA,MAAMc,WAAmC;CACvCE,OAAO;CACPC,QAAQ;CACRC,KAAK;CACLC,SAAS;CACTC,UAAU;AACZ;AAEA,MAAMC,aAAqC;CACzCL,OAAO;CACPC,QAAQ;CACRC,KAAK;CACLI,SAAS;CACTC,QAAQ;CACRC,QAAQ;AACV;AAIA,MAAMC,YAAoC;CACxCC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;AACN;AAEA,SAAgBC,WAAWC,OAAgC;CACzD,IAAI,OAAOA,UAAU,UAAU,OAAO,GAAGA,QAAQ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AAU,IAAI,IAAI,IAAI;AAC/B;;;;;;AAOA,SAAgB,OAAO,OAA0C,OAAuB;CACtF,OAAO,UAAU,MAAM,IAAI,MAAM;AACnC"}
|
package/dist/_chunk/layout.jsx
CHANGED
|
@@ -40,10 +40,14 @@ function Flex(props) {
|
|
|
40
40
|
"justifyContent",
|
|
41
41
|
"inline",
|
|
42
42
|
"class",
|
|
43
|
+
"style",
|
|
43
44
|
"children"
|
|
44
45
|
]);
|
|
45
46
|
const flexStyle = () => {
|
|
46
|
-
const s = {
|
|
47
|
+
const s = {
|
|
48
|
+
display: local.inline ? "inline-flex" : "flex",
|
|
49
|
+
...local.style
|
|
50
|
+
};
|
|
47
51
|
if (local.direction) s["flex-direction"] = local.direction;
|
|
48
52
|
if (local.gap !== void 0) s.gap = resolveGap(local.gap);
|
|
49
53
|
if (local.wrap) s["flex-wrap"] = local.wrap === true || local.wrap === "wrap" ? "wrap" : local.wrap === "wrap-reverse" ? "wrap-reverse" : "nowrap";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.jsx","names":[],"sources":["../../src/layout/Flex.tsx","../../src/layout/Grid.tsx","../../src/layout/css-utils.ts"],"sourcesContent":["import { type JSX, splitProps } from \"solid-js\";\n\nexport interface FlexProps {\n /** The flex direction. @default 'row' */\n direction?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. @default '0' */\n gap?: string | number;\n /** Whether items should wrap. @default false */\n wrap?: boolean | \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** The justification of items. */\n justifyContent?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Whether the flex container is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\nconst alignMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n baseline: \"baseline\",\n};\n\nconst justifyMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n\n// t-shirt gap tokens map to the Spectrum spacing scale; a bare number follows\n// Tailwind's spacing scale (1 unit = 0.25rem); anything else is a raw CSS length.\nconst gapTokens: Record<string, string> = {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n};\n\nexport function resolveGap(value: string | number): string {\n if (typeof value === \"number\") return `${value * 0.25}rem`;\n if (value in gapTokens) return gapTokens[value];\n if (/^\\d+(?:\\.\\d+)?$/.test(value)) return `${parseFloat(value) * 0.25}rem`;\n return value;\n}\n\n/**\n * A flex container layout component.\n */\nexport function Flex(props: FlexProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"direction\",\n \"gap\",\n \"wrap\",\n \"alignItems\",\n \"justifyContent\",\n \"inline\",\n \"class\",\n \"children\",\n ]);\n\n const flexStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-flex\" : \"flex\",\n };\n\n if (local.direction) s[\"flex-direction\"] = local.direction;\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.wrap) {\n s[\"flex-wrap\"] =\n local.wrap === true || local.wrap === \"wrap\"\n ? \"wrap\"\n : local.wrap === \"wrap-reverse\"\n ? \"wrap-reverse\"\n : \"nowrap\";\n }\n if (local.alignItems) s[\"align-items\"] = alignMap[local.alignItems];\n if (local.justifyContent) s[\"justify-content\"] = justifyMap[local.justifyContent];\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={flexStyle()}>\n {local.children}\n </div>\n );\n}\n","import { type JSX, splitProps } from \"solid-js\";\nimport { resolveGap } from \"./Flex\";\n\nexport interface GridProps {\n /** The number of columns, or a grid-template-columns value. */\n columns?: number | string;\n /** The number of rows, or a grid-template-rows value. */\n rows?: number | string;\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. */\n gap?: string | number;\n /** The column gap. */\n columnGap?: string | number;\n /** The row gap. */\n rowGap?: string | number;\n /** Named grid areas (grid-template-areas). */\n areas?: string[];\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** The justification of items. */\n justifyItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Whether the grid is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\n/**\n * A CSS Grid layout component.\n */\nexport function Grid(props: GridProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"columns\",\n \"rows\",\n \"gap\",\n \"columnGap\",\n \"rowGap\",\n \"areas\",\n \"alignItems\",\n \"justifyItems\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n const gridStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-grid\" : \"grid\",\n ...local.style,\n };\n\n if (local.columns !== undefined) {\n s[\"grid-template-columns\"] =\n typeof local.columns === \"number\" ? `repeat(${local.columns}, 1fr)` : local.columns;\n }\n if (local.rows !== undefined) {\n s[\"grid-template-rows\"] =\n typeof local.rows === \"number\" ? `repeat(${local.rows}, 1fr)` : local.rows;\n }\n if (local.areas) {\n s[\"grid-template-areas\"] = local.areas.map((a) => `\"${a}\"`).join(\" \");\n }\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.columnGap !== undefined) s[\"column-gap\"] = resolveGap(local.columnGap);\n if (local.rowGap !== undefined) s[\"row-gap\"] = resolveGap(local.rowGap);\n if (local.alignItems) s[\"align-items\"] = local.alignItems;\n if (local.justifyItems) s[\"justify-items\"] = local.justifyItems;\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={gridStyle()}>\n {local.children}\n </div>\n );\n}\n","/**\n * Creates a CSS `fit-content()` value.\n * @param value - The max content size (e.g., '200px', '50%')\n */\nexport function fitContent(value: string): string {\n return `fit-content(${value})`;\n}\n\n/**\n * Creates a CSS `minmax()` value.\n * @param min - The minimum size\n * @param max - The maximum size\n */\nexport function minmax(min: string, max: string): string {\n return `minmax(${min}, ${max})`;\n}\n\n/**\n * Creates a CSS `repeat()` value.\n * @param count - The repetition count or 'auto-fill' / 'auto-fit'\n * @param track - The track definition\n */\nexport function repeat(count: number | \"auto-fill\" | \"auto-fit\", track: string): string {\n return `repeat(${count}, ${track})`;\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"layout.jsx","names":[],"sources":["../../src/layout/Flex.tsx","../../src/layout/Grid.tsx","../../src/layout/css-utils.ts"],"sourcesContent":["import { type JSX, splitProps } from \"solid-js\";\n\nexport interface FlexProps {\n /** The flex direction. @default 'row' */\n direction?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. @default '0' */\n gap?: string | number;\n /** Whether items should wrap. @default false */\n wrap?: boolean | \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** The justification of items. */\n justifyContent?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Whether the flex container is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\nconst alignMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n baseline: \"baseline\",\n};\n\nconst justifyMap: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n\n// t-shirt gap tokens map to the Spectrum spacing scale; a bare number follows\n// Tailwind's spacing scale (1 unit = 0.25rem); anything else is a raw CSS length.\nconst gapTokens: Record<string, string> = {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n};\n\nexport function resolveGap(value: string | number): string {\n if (typeof value === \"number\") return `${value * 0.25}rem`;\n if (value in gapTokens) return gapTokens[value];\n if (/^\\d+(?:\\.\\d+)?$/.test(value)) return `${parseFloat(value) * 0.25}rem`;\n return value;\n}\n\n/**\n * A flex container layout component.\n */\nexport function Flex(props: FlexProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"direction\",\n \"gap\",\n \"wrap\",\n \"alignItems\",\n \"justifyContent\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n // `style` is merged rather than left in `rest`, where the assignment below would have\n // silently dropped it. Grid already accepted one; the two primitives are meant to be\n // interchangeable, and without it every decorated row has to fall back to a bare div.\n const flexStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-flex\" : \"flex\",\n ...local.style,\n };\n\n if (local.direction) s[\"flex-direction\"] = local.direction;\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.wrap) {\n s[\"flex-wrap\"] =\n local.wrap === true || local.wrap === \"wrap\"\n ? \"wrap\"\n : local.wrap === \"wrap-reverse\"\n ? \"wrap-reverse\"\n : \"nowrap\";\n }\n if (local.alignItems) s[\"align-items\"] = alignMap[local.alignItems];\n if (local.justifyContent) s[\"justify-content\"] = justifyMap[local.justifyContent];\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={flexStyle()}>\n {local.children}\n </div>\n );\n}\n","import { type JSX, splitProps } from \"solid-js\";\nimport { resolveGap } from \"./Flex\";\n\nexport interface GridProps {\n /** The number of columns, or a grid-template-columns value. */\n columns?: number | string;\n /** The number of rows, or a grid-template-rows value. */\n rows?: number | string;\n /** The gap between items. Accepts a t-shirt size, a number (spacing scale), or a raw CSS length. */\n gap?: string | number;\n /** The column gap. */\n columnGap?: string | number;\n /** The row gap. */\n rowGap?: string | number;\n /** Named grid areas (grid-template-areas). */\n areas?: string[];\n /** The alignment of items. */\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** The justification of items. */\n justifyItems?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Whether the grid is inline. */\n inline?: boolean;\n /** Additional CSS class name. */\n class?: string;\n /** Additional inline styles. */\n style?: JSX.CSSProperties;\n /** The content. */\n children?: JSX.Element;\n}\n\n// Layout primitives emit inline CSS so the styling ships with the package for\n// installed consumers, rather than relying on Tailwind utility strings the\n// package ships no CSS for.\n\n/**\n * A CSS Grid layout component.\n */\nexport function Grid(props: GridProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"columns\",\n \"rows\",\n \"gap\",\n \"columnGap\",\n \"rowGap\",\n \"areas\",\n \"alignItems\",\n \"justifyItems\",\n \"inline\",\n \"class\",\n \"style\",\n \"children\",\n ]);\n\n const gridStyle = (): JSX.CSSProperties => {\n const s: JSX.CSSProperties = {\n display: local.inline ? \"inline-grid\" : \"grid\",\n ...local.style,\n };\n\n if (local.columns !== undefined) {\n s[\"grid-template-columns\"] =\n typeof local.columns === \"number\" ? `repeat(${local.columns}, 1fr)` : local.columns;\n }\n if (local.rows !== undefined) {\n s[\"grid-template-rows\"] =\n typeof local.rows === \"number\" ? `repeat(${local.rows}, 1fr)` : local.rows;\n }\n if (local.areas) {\n s[\"grid-template-areas\"] = local.areas.map((a) => `\"${a}\"`).join(\" \");\n }\n if (local.gap !== undefined) s.gap = resolveGap(local.gap);\n if (local.columnGap !== undefined) s[\"column-gap\"] = resolveGap(local.columnGap);\n if (local.rowGap !== undefined) s[\"row-gap\"] = resolveGap(local.rowGap);\n if (local.alignItems) s[\"align-items\"] = local.alignItems;\n if (local.justifyItems) s[\"justify-items\"] = local.justifyItems;\n\n return s;\n };\n\n return (\n <div {...rest} class={local.class} style={gridStyle()}>\n {local.children}\n </div>\n );\n}\n","/**\n * Creates a CSS `fit-content()` value.\n * @param value - The max content size (e.g., '200px', '50%')\n */\nexport function fitContent(value: string): string {\n return `fit-content(${value})`;\n}\n\n/**\n * Creates a CSS `minmax()` value.\n * @param min - The minimum size\n * @param max - The maximum size\n */\nexport function minmax(min: string, max: string): string {\n return `minmax(${min}, ${max})`;\n}\n\n/**\n * Creates a CSS `repeat()` value.\n * @param count - The repetition count or 'auto-fill' / 'auto-fit'\n * @param track - The track definition\n */\nexport function repeat(count: number | \"auto-fill\" | \"auto-fit\", track: string): string {\n return `repeat(${count}, ${track})`;\n}\n"],"mappings":";;AA2BA,MAAM,WAAmC;CACvC,OAAO;CACP,QAAQ;CACR,KAAK;CACL,SAAS;CACT,UAAU;AACZ;AAEA,MAAM,aAAqC;CACzC,OAAO;CACP,QAAQ;CACR,KAAK;CACL,SAAS;CACT,QAAQ;CACR,QAAQ;AACV;AAIA,MAAM,YAAoC;CACxC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAgB,WAAW,OAAgC;CACzD,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,QAAQ,IAAK;CACtD,IAAI,SAAS,WAAW,OAAO,UAAU;CACzC,IAAI,kBAAkB,KAAK,KAAK,GAAG,OAAO,GAAG,WAAW,KAAK,IAAI,IAAK;CACtE,OAAO;AACT;;;;AAKA,SAAgB,KAAK,OAA+B;CAClD,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAKD,MAAM,kBA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AAW,EAAE,aAAa,WAAW,MAAM,MAAM;EACtE,IAAI,MAAM,YAAY,EAAE,iBAAiB,MAAM;EAC/C,IAAI,MAAM,cAAc,EAAE,mBAAmB,MAAM;EAEnD,OAAO;CACT;CAEA,OACE,CAAC,QAAQ,MAAM,OAAO,MAAM,OAAO,OAAO,UAAU,GAAG;OACpD,MAAM,SAAS;IAClB,EAAE;AAEN;;;;;;;AChFA,SAAgB,WAAW,OAAuB;CAChD,OAAO,eAAe,MAAM;AAC9B;;;;;;AAOA,SAAgB,OAAO,KAAa,KAAqB;CACvD,OAAO,UAAU,IAAI,IAAI,IAAI;AAC/B;;;;;;AAOA,SAAgB,OAAO,OAA0C,OAAuB;CACtF,OAAO,UAAU,MAAM,IAAI,MAAM;AACnC"}
|
package/dist/_chunk/list.js
CHANGED
|
@@ -187,7 +187,7 @@ const legacyDescription = function anonymous(props) {
|
|
|
187
187
|
if (props.isPressed) rules += " pQKeKoe151";
|
|
188
188
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
189
189
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
190
|
-
else rules += "
|
|
190
|
+
else rules += " pWQ7V3d151";
|
|
191
191
|
rules += " Js151";
|
|
192
192
|
return rules;
|
|
193
193
|
};
|
|
@@ -209,7 +209,7 @@ const listViewItem = function anonymous(props) {
|
|
|
209
209
|
else if (props.isPressed) rules += " pQKeKoe151";
|
|
210
210
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
211
211
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
212
|
-
else rules += "
|
|
212
|
+
else rules += " pWQ7V3d151";
|
|
213
213
|
if (props.isDisabled) rules += " plc151";
|
|
214
214
|
else if (props.isSelected) {
|
|
215
215
|
if (props.selectionStyle === "highlight") rules += " ple151";
|
|
@@ -512,7 +512,7 @@ const listViewDescription = function anonymous(props) {
|
|
|
512
512
|
else if (props.isPressed) rules += " pQKeKoe151";
|
|
513
513
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
514
514
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
515
|
-
else rules += "
|
|
515
|
+
else rules += " pWQ7V3d151";
|
|
516
516
|
rules += " _Nc151";
|
|
517
517
|
rules += " Pc151";
|
|
518
518
|
if (props.overflowMode === "truncate") rules += " _Yb151";
|
|
@@ -538,7 +538,7 @@ const listViewTrailingIcon = function anonymous(props) {
|
|
|
538
538
|
rules += " It151";
|
|
539
539
|
rules += " Isu151";
|
|
540
540
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
541
|
-
else rules += "
|
|
541
|
+
else rules += " pWQ7V3d151";
|
|
542
542
|
rules += " -_8sjo0b-t5ZbAob151";
|
|
543
543
|
return rules;
|
|
544
544
|
};
|
package/dist/_chunk/list.jsx
CHANGED
|
@@ -181,7 +181,7 @@ const legacyDescription = function anonymous(props) {
|
|
|
181
181
|
if (props.isPressed) rules += " pQKeKoe151";
|
|
182
182
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
183
183
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
184
|
-
else rules += "
|
|
184
|
+
else rules += " pWQ7V3d151";
|
|
185
185
|
rules += " Js151";
|
|
186
186
|
return rules;
|
|
187
187
|
};
|
|
@@ -205,7 +205,7 @@ const listViewItem = function anonymous(props) {
|
|
|
205
205
|
else if (props.isPressed) rules += " pQKeKoe151";
|
|
206
206
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
207
207
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
208
|
-
else rules += "
|
|
208
|
+
else rules += " pWQ7V3d151";
|
|
209
209
|
if (props.isDisabled) rules += " plc151";
|
|
210
210
|
else if (props.isSelected) {
|
|
211
211
|
if (props.selectionStyle === "highlight") rules += " ple151";
|
|
@@ -508,7 +508,7 @@ const listViewDescription = function anonymous(props) {
|
|
|
508
508
|
else if (props.isPressed) rules += " pQKeKoe151";
|
|
509
509
|
else if (props.isFocusVisible) rules += " pQKeKoe151";
|
|
510
510
|
else if (props.isHovered) rules += " pQKeKoe151";
|
|
511
|
-
else rules += "
|
|
511
|
+
else rules += " pWQ7V3d151";
|
|
512
512
|
rules += " _Nc151";
|
|
513
513
|
rules += " Pc151";
|
|
514
514
|
if (props.overflowMode === "truncate") rules += " _Yb151";
|
|
@@ -534,7 +534,7 @@ const listViewTrailingIcon = function anonymous(props) {
|
|
|
534
534
|
rules += " It151";
|
|
535
535
|
rules += " Isu151";
|
|
536
536
|
if (props.isDisabled) rules += " pUvnvv151";
|
|
537
|
-
else rules += "
|
|
537
|
+
else rules += " pWQ7V3d151";
|
|
538
538
|
rules += " -_8sjo0b-t5ZbAob151";
|
|
539
539
|
return rules;
|
|
540
540
|
};
|
package/dist/_chunk/menu.js
CHANGED
|
@@ -272,7 +272,7 @@ const menuButtonStyles = function anonymous(props) {
|
|
|
272
272
|
else rules += " g9ORGnd151";
|
|
273
273
|
else if (props.variant === "primary") if (props.isPressed) rules += " g8KaFke151";
|
|
274
274
|
else if (props.isHovered) rules += " g8KaFke151";
|
|
275
|
-
else rules += "
|
|
275
|
+
else rules += " gnhAeB151";
|
|
276
276
|
if (props.isDisabled) rules += " iA151";
|
|
277
277
|
else if (props.variant === "quiet") rules += " iA151";
|
|
278
278
|
else if (props.variant === "secondary") if (props.isHovered) rules += " iUvnvv151";
|