@kanso-labs/kanso-ui 0.26.6 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection/styles.js +12 -2
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +13 -1
- package/dist/components/app-bar/index.js +82 -68
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/color-field/index.d.ts +2 -1
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +9 -1
- package/dist/components/color-picker/index.js +84 -73
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +3 -2
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +12 -3
- package/dist/components/date-picker/index.js +31 -23
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +12 -3
- package/dist/components/date-range-picker/index.js +31 -23
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/form/index.d.ts +13 -2
- package/dist/components/form/index.js +4 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/index.d.ts +26 -25
- package/dist/components/list/index.d.ts +23 -17
- package/dist/components/list/index.js +27 -25
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +8 -2
- package/dist/components/list-box/index.js +56 -50
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +14 -0
- package/dist/components/list-detail/index.js +5 -0
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +1 -1
- package/dist/components/list-item/index.js +50 -31
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-tree/index.d.ts +1 -1
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +6 -0
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +1 -1
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +10 -3
- package/dist/components/snackbar/index.js +58 -49
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/text/index.d.ts +7 -2
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/time-field/index.d.ts +3 -2
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/field/root.js +9 -0
- package/dist/field/root.js.map +1 -1
- package/dist/index.d.ts +26 -25
- package/dist/styles.css +30 -32
- package/package.json +3 -3
|
@@ -63,9 +63,10 @@ const triggerStyles = {
|
|
|
63
63
|
* element a layout positions.
|
|
64
64
|
*/
|
|
65
65
|
function ColorPicker$1(t0) {
|
|
66
|
-
const $ = c(
|
|
66
|
+
const $ = c(40);
|
|
67
67
|
let children;
|
|
68
68
|
let className;
|
|
69
|
+
let container;
|
|
69
70
|
let defaultOpen;
|
|
70
71
|
let isOpen;
|
|
71
72
|
let label;
|
|
@@ -75,71 +76,73 @@ function ColorPicker$1(t0) {
|
|
|
75
76
|
let t1;
|
|
76
77
|
let t2;
|
|
77
78
|
if ($[0] !== t0) {
|
|
78
|
-
({alpha: t1, children, className, defaultOpen, isDisabled: t2, isOpen, label, onOpenChange, style, ...props$1} = t0);
|
|
79
|
+
({alpha: t1, children, className, container, defaultOpen, isDisabled: t2, isOpen, label, onOpenChange, style, ...props$1} = t0);
|
|
79
80
|
$[0] = t0;
|
|
80
81
|
$[1] = children;
|
|
81
82
|
$[2] = className;
|
|
82
|
-
$[3] =
|
|
83
|
-
$[4] =
|
|
84
|
-
$[5] =
|
|
85
|
-
$[6] =
|
|
86
|
-
$[7] =
|
|
87
|
-
$[8] =
|
|
88
|
-
$[9] =
|
|
89
|
-
$[10] =
|
|
83
|
+
$[3] = container;
|
|
84
|
+
$[4] = defaultOpen;
|
|
85
|
+
$[5] = isOpen;
|
|
86
|
+
$[6] = label;
|
|
87
|
+
$[7] = onOpenChange;
|
|
88
|
+
$[8] = props$1;
|
|
89
|
+
$[9] = style;
|
|
90
|
+
$[10] = t1;
|
|
91
|
+
$[11] = t2;
|
|
90
92
|
} else {
|
|
91
93
|
children = $[1];
|
|
92
94
|
className = $[2];
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
container = $[3];
|
|
96
|
+
defaultOpen = $[4];
|
|
97
|
+
isOpen = $[5];
|
|
98
|
+
label = $[6];
|
|
99
|
+
onOpenChange = $[7];
|
|
100
|
+
props$1 = $[8];
|
|
101
|
+
style = $[9];
|
|
102
|
+
t1 = $[10];
|
|
103
|
+
t2 = $[11];
|
|
101
104
|
}
|
|
102
105
|
const alpha = t1 === void 0 ? false : t1;
|
|
103
106
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
104
107
|
let t3;
|
|
105
|
-
if ($[
|
|
108
|
+
if ($[12] !== className || $[13] !== style) {
|
|
106
109
|
t3 = mergeStatefulStyles(_temp, {
|
|
107
110
|
className,
|
|
108
111
|
style
|
|
109
112
|
});
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
} else t3 = $[
|
|
113
|
+
$[12] = className;
|
|
114
|
+
$[13] = style;
|
|
115
|
+
$[14] = t3;
|
|
116
|
+
} else t3 = $[14];
|
|
114
117
|
let t4;
|
|
115
|
-
if ($[
|
|
118
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
116
119
|
t4 = /* @__PURE__ */ jsx(ColorSwatch$1, { className: "xxk0z11 x2lah0s xvy4d1p" });
|
|
117
|
-
$[
|
|
118
|
-
} else t4 = $[
|
|
120
|
+
$[15] = t4;
|
|
121
|
+
} else t4 = $[15];
|
|
119
122
|
let t5;
|
|
120
|
-
if ($[
|
|
123
|
+
if ($[16] !== isDisabled || $[17] !== label || $[18] !== t3) {
|
|
121
124
|
t5 = /* @__PURE__ */ jsxs(Button, {
|
|
122
125
|
isDisabled,
|
|
123
126
|
...t3,
|
|
124
127
|
children: [t4, label]
|
|
125
128
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
} else t5 = $[
|
|
129
|
+
$[16] = isDisabled;
|
|
130
|
+
$[17] = label;
|
|
131
|
+
$[18] = t3;
|
|
132
|
+
$[19] = t5;
|
|
133
|
+
} else t5 = $[19];
|
|
131
134
|
let t6;
|
|
132
|
-
if ($[
|
|
135
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
133
136
|
t6 = props(overlay.popup, picker.popover);
|
|
134
|
-
$[
|
|
135
|
-
} else t6 = $[
|
|
137
|
+
$[20] = t6;
|
|
138
|
+
} else t6 = $[20];
|
|
136
139
|
let t7;
|
|
137
|
-
if ($[
|
|
140
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
138
141
|
t7 = props(overlay.popupDialog, focus.ring);
|
|
139
|
-
$[
|
|
140
|
-
} else t7 = $[
|
|
142
|
+
$[21] = t7;
|
|
143
|
+
} else t7 = $[21];
|
|
141
144
|
let t8;
|
|
142
|
-
if ($[
|
|
145
|
+
if ($[22] !== alpha || $[23] !== children || $[24] !== label) {
|
|
143
146
|
t8 = children ?? /* @__PURE__ */ jsxs("div", {
|
|
144
147
|
className: "x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li",
|
|
145
148
|
children: [
|
|
@@ -161,49 +164,57 @@ function ColorPicker$1(t0) {
|
|
|
161
164
|
/* @__PURE__ */ jsx(ColorField$1, { label })
|
|
162
165
|
]
|
|
163
166
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else t8 = $[
|
|
167
|
+
$[22] = alpha;
|
|
168
|
+
$[23] = children;
|
|
169
|
+
$[24] = label;
|
|
170
|
+
$[25] = t8;
|
|
171
|
+
} else t8 = $[25];
|
|
169
172
|
let t9;
|
|
170
|
-
if ($[
|
|
171
|
-
t9 = /* @__PURE__ */ jsx(
|
|
172
|
-
...
|
|
173
|
-
children:
|
|
174
|
-
...t7,
|
|
175
|
-
children: t8
|
|
176
|
-
})
|
|
173
|
+
if ($[26] !== t8) {
|
|
174
|
+
t9 = /* @__PURE__ */ jsx(Dialog, {
|
|
175
|
+
...t7,
|
|
176
|
+
children: t8
|
|
177
177
|
});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else t9 = $[
|
|
178
|
+
$[26] = t8;
|
|
179
|
+
$[27] = t9;
|
|
180
|
+
} else t9 = $[27];
|
|
181
181
|
let t10;
|
|
182
|
-
if ($[
|
|
183
|
-
t10 = /* @__PURE__ */
|
|
182
|
+
if ($[28] !== container || $[29] !== t9) {
|
|
183
|
+
t10 = /* @__PURE__ */ jsx(Popover, {
|
|
184
|
+
UNSTABLE_portalContainer: container,
|
|
185
|
+
...t6,
|
|
186
|
+
children: t9
|
|
187
|
+
});
|
|
188
|
+
$[28] = container;
|
|
189
|
+
$[29] = t9;
|
|
190
|
+
$[30] = t10;
|
|
191
|
+
} else t10 = $[30];
|
|
192
|
+
let t11;
|
|
193
|
+
if ($[31] !== defaultOpen || $[32] !== isOpen || $[33] !== onOpenChange || $[34] !== t10 || $[35] !== t5) {
|
|
194
|
+
t11 = /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
184
195
|
defaultOpen,
|
|
185
196
|
isOpen,
|
|
186
197
|
onOpenChange,
|
|
187
|
-
children: [t5,
|
|
198
|
+
children: [t5, t10]
|
|
188
199
|
});
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else
|
|
196
|
-
let
|
|
197
|
-
if ($[
|
|
198
|
-
|
|
200
|
+
$[31] = defaultOpen;
|
|
201
|
+
$[32] = isOpen;
|
|
202
|
+
$[33] = onOpenChange;
|
|
203
|
+
$[34] = t10;
|
|
204
|
+
$[35] = t5;
|
|
205
|
+
$[36] = t11;
|
|
206
|
+
} else t11 = $[36];
|
|
207
|
+
let t12;
|
|
208
|
+
if ($[37] !== props$1 || $[38] !== t11) {
|
|
209
|
+
t12 = /* @__PURE__ */ jsx(ColorPicker, {
|
|
199
210
|
...props$1,
|
|
200
|
-
children:
|
|
211
|
+
children: t11
|
|
201
212
|
});
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
} else
|
|
206
|
-
return
|
|
213
|
+
$[37] = props$1;
|
|
214
|
+
$[38] = t11;
|
|
215
|
+
$[39] = t12;
|
|
216
|
+
} else t12 = $[39];
|
|
217
|
+
return t12;
|
|
207
218
|
}
|
|
208
219
|
function _temp(state) {
|
|
209
220
|
return props(triggerStyles.base, focus.ring, state.isDisabled && triggerStyles.disabled);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","ButtonRenderProps","ColorPickerProps","RACColorPickerProps","stylex","Button","RACButton","ColorPicker","RACColorPicker","Dialog","RACDialog","DialogTrigger","RACDialogTrigger","Popover","RACPopover","focus","mergeStatefulStyles","overlay","picker","colors","radii","spacing","stateLayerOpacity","typography","ColorArea","ColorField","ColorSlider","ColorSwatch","triggerStyles","base","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","$$css","disabled","Omit","alpha","children","className","defaultOpen","isDisabled","isOpen","label","onOpenChange","style","React","CSSProperties","t0","$","_c","props","t1","t2","undefined","t3","_temp","t4","Symbol","for","t5","t6","popup","popover","t7","popupDialog","ring","t8","t9","t10","t11","state"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover } from 'react-aria-components';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport ColorArea from '../color-area';\nimport ColorField from '../color-field';\nimport ColorSlider from '../color-slider';\nimport ColorSwatch from '../color-swatch';\n\n// Everything in this phase, in one control: a swatch and a label as the\n// trigger, and a plane, a hue slider, an alpha slider and a text field on\n// the surface it opens. React Aria's `ColorPicker` renders nothing of its\n// own — it is the state the five share — so what is here is the trigger,\n// the overlay and the arrangement inside it.\n//\n// The design carries no page for a colour picker. What it does carry is the\n// text fields page, which the field inside this one already draws through,\n// and the overlay surface every popover here shares. Three choices are the\n// library's own.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch\n// on its own is a coloured square with no affordance — nothing says it can\n// be pressed, and a screen reader is told a colour rather than an action.\n// The label is what makes it a button.\n//\n// **Hue is a slider rather than a wheel here.** A wheel and the plane want\n// the same space and would make the surface square and large; the strip\n// sits under the plane at the width it already has. `ColorWheel` is for a\n// picker that wants to be round, which is a different shape rather than a\n// different control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the same swap `DatePicker` and `Sheet` make — the shared one in\n// `src/styles/picker.ts` rather than a third copy. A 280dp surface anchored\n// to a trigger is unreachable at 375px.\n//\n// One thing the picker has to do that its parts do not. **The plane and the\n// hue strip are pinned to HSL.** A channel has to belong to the value's own\n// space or React Aria throws, and a hex parses as RGB, which has no\n// saturation — so `<ColorPicker defaultValue=\"#6750A4\" />`, the call anyone\n// writes first, would throw outright. Converting here is what makes the\n// picker take any notation, and it costs the caller nothing: the value\n// handed back is still in whatever they passed.\n\nconst triggerStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xu5m21g x5r8g2b x1vnz5z6\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n disabled: {\n kWkggS: \"x19v6zzp\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n }\n};\ntype ColorPickerProps = Omit<RACColorPickerProps, 'children'> & {\n /** Whether the alpha strip is drawn under the hue one. @default false */\n alpha?: boolean;\n /** Replaces everything on the surface, for a picker that arranges its own parts. */\n children?: ReactNode;\n /** Lands on the trigger, which is the element a layout positions. */\n className?: string;\n /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */\n defaultOpen?: boolean;\n /** Whether the whole picker is inert. @default false */\n isDisabled?: boolean;\n /** Whether the surface is open. Controlled; needs `onOpenChange`. */\n isOpen?: boolean;\n /** What the trigger says beside its swatch. Always rendered; it is the button's name. */\n label: string;\n /** Called when the surface opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Lands on the trigger, as `className` does. */\n style?: React.CSSProperties;\n};\n\n/**\n * A colour picked from a plane, a hue strip and a text field, behind a\n * trigger showing the colour. The value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue`, as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency strip. Above the medium breakpoint the\n * surface is docked to the trigger; below it, it opens centred, the same\n * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach\n * the overlay, since the picker itself carries no open state — React Aria\n * keeps that on the dialog trigger this renders inside.\n *\n * Every part inside is this package's own — `ColorArea`, `ColorSlider`,\n * `ColorField` and `ColorSwatch` — and they share the picker's value\n * through React Aria's context rather than props. Passing `children`\n * replaces all of them, for a picker that wants a different arrangement.\n *\n * The call site's `className` and `style` land on the trigger, which is the\n * element a layout positions.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n className,\n defaultOpen,\n isDisabled = false,\n isOpen,\n label,\n onOpenChange,\n style,\n ...props\n}: ColorPickerProps) {\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled} {...mergeStatefulStyles(\n // A function of the state rather than a fixed class, since the\n // trigger is the element a layout positions and the call site's\n // own class has to merge into it — a plain `className` would\n // overwrite one or the other.\n (state: ButtonRenderProps) => stylex.props(triggerStyles.base, focus.ring, state.isDisabled && triggerStyles.disabled), {\n className,\n style\n })}>\n <ColorSwatch className=\"xxk0z11 x2lah0s xvy4d1p\" />\n {label}\n </RACButton>\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" label=\"Hue\" />\n {alpha ? <ColorSlider channel=\"alpha\" label=\"Alpha\" /> : null}\n <ColorField label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorP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ArB,EAAA;CAAA,OAzBZqB;AAyBY;AArCrB,SAAAd,MAAAe,OAAA;CAAA,OAmBoC/E,MAAawB,cAAaC,MAAOd,MAAK+D,MAAOK,MAAK9B,cAAezB,cAAamB,QAAS;AAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","ButtonRenderProps","ColorPickerProps","RACColorPickerProps","stylex","Button","RACButton","ColorPicker","RACColorPicker","Dialog","RACDialog","DialogTrigger","RACDialogTrigger","Popover","RACPopover","focus","mergeStatefulStyles","overlay","picker","colors","radii","spacing","stateLayerOpacity","typography","ColorArea","ColorField","ColorSlider","ColorSwatch","triggerStyles","base","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","k8WAf4","kg3NbH","$$css","disabled","Omit","alpha","children","className","container","Element","defaultOpen","isDisabled","isOpen","label","onOpenChange","style","React","CSSProperties","t0","$","_c","props","t1","t2","undefined","t3","_temp","t4","Symbol","for","t5","t6","popup","popover","t7","popupDialog","ring","t8","t9","t10","t11","t12","state"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover } from 'react-aria-components';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport ColorArea from '../color-area';\nimport ColorField from '../color-field';\nimport ColorSlider from '../color-slider';\nimport ColorSwatch from '../color-swatch';\n\n// Everything in this phase, in one control: a swatch and a label as the\n// trigger, and a plane, a hue slider, an alpha slider and a text field on\n// the surface it opens. React Aria's `ColorPicker` renders nothing of its\n// own — it is the state the five share — so what is here is the trigger,\n// the overlay and the arrangement inside it.\n//\n// The design carries no page for a colour picker. What it does carry is the\n// text fields page, which the field inside this one already draws through,\n// and the overlay surface every popover here shares. Three choices are the\n// library's own.\n//\n// **The trigger is a swatch beside a name, not a swatch alone.** A swatch\n// on its own is a coloured square with no affordance — nothing says it can\n// be pressed, and a screen reader is told a colour rather than an action.\n// The label is what makes it a button.\n//\n// **Hue is a slider rather than a wheel here.** A wheel and the plane want\n// the same space and would make the surface square and large; the strip\n// sits under the plane at the width it already has. `ColorWheel` is for a\n// picker that wants to be round, which is a different shape rather than a\n// different control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the same swap `DatePicker` and `Sheet` make — the shared one in\n// `src/styles/picker.ts` rather than a third copy. A 280dp surface anchored\n// to a trigger is unreachable at 375px.\n//\n// One thing the picker has to do that its parts do not. **The plane and the\n// hue strip are pinned to HSL.** A channel has to belong to the value's own\n// space or React Aria throws, and a hex parses as RGB, which has no\n// saturation — so `<ColorPicker defaultValue=\"#6750A4\" />`, the call anyone\n// writes first, would throw outright. Converting here is what makes the\n// picker take any notation, and it costs the caller nothing: the value\n// handed back is still in whatever they passed.\n\nconst triggerStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xu5m21g x5r8g2b x1vnz5z6\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n disabled: {\n kWkggS: \"x19v6zzp\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n }\n};\ntype ColorPickerProps = Omit<RACColorPickerProps, 'children'> & {\n /** Whether the alpha strip is drawn under the hue one. @default false */\n alpha?: boolean;\n /** Replaces everything on the surface, for a picker that arranges its own parts. */\n children?: ReactNode;\n /** Lands on the trigger, which is the element a layout positions. */\n className?: string;\n /**\n * Where to portal the surface. Defaults to the end of `<body>`, which is\n * right for an app that sets its StyleX theme on `:root`. An app that\n * scopes the theme to a subtree has to point this at an element inside it,\n * or the surface renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /** Whether the surface starts open. Uncontrolled; pair `isOpen` with `onOpenChange` instead. */\n defaultOpen?: boolean;\n /** Whether the whole picker is inert. @default false */\n isDisabled?: boolean;\n /** Whether the surface is open. Controlled; needs `onOpenChange`. */\n isOpen?: boolean;\n /** What the trigger says beside its swatch. Always rendered; it is the button's name. */\n label: string;\n /** Called when the surface opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Lands on the trigger, as `className` does. */\n style?: React.CSSProperties;\n};\n\n/**\n * A colour picked from a plane, a hue strip and a text field, behind a\n * trigger showing the colour. The value is React Aria's: pass `value` with\n * `onChange` to control it, or `defaultValue`, as a CSS colour string or a\n * `Color` from `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorPicker defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * `alpha` adds the transparency strip. Above the medium breakpoint the\n * surface is docked to the trigger; below it, it opens centred, the same\n * swap `DatePicker` makes. `defaultOpen`, `isOpen` and `onOpenChange` reach\n * the overlay, since the picker itself carries no open state — React Aria\n * keeps that on the dialog trigger this renders inside.\n *\n * Every part inside is this package's own — `ColorArea`, `ColorSlider`,\n * `ColorField` and `ColorSwatch` — and they share the picker's value\n * through React Aria's context rather than props. Passing `children`\n * replaces all of them, for a picker that wants a different arrangement.\n *\n * The call site's `className` and `style` land on the trigger, which is the\n * element a layout positions.\n */\nfunction ColorPicker({\n alpha = false,\n children,\n className,\n container,\n defaultOpen,\n isDisabled = false,\n isOpen,\n label,\n onOpenChange,\n style,\n ...props\n}: ColorPickerProps) {\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled} {...mergeStatefulStyles(\n // A function of the state rather than a fixed class, since the\n // trigger is the element a layout positions and the call site's\n // own class has to merge into it — a plain `className` would\n // overwrite one or the other.\n (state: ButtonRenderProps) => stylex.props(triggerStyles.base, focus.ring, state.isDisabled && triggerStyles.disabled), {\n className,\n style\n })}>\n <ColorSwatch className=\"xxk0z11 x2lah0s xvy4d1p\" />\n {label}\n </RACButton>\n <RACPopover\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" label=\"Hue\" />\n {alpha ? <ColorSlider channel=\"alpha\" label=\"Alpha\" /> : null}\n <ColorField label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\nexport type { ColorPickerProps };\nexport default ColorPicker;"],"mappings":";;;;;;;;;;;;;AAkDA,MAAM4B,gBAAgB;CACpBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ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A3BZsB;AA2BY;AAxCrB,SAAAf,MAAAgB,OAAA;CAAA,OAoBoClF,MAAawB,cAAaC,MAAOd,MAAKiE,MAAOM,MAAK/B,cAAe3B,cAAamB,QAAS;AAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { FieldVariant } from "../../field/index.js";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { DateFieldProps, DateValue } from "react-aria-components";
|
|
3
4
|
//#region src/components/date-field/index.d.ts
|
|
4
|
-
type DateFieldProps$1<T extends DateValue> = Omit<DateFieldProps<T>, 'children' | 'className' | 'style'> & {
|
|
5
|
+
type DateFieldProps$1<T extends DateValue = DateValue> = Omit<DateFieldProps<T>, 'children' | 'className' | 'style'> & {
|
|
5
6
|
/** A function may compute the class from the field's render state. */
|
|
6
7
|
className?: DateFieldProps<T>['className'];
|
|
7
8
|
/** Supporting text under the field. */
|
|
@@ -26,7 +27,7 @@ type DateFieldProps$1<T extends DateValue> = Omit<DateFieldProps<T>, 'children'
|
|
|
26
27
|
* Which of the text fields page's two boxes to draw.
|
|
27
28
|
* @default 'filled'
|
|
28
29
|
*/
|
|
29
|
-
variant?:
|
|
30
|
+
variant?: FieldVariant;
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* A date typed rather than picked: one segment per part, each its own focus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","DateValue","DateFieldProps","RACDateFieldProps","stylex","DateField","RACDateField","DateInput","RACDateInput","FieldBox","FieldMessage","FieldValue","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","Omit","T","className","description","error","floatingLabel","label","leadingIcon","style","trailingIcon","variant","t0","$","_c","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","t8","t9"],"sources":["../../../src/components/date-field/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DateFieldProps as RACDateFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateField as RACDateField, DateInput as RACDateInput } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A date typed a segment at a time, rather than picked from a calendar. The\n// box, label and message are the field chrome in `src/field`, shared with\n// every other field, so a date field on a form is the same box as the text\n// field beside it — which is what the date pickers page means by a date in a\n// text field.\n//\n// Three things are this component's own.\n//\n// **Each segment is its own focus stop, and React Aria decides how many.**\n// The order and the count come from the locale rather than from here: a\n// reader under `I18nProvider` with a British locale gets day before month,\n// and `granularity` of `minute` adds two more. So the segments are rendered\n// from what React Aria hands the input, never written out.\n//\n// **A segment not yet filled is muted, and the field still counts as\n// empty.** The placeholder text is the segment's own — `mm`, `dd`, `yyyy` —\n// and it takes the muted role so a half-typed date reads as half-typed. The\n// floating label stays down until a segment holds a real value.\n//\n// **A focused segment is a filled shape rather than a ring.** A caret cannot\n// show which of three spinbuttons has focus, since React Aria hides it — the\n// segment is what has to say so, and it does it the way a selected row does.\n\ntype DateFieldProps<T extends DateValue> = Omit<RACDateFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACDateFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACDateFieldProps<T>['style'];\n /** An icon at the box's trailing end. */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?:
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","DateValue","DateFieldProps","RACDateFieldProps","stylex","DateField","RACDateField","DateInput","RACDateInput","FieldVariant","FieldBox","FieldMessage","FieldValue","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","Omit","T","className","description","error","floatingLabel","label","leadingIcon","style","trailingIcon","variant","t0","$","_c","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","t8","t9"],"sources":["../../../src/components/date-field/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DateFieldProps as RACDateFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateField as RACDateField, DateInput as RACDateInput } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A date typed a segment at a time, rather than picked from a calendar. The\n// box, label and message are the field chrome in `src/field`, shared with\n// every other field, so a date field on a form is the same box as the text\n// field beside it — which is what the date pickers page means by a date in a\n// text field.\n//\n// Three things are this component's own.\n//\n// **Each segment is its own focus stop, and React Aria decides how many.**\n// The order and the count come from the locale rather than from here: a\n// reader under `I18nProvider` with a British locale gets day before month,\n// and `granularity` of `minute` adds two more. So the segments are rendered\n// from what React Aria hands the input, never written out.\n//\n// **A segment not yet filled is muted, and the field still counts as\n// empty.** The placeholder text is the segment's own — `mm`, `dd`, `yyyy` —\n// and it takes the muted role so a half-typed date reads as half-typed. The\n// floating label stays down until a segment holds a real value.\n//\n// **A focused segment is a filled shape rather than a ring.** A caret cannot\n// show which of three spinbuttons has focus, since React Aria hides it — the\n// segment is what has to say so, and it does it the way a selected row does.\n\ntype DateFieldProps<T extends DateValue = DateValue> = Omit<RACDateFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACDateFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACDateFieldProps<T>['style'];\n /** An icon at the box's trailing end. */\n trailingIcon?: ReactNode;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A date typed rather than picked: one segment per part, each its own focus\n * stop. The value is React Aria's — pass `value` with `onChange` to control\n * it, or `defaultValue` — as an `@internationalized/date` value from this\n * package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateField defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * How many segments there are and what order they come in is the reader's\n * locale, through React Aria's `I18nProvider` — `granularity` adds time\n * segments, and `minValue` and `maxValue` bound what may be typed.\n *\n * The box, label and message are the field chrome in `src/field`, shared\n * with every other field. The call site's `className` and `style` land on\n * the field as a whole, which is the element a layout positions.\n */\nfunction DateField<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: DateFieldProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDateField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys the outlined notch. The box decides\n // populated twice over — in CSS for the label's type, and in React\n // for the notch, since CSS cannot cut an outline to a width it has\n // no way to measure. React Aria renders a hidden\n // `<input type=\"date\">` carrying no placeholder, so the CSS half\n // reads as populated on its own; the React half reads React Aria's\n // input context, which a date field does not provide. Without this\n // the notch stays shut across segments already showing `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldValue>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACDateField>;\n}\nexport type { DateFieldProps };\nexport default DateField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA,SAAAK,YAAAyB,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAwC,MAAA,EAAAV,aAAAC,OAAAC,eAAAS,IAAAC,YAAAC,IAAAV,OAAAC,aAAAE,cAAAC,SAAAO,IAAA,GAAAC,YAAAP;CAGtC,MAAAN,gBAAAS,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAN,UAAAO,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BxB,2BAA2B;CAC9C,MAAAyB,KAAAlC;CAAY,IAAAmC;CAAA,IAAAV,EAAA,OAAAR,OAAA;EAAuCkB,KAAA3B,YAAYS,KAAK;EAACQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAyD,MAAAW,KAAAxB,oBAAoBd,MAAaS,YAAW8B,IAAK,GAAGN,OAAK;CAAC,IAAAO;CAAA,IAAAb,EAAA,OAAAc,OAAAC,IAAA,2BAAA,GAAA;EAW1LF,KAAA,oBAAC,YAAD,EAAA,UACE,oBAAC,WAAD;GAAa,GAAKxC,MAAaa,cAAa8B,KAAM;GAC/C/B,UAAAA;EADU,CAAA,EADJ,CAAA;EAIEe,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAi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ldVariant } from "../../field/index.js";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { DatePickerProps, DateValue } from "react-aria-components";
|
|
3
4
|
//#region src/components/date-picker/index.d.ts
|
|
4
|
-
type DatePickerProps$1<T extends DateValue> = Omit<DatePickerProps<T>, 'children' | 'className' | 'style'> & {
|
|
5
|
+
type DatePickerProps$1<T extends DateValue = DateValue> = Omit<DatePickerProps<T>, 'children' | 'className' | 'style'> & {
|
|
5
6
|
/** A function may compute the class from the picker's render state. */
|
|
6
7
|
className?: DatePickerProps<T>['className'];
|
|
8
|
+
/**
|
|
9
|
+
* Where to portal the calendar. Defaults to the end of `<body>`, which is
|
|
10
|
+
* right for an app that sets its StyleX theme on `:root`. An app that
|
|
11
|
+
* scopes the theme to a subtree has to point this at an element inside it,
|
|
12
|
+
* or the calendar renders outside the theme and falls back to the tokens'
|
|
13
|
+
* `prefers-color-scheme` default.
|
|
14
|
+
*/
|
|
15
|
+
container?: Element;
|
|
7
16
|
/** Supporting text under the field. */
|
|
8
17
|
description?: string;
|
|
9
18
|
/** The message shown instead of the description, which also marks the field invalid. */
|
|
@@ -29,7 +38,7 @@ type DatePickerProps$1<T extends DateValue> = Omit<DatePickerProps<T>, 'children
|
|
|
29
38
|
* Which of the text fields page's two boxes to draw.
|
|
30
39
|
* @default 'filled'
|
|
31
40
|
*/
|
|
32
|
-
variant?:
|
|
41
|
+
variant?: FieldVariant;
|
|
33
42
|
};
|
|
34
43
|
/**
|
|
35
44
|
* A date typed into a field, or picked from a calendar behind a button. The
|
|
@@ -51,7 +60,7 @@ type DatePickerProps$1<T extends DateValue> = Omit<DatePickerProps<T>, 'children
|
|
|
51
60
|
* The call site's `className` and `style` land on the picker as a whole,
|
|
52
61
|
* which is the element a layout positions.
|
|
53
62
|
*/
|
|
54
|
-
declare function DatePicker$1<T extends DateValue>({ description, error, floatingLabel, isDisabled, label, leadingIcon, triggerLabel, variant, ...props }: DatePickerProps$1<T>): import("react").JSX.Element;
|
|
63
|
+
declare function DatePicker$1<T extends DateValue>({ container, description, error, floatingLabel, isDisabled, label, leadingIcon, triggerLabel, variant, ...props }: DatePickerProps$1<T>): import("react").JSX.Element;
|
|
55
64
|
//#endregion
|
|
56
65
|
export { type DatePickerProps$1 as DatePickerProps, DatePicker$1 as default };
|
|
57
66
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -34,8 +34,8 @@ import { Button, DateInput, DatePicker, Dialog, Group, Popover } from "react-ari
|
|
|
34
34
|
* which is the element a layout positions.
|
|
35
35
|
*/
|
|
36
36
|
function DatePicker$1(t0) {
|
|
37
|
-
const $ = c(
|
|
38
|
-
const { description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, triggerLabel: t3, variant: t4, ...props$1 } = t0;
|
|
37
|
+
const $ = c(33);
|
|
38
|
+
const { container, description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, triggerLabel: t3, variant: t4, ...props$1 } = t0;
|
|
39
39
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
40
40
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
41
41
|
const triggerLabel = t3 === void 0 ? "Choose a date" : t3;
|
|
@@ -119,19 +119,27 @@ function DatePicker$1(t0) {
|
|
|
119
119
|
} else t14 = $[17];
|
|
120
120
|
let t15;
|
|
121
121
|
if ($[18] !== label) {
|
|
122
|
-
t15 = /* @__PURE__ */ jsx(
|
|
123
|
-
...
|
|
124
|
-
children: /* @__PURE__ */ jsx(
|
|
125
|
-
...t14,
|
|
126
|
-
children: /* @__PURE__ */ jsx(Calendar$1, { "aria-label": label })
|
|
127
|
-
})
|
|
122
|
+
t15 = /* @__PURE__ */ jsx(Dialog, {
|
|
123
|
+
...t14,
|
|
124
|
+
children: /* @__PURE__ */ jsx(Calendar$1, { "aria-label": label })
|
|
128
125
|
});
|
|
129
126
|
$[18] = label;
|
|
130
127
|
$[19] = t15;
|
|
131
128
|
} else t15 = $[19];
|
|
132
129
|
let t16;
|
|
133
|
-
if ($[20] !==
|
|
134
|
-
t16 = /* @__PURE__ */
|
|
130
|
+
if ($[20] !== container || $[21] !== t15) {
|
|
131
|
+
t16 = /* @__PURE__ */ jsx(Popover, {
|
|
132
|
+
UNSTABLE_portalContainer: container,
|
|
133
|
+
...t13,
|
|
134
|
+
children: t15
|
|
135
|
+
});
|
|
136
|
+
$[20] = container;
|
|
137
|
+
$[21] = t15;
|
|
138
|
+
$[22] = t16;
|
|
139
|
+
} else t16 = $[22];
|
|
140
|
+
let t17;
|
|
141
|
+
if ($[23] !== T0 || $[24] !== isDisabled || $[25] !== props$1 || $[26] !== t11 || $[27] !== t12 || $[28] !== t16 || $[29] !== t5 || $[30] !== t6 || $[31] !== validationBehavior) {
|
|
142
|
+
t17 = /* @__PURE__ */ jsxs(T0, {
|
|
135
143
|
isDisabled,
|
|
136
144
|
isInvalid: t5,
|
|
137
145
|
validationBehavior,
|
|
@@ -140,21 +148,21 @@ function DatePicker$1(t0) {
|
|
|
140
148
|
children: [
|
|
141
149
|
t11,
|
|
142
150
|
t12,
|
|
143
|
-
|
|
151
|
+
t16
|
|
144
152
|
]
|
|
145
153
|
});
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
} else
|
|
157
|
-
return
|
|
154
|
+
$[23] = T0;
|
|
155
|
+
$[24] = isDisabled;
|
|
156
|
+
$[25] = props$1;
|
|
157
|
+
$[26] = t11;
|
|
158
|
+
$[27] = t12;
|
|
159
|
+
$[28] = t16;
|
|
160
|
+
$[29] = t5;
|
|
161
|
+
$[30] = t6;
|
|
162
|
+
$[31] = validationBehavior;
|
|
163
|
+
$[32] = t17;
|
|
164
|
+
} else t17 = $[32];
|
|
165
|
+
return t17;
|
|
158
166
|
}
|
|
159
167
|
//#endregion
|
|
160
168
|
export { DatePicker$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","DateValue","DatePickerProps","RACDatePickerProps","stylex","Button","RACButton","DateInput","RACDateInput","DatePicker","RACDatePicker","Dialog","RACDialog","Group","RACGroup","Popover","RACPopover","FieldBox","FieldMessage","FieldValue","fieldStyles","invalidFrom","useFieldValidationBehavior","CalendarGlyph","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","picker","triggerClassName","Calendar","Omit","T","className","description","error","floatingLabel","label","leadingIcon","style","triggerLabel","variant","t0","$","_c","t1","isDisabled","t2","t3","t4","props","undefined","validationBehavior","T0","t5","t6","root","t7","Symbol","for","group","t8","input","t9","triggerGlyph","t10","t11","t12","t13","popup","popover","t14","popupDialog","ring","t15","t16"],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws and the same swap `Sheet` makes. It is done in\n// CSS rather than by rendering a different tree: a 360dp calendar anchored\n// to a field is unreachable at 375px, and a modal that stayed centred on a\n// desktop would cover a form for no reason. `Sheet` settles this the same\n// way, and doing it twice in two different ways is how the two would drift.\n\ntype DatePickerProps<T extends DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: 'filled' | 'outlined';\n};\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, which is the page's modal picker.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n triggerLabel = 'Choose a date',\n variant = 'filled',\n ...props\n}: DatePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <Calendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAAS,aAAAkC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAyC,MAAA,EAAAV,aAAAC,OAAAC,eAAAS,IAAAC,YAAAC,IAAAV,OAAAC,aAAAE,cAAAQ,IAAAP,SAAAQ,IAAA,GAAAC,YAAAR;CAGvC,MAAAN,gBAAAS,OAAAM,KAAAA,IAAA,OAAAN;CACA,MAAAC,aAAAC,OAAAI,KAAAA,IAAA,QAAAJ;CAGA,MAAAP,eAAA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AAgC;CAAA,IAAAhC,EAAA,QAAAU,MAAAV,EAAA,QAAAG,cAAAH,EAAA,QAAAO,WAAAP,EAAA,QAAAuB,OAAAvB,EAAA,QAAAwB,OAAAxB,EAAA,QAAA+B,OAAA/B,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAS,oBAAA;EA5BVuB,MAAA,qBAAC,IAAD;GAA8B7B;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAAhI,UAAA;IACHW;IAsBAC;IACAO;GAxBiB;;EA6BH/B,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAuB;EAAAvB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA+B;EAAA/B,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAS;EAAAT,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,OA7BXgC;AA6BW"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","DateValue","DatePickerProps","RACDatePickerProps","stylex","Button","RACButton","DateInput","RACDateInput","DatePicker","RACDatePicker","Dialog","RACDialog","Group","RACGroup","Popover","RACPopover","FieldVariant","FieldBox","FieldMessage","FieldValue","fieldStyles","invalidFrom","useFieldValidationBehavior","CalendarGlyph","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","picker","triggerClassName","Calendar","Omit","T","className","container","Element","description","error","floatingLabel","label","leadingIcon","style","triggerLabel","variant","t0","$","_c","t1","isDisabled","t2","t3","t4","props","undefined","validationBehavior","T0","t5","t6","root","t7","Symbol","for","group","t8","input","t9","triggerGlyph","t10","t11","t12","t13","popup","popover","t14","popupDialog","ring","t15","t16","t17"],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws and the same swap `Sheet` makes. It is done in\n// CSS rather than by rendering a different tree: a 360dp calendar anchored\n// to a field is unreachable at 375px, and a modal that stayed centred on a\n// desktop would cover a form for no reason. `Sheet` settles this the same\n// way, and doing it twice in two different ways is how the two would drift.\n\ntype DatePickerProps<T extends DateValue = DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /**\n * Where to portal the calendar. Defaults to the end of `<body>`, which is\n * right for an app that sets its StyleX theme on `:root`. An app that\n * scopes the theme to a subtree has to point this at an element inside it,\n * or the calendar renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /** Supporting text under the field. */\n description?: string;\n /** The message shown instead of the description, which also marks the field invalid. */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /** An icon at the box's leading end. */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * @default 'Choose a date'\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, which is the page's modal picker.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n triggerLabel = 'Choose a date',\n variant = 'filled',\n ...props\n}: DatePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated label={label} leading={leadingIcon} variant={variant}>\n <FieldValue>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>\n </RACGroup>\n </FieldValue>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.popup, picker.popover)}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <Calendar aria-label={label} />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,SAAAS,aAAAqC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAyC,MAAA,EAAAZ,WAAAE,aAAAC,OAAAC,eAAAS,IAAAC,YAAAC,IAAAV,OAAAC,aAAAE,cAAAQ,IAAAP,SAAAQ,IAAA,GAAAC,YAAAR;CAIvC,MAAAN,gBAAAS,OAAAM,KAAAA,IAAA,OAAAN;CACA,MAAAC,aAAAC,OAAAI,KAAAA,IAAA,QAAAJ;CAGA,MAAAP,eAAAQ,OAAAG,KAAAA,IAAA,kBAAAH;CACA,MAAAP,UAAAQ,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BjC,2BAA2B;CAC9C,MAAAkC,KAAA/C;CAAa,IAAAgD;CAAA,IAAAX,EAAA,OAAAR,OAAA;EAAuCmB,KAAApC,YAAYiB,KAAK;EAACQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAyD,MAAAY,KAAA/B,oBAAoBxB,MA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,OAAAxB,EAAA,QAAAgC,OAAAhC,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAS,oBAAA;EA9BVwB,MAAA,qBAAC,IAAD;GAA8B9B;GAAuB,WAAAQ;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAAhI,UAAA;IACHW;IAsBAC;IACAQ;GAxBiB;;EA+BHhC,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAuB;EAAAvB,EAAA,MAAAwB;EAAAxB,EAAA,MAAAgC;EAAAhC,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAS;EAAAT,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OA/BXiC;AA+BW"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { FieldVariant } from "../../field/index.js";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { DateRangePickerProps, DateValue } from "react-aria-components";
|
|
3
4
|
//#region src/components/date-range-picker/index.d.ts
|
|
4
|
-
type DateRangePickerProps$1<T extends DateValue> = {
|
|
5
|
+
type DateRangePickerProps$1<T extends DateValue = DateValue> = {
|
|
5
6
|
/** A function may compute the class from the picker's render state. */
|
|
6
7
|
className?: DateRangePickerProps<T>['className'];
|
|
8
|
+
/**
|
|
9
|
+
* Where to portal the calendar. Defaults to the end of `<body>`, which is
|
|
10
|
+
* right for an app that sets its StyleX theme on `:root`. An app that
|
|
11
|
+
* scopes the theme to a subtree has to point this at an element inside it,
|
|
12
|
+
* or the calendar renders outside the theme and falls back to the tokens'
|
|
13
|
+
* `prefers-color-scheme` default.
|
|
14
|
+
*/
|
|
15
|
+
container?: Element;
|
|
7
16
|
/** Supporting text under the field. */
|
|
8
17
|
description?: string;
|
|
9
18
|
/** The message shown instead of the description, which also marks the field invalid. */
|
|
@@ -35,7 +44,7 @@ type DateRangePickerProps$1<T extends DateValue> = {
|
|
|
35
44
|
* Which of the text fields page's two boxes to draw.
|
|
36
45
|
* @default 'filled'
|
|
37
46
|
*/
|
|
38
|
-
variant?:
|
|
47
|
+
variant?: FieldVariant;
|
|
39
48
|
} & Omit<DateRangePickerProps<T>, 'children' | 'className' | 'style'>;
|
|
40
49
|
/**
|
|
41
50
|
* A date range typed into a field, or picked from a calendar behind a
|
|
@@ -63,7 +72,7 @@ type DateRangePickerProps$1<T extends DateValue> = {
|
|
|
63
72
|
* The call site's `className` and `style` land on the picker as a whole,
|
|
64
73
|
* which is the element a layout positions.
|
|
65
74
|
*/
|
|
66
|
-
declare function DateRangePicker$1<T extends DateValue>({ description, error, floatingLabel, isDisabled, label, leadingIcon, separator, triggerLabel, variant, ...props }: DateRangePickerProps$1<T>): import("react").JSX.Element;
|
|
75
|
+
declare function DateRangePicker$1<T extends DateValue>({ container, description, error, floatingLabel, isDisabled, label, leadingIcon, separator, triggerLabel, variant, ...props }: DateRangePickerProps$1<T>): import("react").JSX.Element;
|
|
67
76
|
//#endregion
|
|
68
77
|
export { type DateRangePickerProps$1 as DateRangePickerProps, DateRangePicker$1 as default };
|
|
69
78
|
//# sourceMappingURL=index.d.ts.map
|