@astryxdesign/core 0.4.4 → 0.4.5-canary.1fdecb1
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/CHANGELOG.md +40 -0
- package/dist/BottomSheet/BottomSheet.d.ts +11 -2
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +5 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +65 -15
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.d.ts +57 -20
- package/dist/BottomSheet/snapOffsets.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.js +106 -30
- package/dist/BottomSheet/useSheetGestures.d.ts +13 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +160 -64
- package/dist/Calendar/Calendar.d.ts +17 -0
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +34 -3
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +14 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +1 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.js +26 -0
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts +22 -1
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarConstraints.js +26 -4
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +14 -10
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts +47 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +1 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.js +40 -0
- package/dist/Center/Center.d.ts +23 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +12 -6
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +9 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +6 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +6 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +38 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +7 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +21 -3
- package/dist/Field/InputClearButton.d.ts +2 -1
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +6 -1
- package/dist/FormLayout/FormLayout.d.ts +24 -2
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +7 -2
- package/dist/FormLayout/FormLayoutContext.d.ts +15 -2
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +19 -4
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.d.ts.map +1 -1
- package/dist/Item/Item.d.ts +9 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +45 -7
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -2
- package/dist/Layout/container.stylex.d.ts +4 -2
- package/dist/Layout/container.stylex.d.ts.map +1 -1
- package/dist/Layout/container.stylex.js +19 -11
- package/dist/Layout/index.d.ts +1 -0
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +4 -0
- package/dist/Layout/padding.stylex.d.ts +315 -12
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +389 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- package/dist/Markdown/Markdown.d.ts +8 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +31 -3
- package/dist/Markdown/parser.d.ts +14 -2
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +50 -2
- package/dist/MobileNav/MobileNav.d.ts +1 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +24 -6
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +36 -3
- package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -0
- package/dist/Outline/parseOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/parseOutlineFromMarkdown.js +5 -31
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +12 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -3
- package/dist/Section/Section.d.ts +36 -1
- package/dist/Section/Section.d.ts.map +1 -1
- package/dist/Section/Section.js +12 -2
- package/dist/Selector/Selector.d.ts +26 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +93 -15
- package/dist/Selector/SelectorOption.d.ts +14 -1
- package/dist/Selector/SelectorOption.d.ts.map +1 -1
- package/dist/Selector/SelectorOption.js +6 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
- package/dist/Selector/SelectorRowLayoutContext.js +27 -0
- package/dist/Selector/types.d.ts +1 -0
- package/dist/Selector/types.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -2
- package/dist/Stack/Stack.d.ts +23 -1
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +12 -6
- package/dist/StatusDot/StatusDot.d.ts +43 -3
- package/dist/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +42 -5
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +9 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +6 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +6 -1
- package/dist/astryx.css +40 -21
- package/dist/hooks/scrollbarGutter.d.ts +28 -0
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
- package/dist/hooks/scrollbarGutter.js +103 -0
- package/dist/hooks/useResolvedRequired.d.ts +19 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -0
- package/dist/hooks/useResolvedRequired.js +40 -0
- package/dist/hooks/useScrollLock.d.ts +4 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +13 -1
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +7 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +37 -4
- package/dist/utils/plainDate.d.ts +6 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +12 -0
- package/locales/af-ZA.json +958 -0
- package/locales/ar-SA.json +998 -0
- package/locales/ca-ES.json +974 -0
- package/locales/cs-CZ.json +990 -0
- package/locales/da-DK.json +966 -0
- package/locales/de-DE.json +966 -0
- package/locales/el-GR.json +990 -0
- package/locales/en.json +8 -0
- package/locales/es-ES.json +978 -0
- package/locales/fi-FI.json +990 -0
- package/locales/fr-FR.json +928 -0
- package/locales/he-IL.json +990 -0
- package/locales/hu-HU.json +990 -0
- package/locales/it-IT.json +978 -0
- package/locales/ja-JP.json +998 -0
- package/locales/ko-KR.json +990 -0
- package/locales/nl-NL.json +954 -0
- package/locales/no-NO.json +978 -0
- package/locales/pl-PL.json +982 -0
- package/locales/pseudo.json +6 -0
- package/locales/pt-BR.json +982 -0
- package/locales/pt-PT.json +982 -0
- package/locales/ro-RO.json +982 -0
- package/locales/ru-RU.json +990 -0
- package/locales/sr-SP.json +990 -0
- package/locales/sv-SE.json +986 -0
- package/locales/tr-TR.json +990 -0
- package/locales/uk-UA.json +990 -0
- package/locales/vi-VN.json +986 -0
- package/locales/zh-CN.json +998 -0
- package/locales/zh-TW.json +998 -0
- package/package.json +3 -3
- package/src/BottomSheet/BottomSheet.doc.mjs +36 -3
- package/src/BottomSheet/BottomSheet.test.tsx +177 -2
- package/src/BottomSheet/BottomSheet.tsx +16 -2
- package/src/BottomSheet/BottomSheetPanel.test.tsx +41 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +95 -15
- package/src/BottomSheet/index.ts +5 -1
- package/src/BottomSheet/snapOffsets.test.ts +114 -47
- package/src/BottomSheet/snapOffsets.ts +119 -33
- package/src/BottomSheet/useSheetGestures.test.ts +113 -15
- package/src/BottomSheet/useSheetGestures.ts +196 -100
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.test.tsx +137 -0
- package/src/Calendar/Calendar.tsx +65 -2
- package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +54 -0
- package/src/Calendar/getStandaloneShortWeekdayNames.ts +38 -0
- package/src/Calendar/hooks/useCalendarConstraints.ts +54 -3
- package/src/Calendar/hooks/useCalendarDays.ts +13 -10
- package/src/Calendar/standaloneShortWeekdayNames.generated.ts +50 -0
- package/src/Center/Center.doc.mjs +48 -0
- package/src/Center/Center.test.tsx +158 -0
- package/src/Center/Center.tsx +50 -9
- package/src/CheckboxInput/CheckboxInput.tsx +6 -0
- package/src/ComplexSelector/ComplexSelector.tsx +3 -1
- package/src/DateInput/DateInput.tsx +3 -1
- package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +81 -1
- package/src/DateRangeInput/DateRangeInput.tsx +72 -1
- package/src/DateTimeInput/DateTimeInput.tsx +4 -2
- package/src/Dialog/Dialog.test.tsx +24 -0
- package/src/Dialog/Dialog.tsx +3 -0
- package/src/Field/Field.doc.mjs +1 -0
- package/src/Field/FieldLabel.tsx +20 -4
- package/src/Field/InputClearButton.test.tsx +25 -0
- package/src/Field/InputClearButton.tsx +4 -1
- package/src/FormLayout/FormLayout.doc.mjs +13 -0
- package/src/FormLayout/FormLayout.test.tsx +181 -4
- package/src/FormLayout/FormLayout.tsx +33 -2
- package/src/FormLayout/FormLayoutContext.ts +22 -7
- package/src/FormLayout/index.ts +1 -1
- package/src/Item/Item.doc.mjs +1 -0
- package/src/Item/Item.test.tsx +50 -0
- package/src/Item/Item.tsx +40 -1
- package/src/Layer/useLayer.tsx +13 -2
- package/src/Layout/Layout.doc.mjs +18 -0
- package/src/Layout/container.stylex.ts +11 -3
- package/src/Layout/index.ts +4 -0
- package/src/Layout/overlayPaddingReset.test.tsx +222 -0
- package/src/Layout/padding.stylex.ts +192 -12
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/Markdown/Markdown.doc.mjs +3 -0
- package/src/Markdown/Markdown.test.tsx +78 -0
- package/src/Markdown/Markdown.tsx +41 -1
- package/src/Markdown/parser.ts +60 -2
- package/src/MobileNav/MobileNav.tsx +61 -5
- package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
- package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
- package/src/MultiSelector/MultiSelector.tsx +3 -1
- package/src/NumberInput/NumberInput.doc.mjs +24 -0
- package/src/NumberInput/NumberInput.test.tsx +138 -0
- package/src/NumberInput/NumberInput.tsx +43 -5
- package/src/Outline/Outline.doc.mjs +2 -0
- package/src/Outline/parseOutlineFromMarkdown.ts +10 -40
- package/src/RadioList/RadioList.tsx +9 -1
- package/src/Resizable/ResizeHandle.test.tsx +22 -0
- package/src/Resizable/ResizeHandle.tsx +9 -3
- package/src/Section/Section.doc.mjs +55 -0
- package/src/Section/Section.test.tsx +201 -4
- package/src/Section/Section.tsx +69 -0
- package/src/Selector/Selector.doc.mjs +16 -2
- package/src/Selector/Selector.test.tsx +524 -0
- package/src/Selector/Selector.tsx +161 -17
- package/src/Selector/SelectorOption.doc.mjs +7 -0
- package/src/Selector/SelectorOption.tsx +21 -0
- package/src/Selector/SelectorRowLayoutContext.ts +32 -0
- package/src/Selector/types.ts +4 -4
- package/src/Slider/Slider.tsx +10 -0
- package/src/Stack/Stack.doc.mjs +72 -0
- package/src/Stack/Stack.test.tsx +156 -0
- package/src/Stack/Stack.tsx +50 -8
- package/src/StatusDot/StatusDot.doc.mjs +13 -0
- package/src/StatusDot/StatusDot.test.tsx +115 -8
- package/src/StatusDot/StatusDot.tsx +74 -9
- package/src/Switch/Switch.tsx +6 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +20 -2
- package/src/TextArea/TextArea.tsx +3 -1
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/TimeInput/TimeInput.tsx +3 -1
- package/src/hooks/scrollbarGutter.test.ts +167 -0
- package/src/hooks/scrollbarGutter.ts +121 -0
- package/src/hooks/useResolvedRequired.ts +42 -0
- package/src/hooks/useScrollLock.doc.mjs +4 -4
- package/src/hooks/useScrollLock.test.ts +73 -0
- package/src/hooks/useScrollLock.ts +14 -0
- package/src/theme/derivedVarRegistry.test.ts +14 -3
- package/src/theme/derivedVarRegistry.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +79 -0
- package/src/theme/generateThemeRules.ts +49 -4
- package/src/utils/plainDate.test.ts +50 -0
- package/src/utils/plainDate.ts +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpD,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAgBtD,OAAO,KAAK,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpD,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAgBtD,OAAO,KAAK,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAepE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AA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AAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IACzE,yBAAyB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AA4C3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EACnD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,qBAk5BxB;yBAn5Be,QAAQ"}
|
|
@@ -33,7 +33,9 @@ import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, t
|
|
|
33
33
|
import { isOptionData, isDivider, isSection, normalizeOption, getSelectableOptions } from "./utils.js";
|
|
34
34
|
import { useCombobox, useSelectedItemOffset } from "./hooks.js";
|
|
35
35
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
36
|
+
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
36
37
|
import { SelectorOption } from "./SelectorOption.js";
|
|
38
|
+
import { SelectorRowLayoutContext } from "./SelectorRowLayoutContext.js";
|
|
37
39
|
import { getInputARIA, isImeKeyEvent, mergeProps } from "../utils/index.js";
|
|
38
40
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
39
41
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -56,7 +58,7 @@ const styles = {
|
|
|
56
58
|
kg3NbH: "xrrkdod",
|
|
57
59
|
kMv6JI: "x9ynric",
|
|
58
60
|
kGuDYH: "xcr08ib xdk3u5w",
|
|
59
|
-
kLWn49: "
|
|
61
|
+
kLWn49: "x7acx1w",
|
|
60
62
|
kMwMTN: "x1tgivj0",
|
|
61
63
|
kkrTdU: "x1ypdohk",
|
|
62
64
|
$$css: true
|
|
@@ -65,6 +67,11 @@ const styles = {
|
|
|
65
67
|
kMwMTN: "xv1l7n4",
|
|
66
68
|
$$css: true
|
|
67
69
|
},
|
|
70
|
+
triggerInGroup: {
|
|
71
|
+
kAzted: "x2lwn1j",
|
|
72
|
+
k8WAf4: "xt970qd",
|
|
73
|
+
$$css: true
|
|
74
|
+
},
|
|
68
75
|
triggerIcon: {
|
|
69
76
|
kmuXW: "x2lah0s",
|
|
70
77
|
$$css: true
|
|
@@ -154,17 +161,32 @@ const styles = {
|
|
|
154
161
|
$$css: true
|
|
155
162
|
}
|
|
156
163
|
};
|
|
164
|
+
|
|
165
|
+
// The trigger is sized by PADDING, not by a fixed height, so it is the size
|
|
166
|
+
// token plus one text line for each extra line the value uses: 28/32/36 for
|
|
167
|
+
// one line, 48/52/56 for two. The token and a text line are both multiples of
|
|
168
|
+
// 4, so every trigger lands on the 4px rhythm and lines up with the Buttons
|
|
169
|
+
// and inputs beside it. No prop picks the height — the content does, and it
|
|
170
|
+
// can only land on the grid.
|
|
171
|
+
//
|
|
172
|
+
// `--spacing-5` is one line here because `triggerContainer` pins its
|
|
173
|
+
// line-height to exactly that; the two must stay in step, which is why both
|
|
174
|
+
// read the same token rather than one hardcoding 20px.
|
|
175
|
+
const linePad = token => `calc((${token} - ${spacingVars['--spacing-5']} - 2 * ${borderVars['--border-width']}) / 2)`;
|
|
157
176
|
const sizeStyles = {
|
|
158
177
|
sm: {
|
|
159
|
-
|
|
178
|
+
kAzted: "x1gdqauq",
|
|
179
|
+
k8WAf4: "x1ecmfrv",
|
|
160
180
|
$$css: true
|
|
161
181
|
},
|
|
162
182
|
md: {
|
|
163
|
-
|
|
183
|
+
kAzted: "x1uogy3y",
|
|
184
|
+
k8WAf4: "x1ioay2v",
|
|
164
185
|
$$css: true
|
|
165
186
|
},
|
|
166
187
|
lg: {
|
|
167
|
-
|
|
188
|
+
kAzted: "x1xf4nls",
|
|
189
|
+
k8WAf4: "x1vn5h1t",
|
|
168
190
|
$$css: true
|
|
169
191
|
}
|
|
170
192
|
};
|
|
@@ -218,7 +240,8 @@ function DefaultOption({
|
|
|
218
240
|
}) {
|
|
219
241
|
return /*#__PURE__*/_jsx(SelectorOption, {
|
|
220
242
|
icon: option.icon,
|
|
221
|
-
label: option.label ?? option.value
|
|
243
|
+
label: option.label ?? option.value,
|
|
244
|
+
description: option.description
|
|
222
245
|
});
|
|
223
246
|
}
|
|
224
247
|
|
|
@@ -281,6 +304,7 @@ export function Selector(props) {
|
|
|
281
304
|
startIcon,
|
|
282
305
|
htmlName,
|
|
283
306
|
renderOption,
|
|
307
|
+
renderValue,
|
|
284
308
|
indicatorPosition = 'end',
|
|
285
309
|
hasSearch = false,
|
|
286
310
|
searchPlaceholder: searchPlaceholderFromProps,
|
|
@@ -294,6 +318,10 @@ export function Selector(props) {
|
|
|
294
318
|
hasClear: hasClearProp,
|
|
295
319
|
...rest
|
|
296
320
|
} = props;
|
|
321
|
+
const isEffectivelyRequired = useResolvedRequired({
|
|
322
|
+
isRequired,
|
|
323
|
+
isOptional
|
|
324
|
+
});
|
|
297
325
|
const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
|
|
298
326
|
const searchPlaceholder = searchPlaceholderFromProps ?? t('@astryx.selector.searchPlaceholder');
|
|
299
327
|
const hasClear = hasClearProp === true;
|
|
@@ -682,7 +710,20 @@ export function Selector(props) {
|
|
|
682
710
|
"aria-disabled": item.disabled,
|
|
683
711
|
onClick: () => onItemSelect(item),
|
|
684
712
|
onMouseEnter: () => onItemMouseEnter(item, flatIndex),
|
|
685
|
-
...
|
|
713
|
+
...mergeProps(
|
|
714
|
+
// Stable theme target on the option row itself, mirroring
|
|
715
|
+
// `multi-selector-option`: it carries the row's size and runtime
|
|
716
|
+
// state so a theme can express "selected option at large" or
|
|
717
|
+
// restyle a given row density without structural selectors. The
|
|
718
|
+
// row's padding is split across a base and a per-size override (the
|
|
719
|
+
// default `md` trims the block axis), so `size` is what a theme
|
|
720
|
+
// needs to reach it. Named `-option-row` because `selector-option`
|
|
721
|
+
// is the public SelectorOption content primitive, not this row.
|
|
722
|
+
themeProps('selector-option-row', {
|
|
723
|
+
size,
|
|
724
|
+
selected: isSelected ? 'selected' : null,
|
|
725
|
+
disabled: item.disabled ? 'disabled' : null
|
|
726
|
+
}), stylex.props(styles.item, itemSizeStyles[size], isHighlighted && styles.itemHighlighted, isSelected && styles.itemSelected, item.disabled && styles.itemDisabled)),
|
|
686
727
|
children: content
|
|
687
728
|
}, item.value);
|
|
688
729
|
}, [renderOption, indicatorPosition, highlightedIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter, SelectionMark]);
|
|
@@ -765,6 +806,43 @@ export function Selector(props) {
|
|
|
765
806
|
// on-field icon would duplicate it — keep the chevron indicator instead.
|
|
766
807
|
const showStatusIcon = status != null && effectiveStatusVariant !== 'detached';
|
|
767
808
|
const showStatusTooltip = status != null && effectiveStatusVariant === 'tooltip' && !!status.message;
|
|
809
|
+
|
|
810
|
+
// Two lines cannot fit inside an InputGroup: the group pins the row height,
|
|
811
|
+
// and the trigger clamps its value box to one line so nothing bleeds through
|
|
812
|
+
// its border (styles.triggerValueInGroup). The clamp holds for any node; the
|
|
813
|
+
// context is what lets the rows the system draws itself reflow into that one
|
|
814
|
+
// line — label and description side by side — instead of being cut off at
|
|
815
|
+
// it. Outside a group the caller's own row decides, and the trigger's
|
|
816
|
+
// padding sizes it to whatever that draws.
|
|
817
|
+
const rowLayout = inputGroup ? 'inline' : 'stacked';
|
|
818
|
+
|
|
819
|
+
// What the closed trigger shows for the current selection: the option's icon
|
|
820
|
+
// and label. `startIcon` wins over the option's own icon so a caller who
|
|
821
|
+
// pins a field icon does not get two.
|
|
822
|
+
const valueContent = selectedItem && renderValue ? /*#__PURE__*/_jsx(SelectorRowLayoutContext, {
|
|
823
|
+
value: rowLayout,
|
|
824
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
825
|
+
...{
|
|
826
|
+
0: {
|
|
827
|
+
className: "x1iyjqo2 xeuugli xb3r6kr x1yc453h"
|
|
828
|
+
},
|
|
829
|
+
1: {
|
|
830
|
+
className: "x1iyjqo2 xeuugli xb3r6kr x1yc453h xmz0i5r"
|
|
831
|
+
}
|
|
832
|
+
}[!!inputGroup << 0],
|
|
833
|
+
children: renderValue(selectedItem)
|
|
834
|
+
})
|
|
835
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
836
|
+
children: [!startIcon && selectedItem?.icon != null && renderIconSlot(selectedItem.icon, {
|
|
837
|
+
size: 'sm',
|
|
838
|
+
color: 'secondary'
|
|
839
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
840
|
+
...{
|
|
841
|
+
className: "x1iyjqo2 xeuugli xb3r6kr xlyipyv xuxw1ft x1yc453h"
|
|
842
|
+
},
|
|
843
|
+
children: selectedItem?.label ?? placeholder
|
|
844
|
+
})]
|
|
845
|
+
});
|
|
768
846
|
const selectorContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
769
847
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
770
848
|
ref: el => {
|
|
@@ -782,7 +860,7 @@ export function Selector(props) {
|
|
|
782
860
|
size,
|
|
783
861
|
status: status?.type ?? null,
|
|
784
862
|
disabled: isDisabled ? 'disabled' : null
|
|
785
|
-
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
863
|
+
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, inputGroup && styles.triggerInGroup, xstyle), className, style),
|
|
786
864
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
787
865
|
size: 'sm',
|
|
788
866
|
color: 'secondary'
|
|
@@ -805,7 +883,7 @@ export function Selector(props) {
|
|
|
805
883
|
"aria-activedescendant": !hasSearch && popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
|
|
806
884
|
"aria-describedby": ariaDescribedBy,
|
|
807
885
|
"aria-labelledby": ariaLabelledBy,
|
|
808
|
-
"aria-required":
|
|
886
|
+
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
809
887
|
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
810
888
|
"aria-busy": isBusy || undefined
|
|
811
889
|
// With a disabledMessage the trigger keeps focusability via
|
|
@@ -817,14 +895,14 @@ export function Selector(props) {
|
|
|
817
895
|
onKeyDown: handleTriggerKeyDown,
|
|
818
896
|
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
819
897
|
...{
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
823
|
-
...{
|
|
824
|
-
className: "x1iyjqo2 xeuugli xb3r6kr xlyipyv xuxw1ft x1yc453h"
|
|
898
|
+
0: {
|
|
899
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz"
|
|
825
900
|
},
|
|
826
|
-
|
|
827
|
-
|
|
901
|
+
1: {
|
|
902
|
+
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz xkh2ocl"
|
|
903
|
+
}
|
|
904
|
+
}[!!inputGroup << 0],
|
|
905
|
+
children: valueContent
|
|
828
906
|
}), htmlName != null && /*#__PURE__*/_jsx("input", {
|
|
829
907
|
type: "hidden",
|
|
830
908
|
name: htmlName,
|
|
@@ -21,6 +21,19 @@ export interface SelectorOptionProps {
|
|
|
21
21
|
* Secondary description text displayed below the label.
|
|
22
22
|
*/
|
|
23
23
|
description?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* How the label and description sit together. `stacked` puts the
|
|
26
|
+
* description on its own line below the label; `inline` keeps both on one
|
|
27
|
+
* line, with the description ellipsizing first.
|
|
28
|
+
*
|
|
29
|
+
* In a Selector trigger this is the caller's choice and the trigger sizes
|
|
30
|
+
* itself to it — one line at the size token, two lines exactly one text line
|
|
31
|
+
* taller. Inside an `InputGroup` the row height is pinned by the group, so
|
|
32
|
+
* `inline` is forced.
|
|
33
|
+
*
|
|
34
|
+
* @default 'stacked'
|
|
35
|
+
*/
|
|
36
|
+
layout?: 'stacked' | 'inline';
|
|
24
37
|
/**
|
|
25
38
|
* Additional content to render after the label/description.
|
|
26
39
|
*/
|
|
@@ -70,7 +83,7 @@ export interface SelectorOptionProps {
|
|
|
70
83
|
* />
|
|
71
84
|
* ```
|
|
72
85
|
*/
|
|
73
|
-
export declare function SelectorOption({ icon, label, description, endContent, xstyle, className, style, }: SelectorOptionProps): import("react").JSX.Element;
|
|
86
|
+
export declare function SelectorOption({ icon, label, description, layout, endContent, xstyle, className, style, }: SelectorOptionProps): import("react").JSX.Element;
|
|
74
87
|
export declare namespace SelectorOption {
|
|
75
88
|
var displayName: string;
|
|
76
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorOption.d.ts","sourceRoot":"","sources":["../../src/Selector/SelectorOption.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectorOption.d.ts","sourceRoot":"","sources":["../../src/Selector/SelectorOption.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AActD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,+BAoBrB;yBA7Be,cAAc"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import * as stylex from '@stylexjs/stylex';
|
|
12
12
|
import { renderIconSlot } from "../Icon/index.js";
|
|
13
13
|
import { Item } from "../Item/index.js";
|
|
14
|
+
import { useSelectorRowLayout } from "./SelectorRowLayoutContext.js";
|
|
14
15
|
import { mergeProps } from "../utils/index.js";
|
|
15
16
|
import { themeProps } from "../utils/themeProps.js";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -49,11 +50,15 @@ export function SelectorOption({
|
|
|
49
50
|
icon,
|
|
50
51
|
label,
|
|
51
52
|
description,
|
|
53
|
+
layout,
|
|
52
54
|
endContent,
|
|
53
55
|
xstyle,
|
|
54
56
|
className,
|
|
55
57
|
style
|
|
56
58
|
}) {
|
|
59
|
+
// A height-pinned host (the trigger inside an InputGroup) overrides the
|
|
60
|
+
// caller's choice: the row physically cannot be two lines there.
|
|
61
|
+
const enforcedLayout = useSelectorRowLayout();
|
|
57
62
|
return /*#__PURE__*/_jsx(Item, {
|
|
58
63
|
startContent: icon ? renderIconSlot(icon, {
|
|
59
64
|
size: 'sm',
|
|
@@ -61,6 +66,7 @@ export function SelectorOption({
|
|
|
61
66
|
}) : undefined,
|
|
62
67
|
label: label,
|
|
63
68
|
description: description,
|
|
69
|
+
layout: enforcedLayout === 'inline' ? 'inline' : layout,
|
|
64
70
|
endContent: endContent,
|
|
65
71
|
xstyle: [embeddedStyles.root, xstyle],
|
|
66
72
|
...mergeProps(themeProps('selector-option'), {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type SelectorRowLayout = 'stacked' | 'inline';
|
|
2
|
+
export declare const SelectorRowLayoutContext: import("react").Context<SelectorRowLayout>;
|
|
3
|
+
/**
|
|
4
|
+
* The row layout a host imposes on the options it renders. `stacked` outside
|
|
5
|
+
* any height-pinned host.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSelectorRowLayout(): SelectorRowLayout;
|
|
8
|
+
//# sourceMappingURL=SelectorRowLayoutContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectorRowLayoutContext.d.ts","sourceRoot":"","sources":["../../src/Selector/SelectorRowLayoutContext.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,eAAO,MAAM,wBAAwB,4CACQ,CAAC;AAG9C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file SelectorRowLayoutContext.ts
|
|
7
|
+
* @input React createContext/use
|
|
8
|
+
* @output Exports the row-layout context and useSelectorRowLayout hook
|
|
9
|
+
* @position Internal to the Selector module; read by SelectorOption
|
|
10
|
+
*
|
|
11
|
+
* The trigger inside an InputGroup is height-pinned by the group, so its value
|
|
12
|
+
* box is clamped to one line and anything taller is cut off at the fold. This
|
|
13
|
+
* context is how the rows the system draws itself avoid being cut: they reflow
|
|
14
|
+
* label and description onto that one line instead. The geometry does not
|
|
15
|
+
* depend on it — a node that ignores this context still cannot grow the row.
|
|
16
|
+
*/
|
|
17
|
+
import { createContext, use } from 'react';
|
|
18
|
+
export const SelectorRowLayoutContext = /*#__PURE__*/createContext('stacked');
|
|
19
|
+
SelectorRowLayoutContext.displayName = 'SelectorRowLayoutContext';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The row layout a host imposes on the options it renders. `stacked` outside
|
|
23
|
+
* any height-pinned host.
|
|
24
|
+
*/
|
|
25
|
+
export function useSelectorRowLayout() {
|
|
26
|
+
return use(SelectorRowLayoutContext);
|
|
27
|
+
}
|
package/dist/Selector/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Selector/types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Selector/types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC5B,MAAM,GAAG,kBAAkB,GAAG,eAAe,GAAG,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAg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,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,8CAA8C;IAC9C,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC7C,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAChD,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AA2R/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,WAAW,+BAmnBlD;yBAnnBe,MAAM"}
|
package/dist/Slider/Slider.js
CHANGED
|
@@ -630,13 +630,13 @@ export function Slider({
|
|
|
630
630
|
onPointerCancel: handlePointerUp,
|
|
631
631
|
...{
|
|
632
632
|
0: {
|
|
633
|
-
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xdt5ytf xl56j7k x1ypdohk"
|
|
633
|
+
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk"
|
|
634
634
|
},
|
|
635
635
|
2: {
|
|
636
636
|
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk"
|
|
637
637
|
},
|
|
638
638
|
1: {
|
|
639
|
-
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xdt5ytf xl56j7k xbyyjgo x1h6gzvc"
|
|
639
|
+
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo x1h6gzvc"
|
|
640
640
|
},
|
|
641
641
|
3: {
|
|
642
642
|
className: "x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo x1h6gzvc"
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -103,11 +103,33 @@ export interface StackProps extends BaseProps<HTMLElement> {
|
|
|
103
103
|
* Overrides `padding` on the inline axis when both are set.
|
|
104
104
|
*/
|
|
105
105
|
paddingInline?: SpacingStep;
|
|
106
|
+
/**
|
|
107
|
+
* Inline-start padding, using the spacing scale. Logical: the left edge in
|
|
108
|
+
* LTR, the right edge in RTL.
|
|
109
|
+
* Overrides `paddingInline` and `padding` on that edge only.
|
|
110
|
+
*/
|
|
111
|
+
paddingInlineStart?: SpacingStep;
|
|
112
|
+
/**
|
|
113
|
+
* Inline-end padding, using the spacing scale. Logical: the right edge in
|
|
114
|
+
* LTR, the left edge in RTL.
|
|
115
|
+
* Overrides `paddingInline` and `padding` on that edge only.
|
|
116
|
+
*/
|
|
117
|
+
paddingInlineEnd?: SpacingStep;
|
|
106
118
|
/**
|
|
107
119
|
* Block (vertical) padding, using the spacing scale.
|
|
108
120
|
* Overrides `padding` on the block axis when both are set.
|
|
109
121
|
*/
|
|
110
122
|
paddingBlock?: SpacingStep;
|
|
123
|
+
/**
|
|
124
|
+
* Block-start (top) padding, using the spacing scale.
|
|
125
|
+
* Overrides `paddingBlock` and `padding` on that edge only.
|
|
126
|
+
*/
|
|
127
|
+
paddingBlockStart?: SpacingStep;
|
|
128
|
+
/**
|
|
129
|
+
* Block-end (bottom) padding, using the spacing scale.
|
|
130
|
+
* Overrides `paddingBlock` and `padding` on that edge only.
|
|
131
|
+
*/
|
|
132
|
+
paddingBlockEnd?: SpacingStep;
|
|
111
133
|
/**
|
|
112
134
|
* Enables scrollable overflow (`overflow: auto`) for the stack.
|
|
113
135
|
*
|
|
@@ -160,7 +182,7 @@ export interface StackProps extends BaseProps<HTMLElement> {
|
|
|
160
182
|
* </Stack>
|
|
161
183
|
* ```
|
|
162
184
|
*/
|
|
163
|
-
export declare function Stack({ direction, hAlign, vAlign, justify, align, gap, padding, paddingInline, paddingBlock, isScrollable, width, height, maxWidth, minHeight, wrap, as: element, xstyle, className, style, children, ref, ...props }: StackProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
185
|
+
export declare function Stack({ direction, hAlign, vAlign, justify, align, gap, padding, paddingInline, paddingInlineStart, paddingInlineEnd, paddingBlock, paddingBlockStart, paddingBlockEnd, isScrollable, width, height, maxWidth, minHeight, wrap, as: element, xstyle, className, style, children, ref, ...props }: StackProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
164
186
|
export declare namespace Stack {
|
|
165
187
|
var displayName: string;
|
|
166
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/Stack/Stack.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAChF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","s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IAE5B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC;IAEjC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAEhC;;;OAGG;IACH,eAAe,CAAC,EAAE,WAAW,CAAC;IAE9B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,KAAK,CAAC,EACpB,SAAsB,EACtB,MAAM,EACN,MAAM,EACN,OAAO,EACP,KAAK,EACL,GAAG,EACH,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,EAAE,EAAE,OAAe,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,0FA4EZ;yBAvGe,KAAK"}
|
package/dist/Stack/Stack.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { createElement } from 'react';
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import { stack } from "./stack.stylex.js";
|
|
18
|
-
import {
|
|
18
|
+
import { paddingInlineStartStyles, paddingInlineEndStyles, paddingBlockStartStyles, paddingBlockEndStyles } from "../Layout/padding.stylex.js";
|
|
19
19
|
import { mergeProps } from "../utils/index.js";
|
|
20
20
|
import { themeProps } from "../utils/themeProps.js";
|
|
21
21
|
const overflowStyles = {
|
|
@@ -69,7 +69,11 @@ export function Stack({
|
|
|
69
69
|
gap,
|
|
70
70
|
padding,
|
|
71
71
|
paddingInline,
|
|
72
|
+
paddingInlineStart,
|
|
73
|
+
paddingInlineEnd,
|
|
72
74
|
paddingBlock,
|
|
75
|
+
paddingBlockStart,
|
|
76
|
+
paddingBlockEnd,
|
|
73
77
|
isScrollable,
|
|
74
78
|
width,
|
|
75
79
|
height,
|
|
@@ -92,17 +96,19 @@ export function Stack({
|
|
|
92
96
|
const mainAlign = direction === 'horizontal' ? resolvedHAlign : resolvedVAlign;
|
|
93
97
|
const crossAlign = direction === 'horizontal' ? resolvedVAlign : resolvedHAlign;
|
|
94
98
|
|
|
95
|
-
// Resolve padding to per-
|
|
96
|
-
//
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
+
// Resolve padding to per-edge values. Most specific wins, per edge:
|
|
100
|
+
// edge prop -> axis prop -> `padding`.
|
|
101
|
+
const resolvedPaddingInlineStart = paddingInlineStart ?? paddingInline ?? padding;
|
|
102
|
+
const resolvedPaddingInlineEnd = paddingInlineEnd ?? paddingInline ?? padding;
|
|
103
|
+
const resolvedPaddingBlockStart = paddingBlockStart ?? paddingBlock ?? padding;
|
|
104
|
+
const resolvedPaddingBlockEnd = paddingBlockEnd ?? paddingBlock ?? padding;
|
|
99
105
|
const stylexProps = stylex.props(...stack({
|
|
100
106
|
direction,
|
|
101
107
|
crossAlign,
|
|
102
108
|
mainAlign,
|
|
103
109
|
gap,
|
|
104
110
|
wrap
|
|
105
|
-
}),
|
|
111
|
+
}), resolvedPaddingInlineStart != null && paddingInlineStartStyles[resolvedPaddingInlineStart], resolvedPaddingInlineEnd != null && paddingInlineEndStyles[resolvedPaddingInlineEnd], resolvedPaddingBlockStart != null && paddingBlockStartStyles[resolvedPaddingBlockStart], resolvedPaddingBlockEnd != null && paddingBlockEndStyles[resolvedPaddingBlockEnd], isScrollable && overflowStyles.scrollable, xstyle);
|
|
106
112
|
|
|
107
113
|
// Build inline style for dynamic sizing values
|
|
108
114
|
const sizingStyle = {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file StatusDot.tsx
|
|
3
|
+
* @input Uses React
|
|
4
|
+
* @output Exports StatusDot component, StatusDotProps, StatusDotVariant types
|
|
5
|
+
* @position Core implementation; consumed by index.ts
|
|
6
|
+
*
|
|
7
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
8
|
+
* - /packages/core/src/StatusDot/StatusDot.doc.mjs (props table, features, implementation notes)
|
|
9
|
+
* - /packages/core/src/StatusDot/StatusDot.test.tsx (tests for new/changed behavior)
|
|
10
|
+
* - /packages/core/src/StatusDot/index.ts (exports if types change)
|
|
11
|
+
* - /apps/storybook/stories/StatusDot.stories.tsx (storybook stories)
|
|
12
|
+
* - /packages/cli/assets/templates/blocks/components/StatusDot/ (showcase blocks)
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from 'react';
|
|
1
15
|
import type { BaseProps } from '../BaseProps';
|
|
2
16
|
import type { StatusDotVariantMap } from './index';
|
|
3
17
|
/**
|
|
@@ -13,7 +27,8 @@ export interface StatusDotProps extends BaseProps<HTMLSpanElement> {
|
|
|
13
27
|
*/
|
|
14
28
|
variant: StatusDotVariant;
|
|
15
29
|
/**
|
|
16
|
-
* Accessible label describing the status. Required for a11y
|
|
30
|
+
* Accessible label describing the status. Required for a11y — it is the
|
|
31
|
+
* dot's `aria-label`, so the status reaches screen readers without hover.
|
|
17
32
|
*/
|
|
18
33
|
label: string;
|
|
19
34
|
/**
|
|
@@ -27,11 +42,35 @@ export interface StatusDotProps extends BaseProps<HTMLSpanElement> {
|
|
|
27
42
|
* When omitted, no tooltip is rendered.
|
|
28
43
|
*/
|
|
29
44
|
tooltip?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional icon to render centered inside the dot. Accepts any ReactNode
|
|
47
|
+
* (typically an SVG icon), painted in the dot's `currentColor` ink. Same
|
|
48
|
+
* contract as `AvatarStatusDot`'s `icon`.
|
|
49
|
+
*
|
|
50
|
+
* By default the dot is a colour-only signal; an icon gives the status a
|
|
51
|
+
* non-colour mark, so use a different icon per status — the same icon on
|
|
52
|
+
* every variant leaves the statuses distinguishable by colour alone
|
|
53
|
+
* (WCAG 2.1 SC 1.4.1). Booleans and empty strings are ignored (safe for
|
|
54
|
+
* `cond && <Icon />`).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```
|
|
58
|
+
* <StatusDot variant="success" label="Verified" icon={<CheckIcon />} />
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
icon?: ReactNode;
|
|
30
62
|
}
|
|
31
63
|
/**
|
|
32
64
|
* A small colored dot indicator for status display (online/offline, severity, etc).
|
|
33
65
|
*
|
|
34
|
-
* Fixed 8px size.
|
|
66
|
+
* Fixed 8px size. By default the dot conveys status by colour only, which is
|
|
67
|
+
* not accessible in isolation (WCAG 2.1 SC 1.4.1) — treat it as a signal the
|
|
68
|
+
* surrounding UI must make accessible: use it as a binary present/absent
|
|
69
|
+
* signal, pair it with a visible label, pass `icon` so the status carries a
|
|
70
|
+
* non-colour mark, or convey the status accessibly elsewhere. See the usage
|
|
71
|
+
* guidance in the component docs.
|
|
72
|
+
*
|
|
73
|
+
* Renders as a non-focusable `<span>` with `role="img"` and
|
|
35
74
|
* `aria-label` for accessibility. Styles use Astryx theme tokens via StyleX.
|
|
36
75
|
* Wrap your app in `<Theme>` to apply a theme.
|
|
37
76
|
*
|
|
@@ -41,9 +80,10 @@ export interface StatusDotProps extends BaseProps<HTMLSpanElement> {
|
|
|
41
80
|
* <StatusDot variant="error" label="Offline" />
|
|
42
81
|
* <StatusDot variant="success" label="Live" isPulsing />
|
|
43
82
|
* <StatusDot variant="success" label="Online" tooltip="Online" />
|
|
83
|
+
* <StatusDot variant="success" label="Verified" icon={<CheckIcon />} />
|
|
44
84
|
* ```
|
|
45
85
|
*/
|
|
46
|
-
export declare function StatusDot({ variant, label, isPulsing, tooltip, xstyle, className, style, ref, ...props }: StatusDotProps): import("react").JSX.Element;
|
|
86
|
+
export declare function StatusDot({ variant, label, isPulsing, tooltip, icon, xstyle, className, style, ref, ...props }: StatusDotProps): import("react").JSX.Element;
|
|
47
87
|
export declare namespace StatusDot {
|
|
48
88
|
var displayName: string;
|
|
49
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.d.ts","sourceRoot":"","sources":["../../src/StatusDot/StatusDot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusDot.d.ts","sourceRoot":"","sources":["../../src/StatusDot/StatusDot.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAIrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAI5C,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAoFjD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,KAAK,EACL,SAAiB,EACjB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,+BAmChB;yBA9Ce,SAAS"}
|