@kanso-labs/kanso-ui 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -9
- package/dist/button/context.js +7 -0
- package/dist/button/context.js.map +1 -0
- package/dist/button/group.js +25 -0
- package/dist/button/group.js.map +1 -0
- package/dist/button/hooks.js +81 -0
- package/dist/button/hooks.js.map +1 -0
- package/dist/button/index.d.ts +11 -0
- package/dist/button/index.js +273 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/styles.js +23 -0
- package/dist/button/styles.js.map +1 -0
- package/dist/calendar/index.js +473 -7
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +132 -4
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/index.js +74 -9
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +78 -4
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/index.js +12 -9
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/styles.js +21 -2
- package/dist/collection/styles.js.map +1 -1
- package/dist/color-scheme.d.ts +29 -0
- package/dist/color-scheme.js +32 -0
- package/dist/color-scheme.js.map +1 -0
- package/dist/components/avatar/index.js +35 -22
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +40 -0
- package/dist/components/badge/index.js +102 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -1
- package/dist/components/breadcrumbs/index.js +1 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.d.ts +58 -14
- package/dist/components/button/index.js +400 -147
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +54 -0
- package/dist/components/button-group/index.js +272 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +9 -1
- package/dist/components/calendar/index.js +71 -44
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +4 -4
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +15 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +1 -0
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +55 -8
- package/dist/components/chip/index.js +174 -63
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +16 -7
- package/dist/components/chip-group/index.js +58 -35
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-field/index.js +25 -23
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.js +42 -31
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.d.ts +1 -1
- package/dist/components/color-swatch-picker/index.js +17 -13
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +5 -3
- package/dist/components/combo-box/index.js +63 -58
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +7 -6
- package/dist/components/copy-field/index.js +92 -90
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +8 -7
- package/dist/components/currency/index.js +43 -65
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/date-field/index.js +24 -22
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +10 -2
- package/dist/components/date-picker/index.js +76 -69
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +10 -2
- package/dist/components/date-range-picker/index.js +93 -86
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +2 -2
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +1 -1
- package/dist/components/disclosure/index.js +6 -6
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +72 -0
- package/dist/components/fab/index.js +89 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/fab-menu/index.d.ts +90 -0
- package/dist/components/fab-menu/index.js +297 -0
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/components/feed/index.d.ts +2 -1
- package/dist/components/feed/index.js +1 -1
- package/dist/components/feed/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +11 -8
- package/dist/components/icon-button/index.js +244 -181
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +30 -21
- package/dist/components/list/index.d.ts +15 -13
- package/dist/components/list/index.js +60 -61
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +3 -2
- package/dist/components/list-box/index.js +16 -16
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +3 -2
- package/dist/components/menu/index.js +2 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +50 -0
- package/dist/components/navigation-bar/index.js +129 -0
- package/dist/components/navigation-bar/index.js.map +1 -0
- package/dist/components/navigation-rail/index.d.ts +59 -0
- package/dist/components/navigation-rail/index.js +166 -0
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/navigation-tree/index.d.ts +1 -5
- package/dist/components/navigation-tree/index.js +3 -3
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +6 -4
- package/dist/components/number-field/index.js +84 -84
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.js +22 -11
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +7 -1
- package/dist/components/range-calendar/index.js +71 -44
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +2 -1
- package/dist/components/search-field/index.js +24 -25
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +79 -0
- package/dist/components/search-view/index.js +255 -0
- package/dist/components/search-view/index.js.map +1 -0
- package/dist/components/segmented-button/index.d.ts +2 -2
- package/dist/components/segmented-button/index.js +60 -31
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/sheet/index.js +2 -2
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +2 -2
- package/dist/components/snackbar/index.js +28 -13
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.d.ts +83 -0
- package/dist/components/split-button/index.js +341 -0
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/switch/index.js +11 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.d.ts +11 -9
- package/dist/components/table/index.js +87 -31
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +35 -4
- package/dist/components/tabs/index.js +403 -93
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tag/index.d.ts +1 -1
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +7 -5
- package/dist/components/text-area/index.js +28 -26
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +7 -5
- package/dist/components/text-field/index.js +28 -26
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.js +24 -22
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +7 -9
- package/dist/components/tree/index.js +15 -16
- package/dist/components/tree/index.js.map +1 -1
- package/dist/drag/index.js.map +1 -1
- package/dist/drag/styles.js +4 -1
- package/dist/drag/styles.js.map +1 -1
- package/dist/fab/styles.js +161 -0
- package/dist/fab/styles.js.map +1 -0
- package/dist/field/index.js +260 -214
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +10 -2
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js +55 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useRipple.js +199 -162
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/hooks/useToggleGroupDisabled.js +24 -0
- package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
- package/dist/i18n/index.js +43 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/messages.js +387 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +31 -21
- package/dist/index.js +25 -16
- package/dist/navigation/context.js +7 -0
- package/dist/navigation/context.js.map +1 -0
- package/dist/navigation/index.d.ts +28 -0
- package/dist/navigation/index.js +96 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/styles.js +312 -0
- package/dist/navigation/styles.js.map +1 -0
- package/dist/react-aria.d.ts +2 -2
- package/dist/react-aria.js +2 -2
- package/dist/render/useRender.js +0 -1
- package/dist/render/useRender.js.map +1 -1
- package/dist/row/styles.js +33 -11
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/icon-button.js +9 -1
- package/dist/styles/icon-button.js.map +1 -1
- package/dist/styles/overlay.js +1 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/picker.js +1 -1
- package/dist/styles/picker.js.map +1 -1
- package/dist/styles.css +1104 -336
- package/dist/tokens/design.tokens.stylex.js +42 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/dist/tokens.css +166 -53
- package/package.json +9 -5
|
@@ -29,7 +29,7 @@ import { DateInput, TimeField } from "react-aria-components";
|
|
|
29
29
|
* on the field as a whole, which is the element a layout positions.
|
|
30
30
|
*/
|
|
31
31
|
function TimeField$1(t0) {
|
|
32
|
-
const $ = c(
|
|
32
|
+
const $ = c(22);
|
|
33
33
|
const { description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, trailingIcon, variant: t3, ...props$1 } = t0;
|
|
34
34
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
35
35
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
@@ -52,10 +52,11 @@ function TimeField$1(t0) {
|
|
|
52
52
|
$[2] = t6;
|
|
53
53
|
} else t6 = $[2];
|
|
54
54
|
let t7;
|
|
55
|
-
if ($[3] !== floatingLabel || $[4] !== label || $[5] !== leadingIcon || $[6] !==
|
|
55
|
+
if ($[3] !== floatingLabel || $[4] !== label || $[5] !== leadingIcon || $[6] !== props$1.isRequired || $[7] !== trailingIcon || $[8] !== variant) {
|
|
56
56
|
t7 = /* @__PURE__ */ jsx(FieldBox, {
|
|
57
57
|
floatingLabel,
|
|
58
58
|
isPopulated: true,
|
|
59
|
+
isRequired: props$1.isRequired,
|
|
59
60
|
label,
|
|
60
61
|
leading: leadingIcon,
|
|
61
62
|
trailing: trailingIcon,
|
|
@@ -65,22 +66,23 @@ function TimeField$1(t0) {
|
|
|
65
66
|
$[3] = floatingLabel;
|
|
66
67
|
$[4] = label;
|
|
67
68
|
$[5] = leadingIcon;
|
|
68
|
-
$[6] =
|
|
69
|
-
$[7] =
|
|
70
|
-
$[8] =
|
|
71
|
-
|
|
69
|
+
$[6] = props$1.isRequired;
|
|
70
|
+
$[7] = trailingIcon;
|
|
71
|
+
$[8] = variant;
|
|
72
|
+
$[9] = t7;
|
|
73
|
+
} else t7 = $[9];
|
|
72
74
|
let t8;
|
|
73
|
-
if ($[
|
|
75
|
+
if ($[10] !== description || $[11] !== error) {
|
|
74
76
|
t8 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
75
77
|
description,
|
|
76
78
|
error
|
|
77
79
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
} else t8 = $[
|
|
80
|
+
$[10] = description;
|
|
81
|
+
$[11] = error;
|
|
82
|
+
$[12] = t8;
|
|
83
|
+
} else t8 = $[12];
|
|
82
84
|
let t9;
|
|
83
|
-
if ($[
|
|
85
|
+
if ($[13] !== T0 || $[14] !== isDisabled || $[15] !== props$1 || $[16] !== t4 || $[17] !== t5 || $[18] !== t7 || $[19] !== t8 || $[20] !== validationBehavior) {
|
|
84
86
|
t9 = /* @__PURE__ */ jsxs(T0, {
|
|
85
87
|
isDisabled,
|
|
86
88
|
isInvalid: t4,
|
|
@@ -89,16 +91,16 @@ function TimeField$1(t0) {
|
|
|
89
91
|
...t5,
|
|
90
92
|
children: [t7, t8]
|
|
91
93
|
});
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
} else t9 = $[
|
|
94
|
+
$[13] = T0;
|
|
95
|
+
$[14] = isDisabled;
|
|
96
|
+
$[15] = props$1;
|
|
97
|
+
$[16] = t4;
|
|
98
|
+
$[17] = t5;
|
|
99
|
+
$[18] = t7;
|
|
100
|
+
$[19] = t8;
|
|
101
|
+
$[20] = validationBehavior;
|
|
102
|
+
$[21] = t9;
|
|
103
|
+
} else t9 = $[21];
|
|
102
104
|
return t9;
|
|
103
105
|
}
|
|
104
106
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TimeFieldProps","RACTimeFieldProps","TimeValue","stylex","DateInput","RACDateInput","TimeField","RACTimeField","FieldVariant","FieldBox","FieldMessage","FieldSegments","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","Omit","T","className","description","error","floatingLabel","label","leadingIcon","style","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","t8","t9","TimeField","_c","props","RACTimeField","stylex.props","RACDateInput"],"sources":["../../../src/components/time-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, TimeValue } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, TimeField as RACTimeField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } 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 time typed a segment at a time. Every part of it is DateField's, from\n// `src/segments` — the segment treatment, the muted placeholder, the filled\n// focus and the punctuation between — so a time on a form and a date on the\n// same form cannot come apart.\n//\n// What differs is the value it holds and nothing else. The time pickers page\n// gives its input the text field's own box, which is what the shared field\n// chrome already draws, so there is no measurement here that the date field's\n// comment does not already name.\n//\n// **Twelve or twenty-four hours is the reader's locale, not a prop.** React\n// Aria decides from the locale whether there is a day-period segment at all,\n// so a field under `I18nProvider` with `en-GB` shows a 24-hour clock and the\n// same field under `en-US` shows AM and PM. Nothing here overrides it, and\n// `hourCycle` is React Aria's own for a page that has to.\n\ntype TimeFieldProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\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 /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\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 time 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 a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimeField defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * Whether it shows a twelve or twenty-four hour clock is the reader's\n * locale, through React Aria's `I18nProvider`. `granularity` takes it down\n * to seconds, and `minValue` and `maxValue` bound what may be typed.\n *\n * The segments are `DateField`'s, and the box, label and message are the\n * field chrome in `src/field`. The call site's `className` and `style` land\n * on the field as a whole, which is the element a layout positions.\n */\nfunction TimeField<T extends TimeValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimeFieldProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason DateField's own comment gives: the\n // box reads an `<input>` to decide, and a segmented field has none —\n // its segments hold the value's line from the first render.\n isPopulated label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACTimeField>;\n}\nexport type { TimeFieldProps };\nexport default TimeField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAAU,YAAAuB,IAAA;CAAA,MAAAC,IAAAjC,EAAA,EAAA;CAAwC,MAAA,EAAAwB,aAAAC,OAAAC,eAAAQ,IAAAC,YAAAC,IAAAT,OAAAC,aAAAE,cAAAC,SAAAM,IAAA,GAAAC,YAAAN;CAGtC,MAAAN,gBAAAQ,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAL,UAAAM,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BvB,2BAA2B;CAC9C,MAAAwB,KAAA/B;CAAY,IAAAgC;CAAA,IAAAT,EAAA,OAAAR,OAAA;EAAuCiB,KAAA1B,YAAYS,KAAK;EAACQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAyD,MAAAU,KAAAvB,oBAAoBd,MAAaS,YAAW6B,IAAK,GAAGN,OAAK;CAAC,IAAAO;CAAA,IAAAZ,EAAA,OAAAa,OAAAC,IAAA,2BAAA,GAAA;EAM1LF,KAAA,oBAAC,eAAD,EAAA,UACE,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TimeFieldProps","RACTimeFieldProps","TimeValue","stylex","DateInput","RACDateInput","TimeField","RACTimeField","FieldVariant","FieldBox","FieldMessage","FieldSegments","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","mergeStatefulStyles","Omit","T","className","description","error","floatingLabel","label","leadingIcon","style","trailingIcon","variant","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","Symbol","for","input","t7","isRequired","t8","t9","TimeField","_c","props","RACTimeField","stylex.props","RACDateInput"],"sources":["../../../src/components/time-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, TimeValue } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, TimeField as RACTimeField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } 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 time typed a segment at a time. Every part of it is DateField's, from\n// `src/segments` — the segment treatment, the muted placeholder, the filled\n// focus and the punctuation between — so a time on a form and a date on the\n// same form cannot come apart.\n//\n// What differs is the value it holds and nothing else. The time pickers page\n// gives its input the text field's own box, which is what the shared field\n// chrome already draws, so there is no measurement here that the date field's\n// comment does not already name.\n//\n// **Twelve or twenty-four hours is the reader's locale, not a prop.** React\n// Aria decides from the locale whether there is a day-period segment at all,\n// so a field under `I18nProvider` with `en-GB` shows a 24-hour clock and the\n// same field under `en-US` shows AM and PM. Nothing here overrides it, and\n// `hourCycle` is React Aria's own for a page that has to.\n\ntype TimeFieldProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\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 /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * An icon at the box's trailing end, in the page's 24dp size. An icon\n * drawn in `em` takes that size from the slot.\n */\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 time 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 a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimeField defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * Whether it shows a twelve or twenty-four hour clock is the reader's\n * locale, through React Aria's `I18nProvider`. `granularity` takes it down\n * to seconds, and `minValue` and `maxValue` bound what may be typed.\n *\n * The segments are `DateField`'s, and the box, label and message are the\n * field chrome in `src/field`. The call site's `className` and `style` land\n * on the field as a whole, which is the element a layout positions.\n */\nfunction TimeField<T extends TimeValue>({\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimeFieldProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason DateField's own comment gives: the\n // box reads an `<input>` to decide, and a segmented field has none —\n // its segments hold the value's line from the first render.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACTimeField>;\n}\nexport type { TimeFieldProps };\nexport default TimeField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAAU,YAAAuB,IAAA;CAAA,MAAAC,IAAAjC,EAAA,EAAA;CAAwC,MAAA,EAAAwB,aAAAC,OAAAC,eAAAQ,IAAAC,YAAAC,IAAAT,OAAAC,aAAAE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AAS,EAAA,QAAAR,OAAA;EACX0B,KAAA,oBAAC,cAAD;GAA2B3B;GAAoBC;EAAK,CAAA;EAAIQ,EAAA,MAAAT;EAAAS,EAAA,MAAAR;EAAAQ,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAQ,MAAAR,EAAA,QAAAE,cAAAF,EAAA,QAAAK,WAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAgB,MAAAhB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAO,oBAAA;EAZrDY,KAAA,qBAAC,IAAD;GAA6BjB;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA/H,UAAA,CACHM,IAWAE,EAZgB;;EAaHlB,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAO;EAAAP,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAbVmB;AAaU"}
|
|
@@ -2,10 +2,6 @@ import { ReactNode, RefAttributes } from "react";
|
|
|
2
2
|
import { TreeItemProps, TreeLoadMoreItemProps, TreeProps, TreeSection } from "react-aria-components";
|
|
3
3
|
//#region src/components/tree/index.d.ts
|
|
4
4
|
type RACTreeSectionProps<T> = Parameters<typeof TreeSection<T>>[0];
|
|
5
|
-
type TreeHeaderProps = {
|
|
6
|
-
/** The section's heading. */
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
};
|
|
9
5
|
type TreeItemProps$1<T extends object = object> = Omit<TreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & TreeItemText & {
|
|
10
6
|
/** The rows nested under this one, as further `Tree.Item` entries. */
|
|
11
7
|
children?: ReactNode;
|
|
@@ -35,22 +31,24 @@ type TreeLoadMoreProps = Omit<TreeLoadMoreItemProps, 'children'> & {
|
|
|
35
31
|
/**
|
|
36
32
|
* What the row says while it is loading. Read by a screen reader; the ring
|
|
37
33
|
* itself carries no text.
|
|
38
|
-
*
|
|
34
|
+
* Left out, it is the word for it in the I18nProvider's locale — "Loading
|
|
35
|
+
* more" in English.
|
|
39
36
|
*/
|
|
40
37
|
label?: string;
|
|
41
38
|
};
|
|
42
|
-
type TreeProps$1<T extends object = object> =
|
|
39
|
+
type TreeProps$1<T extends object = object> = {
|
|
43
40
|
/** A function may compute the class from the tree's render state. */
|
|
44
41
|
className?: TreeProps<T>['className'];
|
|
45
42
|
/**
|
|
46
43
|
* What each row's selection checkbox is called, for a screen reader. The
|
|
47
44
|
* row's own text is what names the row; this names the box inside it.
|
|
48
|
-
*
|
|
45
|
+
* Left out, React Aria names it in the reader's locale — "Select" in
|
|
46
|
+
* English.
|
|
49
47
|
*/
|
|
50
48
|
selectLabel?: string;
|
|
51
49
|
/** A function may compute the style from the tree's render state. */
|
|
52
50
|
style?: TreeProps<T>['style'];
|
|
53
|
-
}
|
|
51
|
+
} & Omit<TreeProps<T>, 'className' | 'style'>;
|
|
54
52
|
type TreeSectionProps<T extends object = object> = Omit<RACTreeSectionProps<T>, 'children'> & {
|
|
55
53
|
/**
|
|
56
54
|
* The rows in the section. A section built from data puts React Aria's
|
|
@@ -112,5 +110,5 @@ declare function TreeLoadMore({ label, ...props }: TreeLoadMoreProps): import("r
|
|
|
112
110
|
*/
|
|
113
111
|
declare function TreeSection$1<T extends object = object>({ children, header, ...props }: TreeSectionProps<T>): import("react").JSX.Element;
|
|
114
112
|
//#endregion
|
|
115
|
-
export {
|
|
113
|
+
export { TreeItem$1 as TreeItem, type TreeItemProps$1 as TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps$1 as TreeProps, TreeSection$1 as TreeSection, type TreeSectionProps, Tree$1 as default };
|
|
116
114
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,14 +6,14 @@ import { focus } from "../../styles/focus.js";
|
|
|
6
6
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
7
7
|
import Checkbox from "../checkbox/index.js";
|
|
8
8
|
import { CollectionLoadMore } from "../../collection/index.js";
|
|
9
|
-
import { collectionStyles, rowItemStyles } from "../../collection/styles.js";
|
|
9
|
+
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
10
10
|
import { RowContent } from "../../row/index.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { createContext, useContext } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Button, Tree, TreeHeader, TreeItem, TreeItemContent, TreeLoadMoreItem, TreeSection } from "react-aria-components";
|
|
15
15
|
//#region src/components/tree/index.tsx
|
|
16
|
-
const SelectLabelContext = createContext(
|
|
16
|
+
const SelectLabelContext = createContext(void 0);
|
|
17
17
|
const styles = {
|
|
18
18
|
chevron: {
|
|
19
19
|
kGNEyG: "x6s0dn4",
|
|
@@ -43,8 +43,8 @@ function chevronFor(state) {
|
|
|
43
43
|
className: chevronClassName,
|
|
44
44
|
slot: "chevron",
|
|
45
45
|
children: /* @__PURE__ */ jsx(ChevronEndGlyph, { ...{
|
|
46
|
-
0: { className: "x12w9bfk xxk0z11 xvy4d1p
|
|
47
|
-
1: { className: "x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7
|
|
46
|
+
0: { className: "x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7" },
|
|
47
|
+
1: { className: "x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl" }
|
|
48
48
|
}[!!state.isExpanded << 0] })
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -108,13 +108,12 @@ function Tree$1(t0) {
|
|
|
108
108
|
let t2;
|
|
109
109
|
let t3;
|
|
110
110
|
if ($[0] !== t0) {
|
|
111
|
-
const { selectLabel
|
|
112
|
-
const selectLabel = t4 === void 0 ? "Select" : t4;
|
|
111
|
+
const { selectLabel, ...props } = t0;
|
|
113
112
|
T1 = SelectLabelContext;
|
|
114
113
|
t3 = selectLabel;
|
|
115
114
|
T0 = Tree;
|
|
116
|
-
t1 = props
|
|
117
|
-
t2 = mergeStatefulStyles(
|
|
115
|
+
t1 = props;
|
|
116
|
+
t2 = mergeStatefulStyles(containerClasses, props);
|
|
118
117
|
$[0] = t0;
|
|
119
118
|
$[1] = T0;
|
|
120
119
|
$[2] = T1;
|
|
@@ -264,11 +263,11 @@ function TreeLoadMore(t0) {
|
|
|
264
263
|
let t1;
|
|
265
264
|
let t2;
|
|
266
265
|
if ($[0] !== t0) {
|
|
267
|
-
const { label: t3, ...props$
|
|
268
|
-
label = t3
|
|
266
|
+
const { label: t3, ...props$2 } = t0;
|
|
267
|
+
label = t3;
|
|
269
268
|
T0 = TreeLoadMoreItem;
|
|
270
|
-
t1 = props$
|
|
271
|
-
t2 = mergeStatefulStyles(props(collectionStyles.loading), props$
|
|
269
|
+
t1 = props$2;
|
|
270
|
+
t2 = mergeStatefulStyles(props(collectionStyles.loading), props$2);
|
|
272
271
|
$[0] = t0;
|
|
273
272
|
$[1] = T0;
|
|
274
273
|
$[2] = label;
|
|
@@ -315,12 +314,12 @@ function TreeSection$1(t0) {
|
|
|
315
314
|
let t1;
|
|
316
315
|
let t2;
|
|
317
316
|
if ($[0] !== t0) {
|
|
318
|
-
const { children: t3, header: t4, ...props$
|
|
317
|
+
const { children: t3, header: t4, ...props$1 } = t0;
|
|
319
318
|
children = t3;
|
|
320
319
|
header = t4;
|
|
321
320
|
T0 = TreeSection;
|
|
322
|
-
t1 = props$
|
|
323
|
-
t2 = mergeStyles(props(collectionStyles.section), props$
|
|
321
|
+
t1 = props$1;
|
|
322
|
+
t2 = mergeStyles(props(collectionStyles.section), props$1);
|
|
324
323
|
$[0] = t0;
|
|
325
324
|
$[1] = T0;
|
|
326
325
|
$[2] = children;
|
|
@@ -360,6 +359,6 @@ Tree$1.Item = TreeItem$1;
|
|
|
360
359
|
Tree$1.LoadMore = TreeLoadMore;
|
|
361
360
|
Tree$1.Section = TreeSection$1;
|
|
362
361
|
//#endregion
|
|
363
|
-
export { Tree$1 as default };
|
|
362
|
+
export { TreeItem$1 as TreeItem, TreeLoadMore, TreeSection$1 as TreeSection, Tree$1 as default };
|
|
364
363
|
|
|
365
364
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TreeItemProps","RACTreeItemProps","TreeLoadMoreItemProps","RACTreeLoadMoreItemProps","TreeProps","RACTreeProps","TreeItemRenderProps","stylex","createContext","useContext","Button","RACButton","Tree","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","TreeItemContent","RACTreeItemContent","TreeLoadMoreItem","RACTreeLoadMoreItem","TreeSection","RACTreeSection","CollectionLoadMore","collectionStyles","rowItemStyles","ChevronEndGlyph","useRipple","RowContent","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","Checkbox","RACTreeSectionProps","Parameters","T","SelectLabelContext","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","TreeHeaderProps","children","Omit","TreeItemText","className","leading","style","supporting","trailing","headline","textValue","TreeLoadMoreProps","label","selectLabel","TreeSectionProps","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isSelected","leadingFor","selects","selectionBehavior","selectionMode","textValueFor","undefined","t0","$","T0","T1","t1","t2","t3","t4","container","t5","Symbol","for","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","handlers","surface","t6","t7","TreeLoadMore","loading","section","Item","LoadMore","Section","stylex.props","RACButton","Tree","_c","props","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","RACTreeItemContent","RACTreeLoadMoreItem","TreeSection","RACTreeSection"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TreeItemProps as RACTreeItemProps, TreeLoadMoreItemProps as RACTreeLoadMoreItemProps, TreeProps as RACTreeProps, TreeItemRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tree as RACTree, TreeHeader as RACTreeHeader, TreeItem as RACTreeItem, TreeItemContent as RACTreeItemContent, TreeLoadMoreItem as RACTreeLoadMoreItem, TreeSection as RACTreeSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, rowItemStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// A list whose rows nest. Each row is the row every list here draws —\n// `src/row`, shared with ListItem, ListBox, List and Disclosure — so its\n// 56dp floor, body-large headline, body-medium supporting line, state layers\n// and disabled treatment are that module's, and a tree beside a list cannot\n// drift from it.\n//\n// The lists page gives no nesting: it draws one flat list. So the two things\n// a tree adds beyond that row are the library's own, and both are written\n// here with their reasons. The rest — the row, the selection colours, the\n// checkbox — is the page's, through the shared module.\n//\n// Four things are this component's own.\n//\n// **A level indents by one chevron's width.** React Aria puts the depth on\n// each row as a custom property, so the inset is one `calc` against the\n// row's own inline padding rather than a style per level. 24dp is the size\n// the menus page gives that glyph, which makes a level of nesting exactly as\n// wide as the caret that opens it.\n//\n// **The caret is a button, and React Aria names it.** A `slot=\"chevron\"`\n// button is what expands and collapses; React Aria labels it Expand or\n// Collapse and composes that with the row, so nothing here names it. It is\n// drawn only on a row that has children, since a caret on a leaf says the\n// row opens when it does not.\n//\n// **A selecting tree draws a checkbox, before whatever the row was given.**\n// Same rule as List: React Aria reports the mode on each row, so a tree that\n// toggles draws one without the call site repeating it, and it always sits\n// in the same place so a column of rows reads down.\n//\n// **`TreeItemContent` has no class to style.** React Aria renders it as a\n// `display: contents` gridcell with nothing on it, so the row's own layout\n// is drawn by what goes inside rather than by that wrapper.\n\n// `TreeSection`'s props are not re-exported from the package index, only its\n// component is — so the type is taken off the component rather than imported\n// by a name that is not there to import.\ntype RACTreeSectionProps<T> = Parameters<typeof RACTreeSection<T>>[0];\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the tree's decision and repeating it per row is\n// how the two drift.\nconst SelectLabelContext = createContext('Select');\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype TreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype TreeItemProps<T extends object = object> = Omit<RACTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & TreeItemText & {\n /** The rows nested under this one, as further `Tree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACTreeItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACTreeItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as a count or a control. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a tree row wraps\n// its headline in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string headline is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype TreeItemText = {\n /** The row's headline — the one thing it is mostly about. */\n headline: string;\n /** What typeahead matches the row on. Defaults to the headline. */\n textValue?: string;\n} | {\n /** The row's headline, as something other than a plain string. */\n headline?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype TreeLoadMoreProps = Omit<RACTreeLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype TreeProps<T extends object = object> = Omit<RACTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACTreeProps<T>['className'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * @default 'Select'\n */\n selectLabel?: string;\n /** A function may compute the style from the tree's render state. */\n style?: RACTreeProps<T>['style'];\n};\ntype TreeSectionProps<T extends object = object> = Omit<RACTreeSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its headline lines up with\n// the headline of a sibling that opens.\nfunction chevronFor(state: TreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then the selection checkbox, then whatever the row was given — one order,\n// always, which is what keeps a column of rows reading down.\nfunction itemContent(headline: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string, ripple: ReactNode) {\n return (state: TreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leadingFor(state, leading, selectLabel)} supporting={supporting} trailing={trailing}>\n {headline}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The caret, the selection checkbox, then whatever the row was given. Its\n * return type is written out rather than inferred: `ReactNode` is a union\n * that includes a promise, and a function inferred as returning one has to\n * be `async`.\n */\nfunction leadingFor(state: TreeItemRenderProps, leading: ReactNode, selectLabel: string): ReactNode {\n const selects = state.selectionBehavior === 'toggle' && state.selectionMode !== 'none';\n return <>\n {chevronFor(state)}\n {selects ? <Checkbox aria-label={selectLabel} slot=\"selection\" /> : null}\n {leading}\n </>;\n}\n\n// What React Aria matches typeahead on, and what names the row. `TreeItemText`\n// makes one of the two a string, so the last branch is unreachable through the\n// public type — it is there because destructuring the two apart is what loses\n// the narrowing, not because a row can arrive without either.\nfunction textValueFor(textValue: string | undefined, headline: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof headline === 'string' ? headline : '';\n}\n\n/**\n * A list whose rows nest. Which rows are open is React Aria's: pass\n * `expandedKeys` with `onExpandedChange` to control it, or\n * `defaultExpandedKeys` to let it keep its own. Selection is React Aria's\n * too — set `selectionMode` to `single` or `multiple`.\n *\n * ```tsx\n * <Tree aria-label=\"Label\">\n * <Tree.Item headline=\"First item\" id=\"first\">\n * <Tree.Item headline=\"Second item\" id=\"second\" />\n * </Tree.Item>\n * </Tree>\n * ```\n *\n * Each row is the row every list here draws, indented by its depth, with a\n * caret on the rows that have children. Name the tree with `aria-label` or\n * `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction Tree<T extends object>({\n selectLabel = 'Select',\n ...props\n}: RefAttributes<HTMLDivElement> & TreeProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />\n </SelectLabelContext>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction TreeHeader({\n children\n}: TreeHeaderProps) {\n return <RACTreeHeader {...stylex.props(collectionStyles.header)}>\n {children}\n </RACTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Its slots are the row's: `leading`, the\n * `headline`, `supporting` under it, and `trailing`. Give every row an `id`\n * — that is the key selection and expansion are reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret. `textValue` is what typeahead matches on, and is\n * taken from a plain-string headline when it is not given.\n */\nfunction TreeItem<T extends object = object>({\n children,\n headline,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: TreeItemProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACTreeItem<T> textValue={textValueFor(textValue, headline)} {...ripple.handlers} {...props} {...mergeStatefulStyles(\n // No overline: a tree row takes the list variant's metrics because it\n // looks like a list row, but it follows its own page, and that page\n // gives a headline and a supporting line. The three-line item belongs\n // to the lists page, which `List.Item` and `ListBox.Item` draw.\n rowItemStyles(supporting, undefined, styles.indent), props)}>\n <RACTreeItemContent>\n {itemContent(headline, leading, supporting, trailing, selectLabel, ripple.surface)}\n </RACTreeItemContent>\n {children}\n </RACTreeItem>;\n}\n\n/**\n * The row the tree shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction TreeLoadMore({\n label = 'Loading more',\n ...props\n}: TreeLoadMoreProps) {\n return <RACTreeLoadMoreItem {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore label={label} size=\"24px\" />\n </RACTreeLoadMoreItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction TreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: TreeSectionProps<T>) {\n return <RACTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <TreeHeader>{header}</TreeHeader>}\n {children}\n </RACTreeSection>;\n}\nTree.Item = TreeItem;\nTree.LoadMore = TreeLoadMore;\nTree.Section = TreeSection;\nexport type { TreeHeaderProps, TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps };\nexport default Tree;"],"mappings":";;;;;;;;;;;;;;;AA4DA,MAAM6C,qBAAqBjC,cAAc,QAAQ;AACjD,MAAMkC,SAAS;CACbC,SA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AAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAHZM;AAGY;AAErBtF,OAAKuG,OAAOnG;AACZJ,OAAKwG,WAAWJ;AAChBpG,OAAKyG,UAAU/F"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TreeItemProps","RACTreeItemProps","TreeLoadMoreItemProps","RACTreeLoadMoreItemProps","TreeProps","RACTreeProps","TreeItemRenderProps","stylex","createContext","useContext","Button","RACButton","Tree","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","TreeItemContent","RACTreeItemContent","TreeLoadMoreItem","RACTreeLoadMoreItem","TreeSection","RACTreeSection","CollectionLoadMore","collectionStyles","containerClasses","rowItemStyles","ChevronEndGlyph","useRipple","RowContent","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","Checkbox","RACTreeSectionProps","Parameters","T","SelectLabelContext","undefined","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","TreeHeaderProps","children","Omit","TreeItemText","className","leading","style","supporting","trailing","headline","textValue","TreeLoadMoreProps","label","selectLabel","TreeSectionProps","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isSelected","leadingFor","selects","selectionBehavior","selectionMode","textValueFor","t0","$","T0","T1","t1","t2","t3","t4","t5","Symbol","for","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","handlers","surface","t6","t7","TreeLoadMore","loading","section","Item","LoadMore","Section","stylex.props","RACButton","Tree","_c","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","RACTreeItemContent","props","RACTreeLoadMoreItem","TreeSection","RACTreeSection"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TreeItemProps as RACTreeItemProps, TreeLoadMoreItemProps as RACTreeLoadMoreItemProps, TreeProps as RACTreeProps, TreeItemRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tree as RACTree, TreeHeader as RACTreeHeader, TreeItem as RACTreeItem, TreeItemContent as RACTreeItemContent, TreeLoadMoreItem as RACTreeLoadMoreItem, TreeSection as RACTreeSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, containerClasses, rowItemStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// A list whose rows nest. Each row is the row every list here draws —\n// `src/row`, shared with ListItem, ListBox, List and Disclosure — so its\n// 56dp floor, body-large headline, body-medium supporting line, state layers\n// and disabled treatment are that module's, and a tree beside a list cannot\n// drift from it.\n//\n// The lists page gives no nesting: it draws one flat list. So the two things\n// a tree adds beyond that row are the library's own, and both are written\n// here with their reasons. The rest — the row, the selection colours, the\n// checkbox — is the page's, through the shared module.\n//\n// Four things are this component's own.\n//\n// **A level indents by one chevron's width.** React Aria puts the depth on\n// each row as a custom property, so the inset is one `calc` against the\n// row's own inline padding rather than a style per level. 24dp is the size\n// the menus page gives that glyph, which makes a level of nesting exactly as\n// wide as the caret that opens it.\n//\n// **The caret is a button, and React Aria names it.** A `slot=\"chevron\"`\n// button is what expands and collapses; React Aria labels it Expand or\n// Collapse and composes that with the row, so nothing here names it. It is\n// drawn only on a row that has children, since a caret on a leaf says the\n// row opens when it does not.\n//\n// **A selecting tree draws a checkbox, before whatever the row was given.**\n// Same rule as List: React Aria reports the mode on each row, so a tree that\n// toggles draws one without the call site repeating it, and it always sits\n// in the same place so a column of rows reads down.\n//\n// **`TreeItemContent` has no class to style.** React Aria renders it as a\n// `display: contents` gridcell with nothing on it, so the row's own layout\n// is drawn by what goes inside rather than by that wrapper.\n\n// `TreeSection`'s props are not re-exported from the package index, only its\n// component is — so the type is taken off the component rather than imported\n// by a name that is not there to import.\ntype RACTreeSectionProps<T> = Parameters<typeof RACTreeSection<T>>[0];\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the tree's decision and repeating it per row is\n// how the two drift. Undefined unless the tree is given one, which leaves\n// the name React Aria gives in the reader's locale.\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype TreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype TreeItemProps<T extends object = object> = Omit<RACTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & TreeItemText & {\n /** The rows nested under this one, as further `Tree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACTreeItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACTreeItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as a count or a control. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a tree row wraps\n// its headline in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string headline is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype TreeItemText = {\n /** The row's headline — the one thing it is mostly about. */\n headline: string;\n /** What typeahead matches the row on. Defaults to the headline. */\n textValue?: string;\n} | {\n /** The row's headline, as something other than a plain string. */\n headline?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype TreeLoadMoreProps = Omit<RACTreeLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TreeProps<T extends object = object> = {\n /** A function may compute the class from the tree's render state. */\n className?: RACTreeProps<T>['className'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /** A function may compute the style from the tree's render state. */\n style?: RACTreeProps<T>['style'];\n} & Omit<RACTreeProps<T>, 'className' | 'style'>;\ntype TreeSectionProps<T extends object = object> = Omit<RACTreeSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its headline lines up with\n// the headline of a sibling that opens.\nfunction chevronFor(state: TreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then the selection checkbox, then whatever the row was given — one order,\n// always, which is what keeps a column of rows reading down.\nfunction itemContent(headline: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string | undefined, ripple: ReactNode) {\n return (state: TreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leadingFor(state, leading, selectLabel)} supporting={supporting} trailing={trailing}>\n {headline}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The caret, the selection checkbox, then whatever the row was given. Its\n * return type is written out rather than inferred: `ReactNode` is a union\n * that includes a promise, and a function inferred as returning one has to\n * be `async`.\n */\nfunction leadingFor(state: TreeItemRenderProps, leading: ReactNode, selectLabel: string | undefined): ReactNode {\n const selects = state.selectionBehavior === 'toggle' && state.selectionMode !== 'none';\n return <>\n {chevronFor(state)}\n {selects ? <Checkbox aria-label={selectLabel} slot=\"selection\" /> : null}\n {leading}\n </>;\n}\n\n// What React Aria matches typeahead on, and what names the row. `TreeItemText`\n// makes one of the two a string, so the last branch is unreachable through the\n// public type — it is there because destructuring the two apart is what loses\n// the narrowing, not because a row can arrive without either.\nfunction textValueFor(textValue: string | undefined, headline: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof headline === 'string' ? headline : '';\n}\n\n/**\n * A list whose rows nest. Which rows are open is React Aria's: pass\n * `expandedKeys` with `onExpandedChange` to control it, or\n * `defaultExpandedKeys` to let it keep its own. Selection is React Aria's\n * too — set `selectionMode` to `single` or `multiple`.\n *\n * ```tsx\n * <Tree aria-label=\"Label\">\n * <Tree.Item headline=\"First item\" id=\"first\">\n * <Tree.Item headline=\"Second item\" id=\"second\" />\n * </Tree.Item>\n * </Tree>\n * ```\n *\n * Each row is the row every list here draws, indented by its depth, with a\n * caret on the rows that have children. Name the tree with `aria-label` or\n * `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction Tree<T extends object>({\n selectLabel,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACTree<T> {...props} {...mergeStatefulStyles(containerClasses, props)} />\n </SelectLabelContext>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction TreeHeader({\n children\n}: TreeHeaderProps) {\n return <RACTreeHeader {...stylex.props(collectionStyles.header)}>\n {children}\n </RACTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Its slots are the row's: `leading`, the\n * `headline`, `supporting` under it, and `trailing`. Give every row an `id`\n * — that is the key selection and expansion are reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret. `textValue` is what typeahead matches on, and is\n * taken from a plain-string headline when it is not given.\n */\nfunction TreeItem<T extends object = object>({\n children,\n headline,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: TreeItemProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACTreeItem<T> textValue={textValueFor(textValue, headline)} {...ripple.handlers} {...props} {...mergeStatefulStyles(\n // No overline: a tree row takes the list variant's metrics because it\n // looks like a list row, but it follows its own page, and that page\n // gives a headline and a supporting line. The three-line item belongs\n // to the lists page, which `List.Item` and `ListBox.Item` draw.\n rowItemStyles(supporting, undefined, styles.indent), props)}>\n <RACTreeItemContent>\n {itemContent(headline, leading, supporting, trailing, selectLabel, ripple.surface)}\n </RACTreeItemContent>\n {children}\n </RACTreeItem>;\n}\n\n/**\n * The row the tree shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction TreeLoadMore({\n label,\n ...props\n}: TreeLoadMoreProps) {\n return <RACTreeLoadMoreItem {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore label={label} size=\"24px\" />\n </RACTreeLoadMoreItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction TreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: TreeSectionProps<T>) {\n return <RACTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <TreeHeader>{header}</TreeHeader>}\n {children}\n </RACTreeSection>;\n}\nTree.Item = TreeItem;\nTree.LoadMore = TreeLoadMore;\nTree.Section = TreeSection;\nexport type { TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps };\nexport { TreeItem, TreeLoadMore, TreeSection };\nexport default Tree;"],"mappings":";;;;;;;;;;;;;;;AA6DA,MAAM8C,qBAAqBlC,cAAkCmC,KAAAA,CAAS;AACtE,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EAC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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DropTarget","DropIndicator","RACDropIndicator","indicatorClassName","t0","$","_c","target","t1","DropIndicator","_c","RACDropIndicator"],"sources":["../../src/drag/index.tsx"],"sourcesContent":["import type { DropTarget } from 'react-aria-components'\n\nimport { DropIndicator as RACDropIndicator } from 'react-aria-components'\n\nimport { indicatorClassName } from './styles'\n\n// What drag and drop looks like across the four collections that do it —\n// List, ListBox, Table and Tree. React Aria supplies the behaviour through\n// `useDragAndDrop` and renders an unstyled line between items; what is here\n// is the line and the preview, and a wrapper that makes both the default so\n// a call site gets them without wiring either.\n//\n// Apart from `src/components` because it is shared internals rather than a\n// component: a directory there is a public component with stories, a barrel\n// entry and a `styling.test.tsx` case, and this has none of the three. The\n// one name it does put on the public surface is `useDragAndDrop`, which\n// `src/react-aria.ts` exports in place of React Aria's own.\n//\n//
|
|
1
|
+
{"version":3,"file":"index.js","names":["DropTarget","DropIndicator","RACDropIndicator","indicatorClassName","t0","$","_c","target","t1","DropIndicator","_c","RACDropIndicator"],"sources":["../../src/drag/index.tsx"],"sourcesContent":["import type { DropTarget } from 'react-aria-components'\n\nimport { DropIndicator as RACDropIndicator } from 'react-aria-components'\n\nimport { indicatorClassName } from './styles'\n\n// What drag and drop looks like across the four collections that do it —\n// List, ListBox, Table and Tree. React Aria supplies the behaviour through\n// `useDragAndDrop` and renders an unstyled line between items; what is here\n// is the line and the preview, and a wrapper that makes both the default so\n// a call site gets them without wiring either.\n//\n// Apart from `src/components` because it is shared internals rather than a\n// component: a directory there is a public component with stories, a barrel\n// entry and a `styling.test.tsx` case, and this has none of the three. The\n// one name it does put on the public surface is `useDragAndDrop`, which\n// `src/react-aria.ts` exports in place of React Aria's own.\n//\n// The lists page draws one part of a drag: the dragged row, lifted to\n// elevation 4 under a pressed layer, which the row a drag started from takes\n// as `dragging` in `src/row` — in List, ListBox and Tree through\n// `rowItemStyles`, and in Table's own row. Three things are this library's\n// own, since no page draws them.\n//\n// **The line between two items is the primary role, 2dp.** It is the same\n// weight and colour a focus ring takes, which is the nearest thing the\n// system has to \"this is where the thing you are moving will land\".\n//\n// **A row or a whole collection a drop lands on draws that line around\n// itself**, as an outline inside its edges over a primary layer at the hover\n// opacity — `dropTarget` in `src/row` and in `src/collection`, which Table's\n// own row and box take too.\n//\n// **The preview is the row's own type on a raised surface.** A drag preview\n// that looked nothing like the row it came from would read as a second\n// thing rather than as the row in transit.\n\n/**\n * The line that shows where a dragged item would land. Rendered by\n * {@link useDragAndDrop} rather than by a call site, which is why it takes\n * React Aria's target rather than props of its own.\n */\nfunction DropIndicator({ target }: { target: DropTarget }) {\n return <RACDropIndicator className={indicatorClassName} target={target} />\n}\n\nexport { DropIndicator }\n"],"mappings":";;;;;;;;;;AA0CA,SAAAC,gBAAAG,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAuB,MAAA,EAAAC,WAAAH;CAAkC,IAAAI;CAAA,IAAAH,EAAA,OAAAE,QAAA;EAChDC,KAAA,oBAACG,eAAD;GAA6BR,WAAAA;GAA4BI;EAAM,CAAA;EAAIF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAAnEG;AAAmE"}
|
package/dist/drag/styles.js
CHANGED
|
@@ -13,6 +13,9 @@ const dragStyles = {
|
|
|
13
13
|
},
|
|
14
14
|
indicatorActive: {
|
|
15
15
|
kWkggS: "xnety89",
|
|
16
|
+
kLZC3w: "x4hsqty",
|
|
17
|
+
kPef9Z: "x4z998w",
|
|
18
|
+
kEafiO: "x7sdbh0",
|
|
16
19
|
$$css: true
|
|
17
20
|
},
|
|
18
21
|
preview: {
|
|
@@ -37,7 +40,7 @@ const dragStyles = {
|
|
|
37
40
|
function indicatorClassName(state) {
|
|
38
41
|
return {
|
|
39
42
|
0: { className: "xjbqb8w x36qwtl x1dkaolv x9f619 x16sahtb x1t137rt x1n2onr6 x1vjfegm" },
|
|
40
|
-
1: { className: "x36qwtl x1dkaolv x9f619 x16sahtb x1t137rt x1n2onr6 x1vjfegm xnety89" }
|
|
43
|
+
1: { className: "x36qwtl x1dkaolv x9f619 x16sahtb x1t137rt x1n2onr6 x1vjfegm xnety89 x4hsqty x4z998w x7sdbh0" }
|
|
41
44
|
}[!!state.isDropTarget << 0].className ?? "";
|
|
42
45
|
}
|
|
43
46
|
//#endregion
|
package/dist/drag/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["stylex","colors","radii","spacing","typography","dragStyles","indicator","kWkggS","kZKoxP","kaIpWk","kB7OPa","kqGvvJ","k3XXqK","kVAEAm","kY2c9j","$$css","indicatorActive","preview","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","ks0D6T","kVQacm","k8WAf4","kg3NbH","kg5iWk","khDVqt","indicatorClassName","state","isDropTarget","className"],"sources":["../../src/drag/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../tokens/design.tokens.stylex';\n\n// Apart from ./index.tsx so that file exports components alone, which is what\n// keeps fast refresh working for it — the same arrangement `src/row` uses.\n//
|
|
1
|
+
{"version":3,"file":"styles.js","names":["stylex","colors","radii","spacing","typography","FORCED_COLORS","dragStyles","indicator","kWkggS","kZKoxP","kaIpWk","kB7OPa","kqGvvJ","k3XXqK","kVAEAm","kY2c9j","$$css","indicatorActive","kLZC3w","kPef9Z","kEafiO","preview","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","ks0D6T","kVQacm","k8WAf4","kg3NbH","kg5iWk","khDVqt","indicatorClassName","state","isDropTarget","className"],"sources":["../../src/drag/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../tokens/design.tokens.stylex';\n\n// Apart from ./index.tsx so that file exports components alone, which is what\n// keeps fast refresh working for it — the same arrangement `src/row` uses.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst dragStyles = {\n indicator: {\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x36qwtl\",\n kaIpWk: \"x1dkaolv\",\n kB7OPa: \"x9f619\",\n kqGvvJ: \"x16sahtb\",\n k3XXqK: \"x1t137rt\",\n kVAEAm: \"x1n2onr6\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n indicatorActive: {\n kWkggS: \"xnety89\",\n kLZC3w: \"x4hsqty\",\n kPef9Z: \"x4z998w\",\n kEafiO: \"x7sdbh0\",\n $$css: true\n },\n preview: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"x1xdvaa9\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n ks0D6T: \"x1va8c73\",\n kVQacm: \"xb3r6kr\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n }\n};\n\n// The line's classes, from React Aria's own render state.\nfunction indicatorClassName(state: {\n isDropTarget: boolean;\n}) {\n return {\n 0: {\n className: \"xjbqb8w x36qwtl x1dkaolv x9f619 x16sahtb x1t137rt x1n2onr6 x1vjfegm\"\n },\n 1: {\n className: \"x36qwtl x1dkaolv x9f619 x16sahtb x1t137rt x1n2onr6 x1vjfegm xnety89 x4hsqty x4z998w x7sdbh0\"\n }\n }[!!state.isDropTarget << 0].className ?? '';\n}\nexport { dragStyles, indicatorClassName };"],"mappings":";AAYA,MAAMM,aAAa;CACjBC,WAAW;EACTC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfT,QAAQ;EACRU,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,SAAS;EACPb,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRjB,OAAO;CACT;AACF;AAGA,SAASkB,mBAAmBC,OAEzB;CACD,OAAO;EACL,GAAG,EACDE,WAAW,sEACb;EACA,GAAG,EACDA,WAAW,8FACb;CACF,EAAE,CAAC,CAACF,MAAMC,gBAAgB,EAAE,CAACC,aAAa;AAC5C"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region src/fab/styles.ts
|
|
2
|
+
const fabStyles = {
|
|
3
|
+
base: {
|
|
4
|
+
kGNEyG: "x6s0dn4",
|
|
5
|
+
kVAM5u: "x1ylmb6m",
|
|
6
|
+
ksu8eU: "xx61lck",
|
|
7
|
+
kMzoRj: "xc342km x13rsnn2",
|
|
8
|
+
kGVxlE: "x1udv5rz",
|
|
9
|
+
kB7OPa: "x9f619",
|
|
10
|
+
kkrTdU: "x1ypdohk",
|
|
11
|
+
k1xSpc: "x3nfvp2",
|
|
12
|
+
kmuXW: "x2lah0s",
|
|
13
|
+
kjj79g: "xl56j7k",
|
|
14
|
+
kmVPX3: "x1717udv",
|
|
15
|
+
kVAEAm: "x1n2onr6",
|
|
16
|
+
kybGjl: "x1hl2dhg",
|
|
17
|
+
$$css: true
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
kWkggS: "xepofeg",
|
|
21
|
+
kKwaWg: "x18o3ruo",
|
|
22
|
+
kVAM5u: "xmnqt3w",
|
|
23
|
+
kGVxlE: "x1gnnqk1",
|
|
24
|
+
kMwMTN: "x1xj74d8 x1bhcspo",
|
|
25
|
+
kkrTdU: "x1h6gzvc",
|
|
26
|
+
$$css: true
|
|
27
|
+
},
|
|
28
|
+
focused: {
|
|
29
|
+
kKwaWg: "x17vw94z",
|
|
30
|
+
$$css: true
|
|
31
|
+
},
|
|
32
|
+
hovered: {
|
|
33
|
+
kKwaWg: "xbmfk57",
|
|
34
|
+
kGVxlE: "x4r79n0",
|
|
35
|
+
$$css: true
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
kGNEyG: "x6s0dn4",
|
|
39
|
+
k1xSpc: "x3nfvp2",
|
|
40
|
+
kmuXW: "x2lah0s",
|
|
41
|
+
kjj79g: "xl56j7k",
|
|
42
|
+
$$css: true
|
|
43
|
+
},
|
|
44
|
+
pressed: {
|
|
45
|
+
kKwaWg: "xdiex0u",
|
|
46
|
+
kGVxlE: "x1udv5rz",
|
|
47
|
+
$$css: true
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const fabSizes = {
|
|
51
|
+
lg: {
|
|
52
|
+
kZKoxP: "xwzfr38",
|
|
53
|
+
kaIpWk: "x1m3ak92",
|
|
54
|
+
kzqmXN: "x1dmp6jm",
|
|
55
|
+
$$css: true
|
|
56
|
+
},
|
|
57
|
+
md: {
|
|
58
|
+
kZKoxP: "xs1ryiz",
|
|
59
|
+
kaIpWk: "xhpdng0",
|
|
60
|
+
kzqmXN: "x1fh0d6s",
|
|
61
|
+
$$css: true
|
|
62
|
+
},
|
|
63
|
+
xl: {
|
|
64
|
+
kZKoxP: "x1xaimp3",
|
|
65
|
+
kaIpWk: "x19pkqky",
|
|
66
|
+
kzqmXN: "xszbqgh",
|
|
67
|
+
$$css: true
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const extendedFabSizes = {
|
|
71
|
+
lg: {
|
|
72
|
+
kZKoxP: "xwzfr38",
|
|
73
|
+
kaIpWk: "x1m3ak92",
|
|
74
|
+
kMv6JI: "xdy5w5q",
|
|
75
|
+
kGuDYH: "xete2z3",
|
|
76
|
+
k63SB2: "x14ijtet",
|
|
77
|
+
kOIVth: "x1gka490",
|
|
78
|
+
kb6lSQ: "xug9e1u",
|
|
79
|
+
kLWn49: "x2divse",
|
|
80
|
+
kg3NbH: "xr244g7",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
83
|
+
md: {
|
|
84
|
+
kZKoxP: "xs1ryiz",
|
|
85
|
+
kaIpWk: "xhpdng0",
|
|
86
|
+
kMv6JI: "x46eyla",
|
|
87
|
+
kGuDYH: "x5ehqhr",
|
|
88
|
+
k63SB2: "xrf6cl6",
|
|
89
|
+
kOIVth: "x126z3so",
|
|
90
|
+
kb6lSQ: "x1g135zh",
|
|
91
|
+
kLWn49: "x1ggk5va",
|
|
92
|
+
kg3NbH: "x790zyz",
|
|
93
|
+
$$css: true
|
|
94
|
+
},
|
|
95
|
+
xl: {
|
|
96
|
+
kZKoxP: "x1xaimp3",
|
|
97
|
+
kaIpWk: "x19pkqky",
|
|
98
|
+
kMv6JI: "x1fz0g89",
|
|
99
|
+
kGuDYH: "xkb6epg",
|
|
100
|
+
k63SB2: "x76yrz5",
|
|
101
|
+
kOIVth: "xxj4525",
|
|
102
|
+
kb6lSQ: "x1s1qhaa",
|
|
103
|
+
kLWn49: "x1voeury",
|
|
104
|
+
kg3NbH: "x1pbfunf",
|
|
105
|
+
$$css: true
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const fabIconSizes = {
|
|
109
|
+
lg: {
|
|
110
|
+
kGuDYH: "xneq65o",
|
|
111
|
+
$$css: true
|
|
112
|
+
},
|
|
113
|
+
md: {
|
|
114
|
+
kGuDYH: "x1pvqxga",
|
|
115
|
+
$$css: true
|
|
116
|
+
},
|
|
117
|
+
xl: {
|
|
118
|
+
kGuDYH: "xqozcyj",
|
|
119
|
+
$$css: true
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const fabTones = {
|
|
123
|
+
filled: {
|
|
124
|
+
primary: {
|
|
125
|
+
kWkggS: "xnety89",
|
|
126
|
+
kMwMTN: "xwjo7ld",
|
|
127
|
+
$$css: true
|
|
128
|
+
},
|
|
129
|
+
secondary: {
|
|
130
|
+
kWkggS: "x167r6xl",
|
|
131
|
+
kMwMTN: "x1lba3jz",
|
|
132
|
+
$$css: true
|
|
133
|
+
},
|
|
134
|
+
tertiary: {
|
|
135
|
+
kWkggS: "x14t7u9f",
|
|
136
|
+
kMwMTN: "x1007ibn",
|
|
137
|
+
$$css: true
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
tonal: {
|
|
141
|
+
primary: {
|
|
142
|
+
kWkggS: "xp89om9",
|
|
143
|
+
kMwMTN: "xscdzaa",
|
|
144
|
+
$$css: true
|
|
145
|
+
},
|
|
146
|
+
secondary: {
|
|
147
|
+
kWkggS: "x15dekr4",
|
|
148
|
+
kMwMTN: "x1sawysd",
|
|
149
|
+
$$css: true
|
|
150
|
+
},
|
|
151
|
+
tertiary: {
|
|
152
|
+
kWkggS: "xs6yvni",
|
|
153
|
+
kMwMTN: "x3cbcwg",
|
|
154
|
+
$$css: true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
export { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":["stylex","colors","radii","shadows","sizing","spacing","stateLayerOpacity","typography","FORCED_COLORS","MEDIUM_SIZE","MEDIUM_CORNER","fabStyles","base","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kGVxlE","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","kVAEAm","kybGjl","$$css","disabled","kWkggS","kKwaWg","kMwMTN","focused","hovered","icon","pressed","fabSizes","lg","kZKoxP","kaIpWk","kzqmXN","md","xl","extendedFabSizes","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kg3NbH","fabIconSizes","tonal","primary","secondary","tertiary","filled","fabTones"],"sources":["../../src/fab/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The FAB's styles, shared by Fab and by the FAB that opens FabMenu, which is\n// the same button until its menu opens. Apart from either component, and\n// outside `src/components`, for the reason src/row gives. See Fab's header\n// for the values and where they come from.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The medium FAB's container and corner, between the steps of the control\n// and radius scales.\nconst MEDIUM_SIZE = '80px';\nconst MEDIUM_CORNER = '20px';\nconst fabStyles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kGVxlE: \"x1udv5rz\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n $$css: true\n },\n disabled: {\n kWkggS: \"xepofeg\",\n kKwaWg: \"x18o3ruo\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n focused: {\n kKwaWg: \"x17vw94z\",\n $$css: true\n },\n hovered: {\n kKwaWg: \"xbmfk57\",\n kGVxlE: \"x4r79n0\",\n $$css: true\n },\n icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n pressed: {\n kKwaWg: \"xdiex0u\",\n kGVxlE: \"x1udv5rz\",\n $$css: true\n }\n};\n\n// The FAB on its own: a square of the size's edge, at its corner.\nconst fabSizes = {\n lg: {\n kZKoxP: \"xwzfr38\",\n kaIpWk: \"x1m3ak92\",\n kzqmXN: \"x1dmp6jm\",\n $$css: true\n },\n md: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"xhpdng0\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n xl: {\n kZKoxP: \"x1xaimp3\",\n kaIpWk: \"x19pkqky\",\n kzqmXN: \"xszbqgh\",\n $$css: true\n }\n};\n\n// The extended form: the size's height and corner, with its padding, the gap\n// before the label and the label's type role.\nconst extendedFabSizes = {\n lg: {\n kZKoxP: \"xwzfr38\",\n kaIpWk: \"x1m3ak92\",\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kOIVth: \"x1gka490\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n kg3NbH: \"xr244g7\",\n $$css: true\n },\n md: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"xhpdng0\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n xl: {\n kZKoxP: \"x1xaimp3\",\n kaIpWk: \"x19pkqky\",\n kMv6JI: \"x1fz0g89\",\n kGuDYH: \"xkb6epg\",\n k63SB2: \"x76yrz5\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"x1s1qhaa\",\n kLWn49: \"x1voeury\",\n kg3NbH: \"x1pbfunf\",\n $$css: true\n }\n};\n\n// The icon each size draws.\nconst fabIconSizes = {\n lg: {\n kGuDYH: \"xneq65o\",\n $$css: true\n },\n md: {\n kGuDYH: \"x1pvqxga\",\n $$css: true\n },\n xl: {\n kGuDYH: \"xqozcyj\",\n $$css: true\n }\n};\n\n// The six colour pairs: each tone's container pair, and the tone itself.\nconst tonal = {\n primary: {\n kWkggS: \"xp89om9\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n },\n secondary: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tertiary: {\n kWkggS: \"xs6yvni\",\n kMwMTN: \"x3cbcwg\",\n $$css: true\n }\n};\nconst filled = {\n primary: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n secondary: {\n kWkggS: \"x167r6xl\",\n kMwMTN: \"x1lba3jz\",\n $$css: true\n },\n tertiary: {\n kWkggS: \"x14t7u9f\",\n kMwMTN: \"x1007ibn\",\n $$css: true\n }\n};\nconst fabTones = {\n filled,\n tonal\n};\nexport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones };"],"mappings":";AAmBA,MAAMW,YAAY;CAChBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRf,QAAQ;EACRG,QAAQ;EACRa,QAAQ;EACRX,QAAQ;EACRO,OAAO;CACT;CACAK,SAAS;EACPF,QAAQ;EACRH,OAAO;CACT;CACAM,SAAS;EACPH,QAAQ;EACRZ,QAAQ;EACRS,OAAO;CACT;CACAO,MAAM;EACJpB,QAAQ;EACRO,QAAQ;EAC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