@kanso-labs/kanso-ui 0.35.0 → 0.36.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 +88 -9
- 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 +260 -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 +29 -2
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +30 -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/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 +37 -0
- package/dist/components/badge/index.js +97 -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 +418 -148
- package/dist/components/button/index.js.map +1 -1
- 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-group/index.js +1 -0
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.js +2 -8
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +3 -3
- package/dist/components/chip-group/index.js +8 -9
- 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.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 +209 -177
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +26 -20
- package/dist/components/list/index.d.ts +15 -13
- package/dist/components/list/index.js +62 -63
- 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 +8 -8
- 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 +11 -10
- 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/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +2 -2
- 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/table/index.d.ts +11 -9
- package/dist/components/table/index.js +68 -29
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +79 -23
- 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 +11 -12
- package/dist/components/tree/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 +19 -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/i18n/index.js +42 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/messages.js +353 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +27 -20
- package/dist/index.js +22 -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 +18 -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 +870 -360
- package/dist/tokens/design.tokens.stylex.js +18 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/dist/tokens.css +166 -53
- package/package.json +8 -4
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
3
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
4
4
|
import { CloseGlyph } from "../../glyphs/index.js";
|
|
5
|
-
import { focus } from "../../styles/focus.js";
|
|
6
5
|
import { invalidFrom } from "../../field/root.js";
|
|
7
6
|
import { groupStyles } from "../../field/styles.js";
|
|
8
7
|
import { FieldLabel, FieldMessage } from "../../field/index.js";
|
|
9
8
|
import { chipStyles } from "../../chip/styles.js";
|
|
10
|
-
import { chipGlyph, chipLabel } from "../../chip/index.js";
|
|
9
|
+
import { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName } from "../../chip/index.js";
|
|
11
10
|
import { textOf } from "../../collection/text.js";
|
|
12
11
|
import { c } from "react/compiler-runtime";
|
|
13
12
|
import { createContext, useContext } from "react";
|
|
@@ -20,8 +19,8 @@ function chipContent(children, removeLabel) {
|
|
|
20
19
|
chipLabel(children),
|
|
21
20
|
state.allowsRemoving ? /* @__PURE__ */ jsx(Button, {
|
|
22
21
|
"aria-label": removeLabel,
|
|
22
|
+
className: chipRemoveClassName,
|
|
23
23
|
slot: "remove",
|
|
24
|
-
...props(chipStyles.remove),
|
|
25
24
|
children: /* @__PURE__ */ jsx(CloseGlyph, { ...props(chipStyles.removeGlyph) })
|
|
26
25
|
}) : null
|
|
27
26
|
] });
|
|
@@ -47,7 +46,7 @@ function chipContent(children, removeLabel) {
|
|
|
47
46
|
* The call site's `className` and `style` land on the group as a whole,
|
|
48
47
|
* which is the element a layout positions.
|
|
49
48
|
*/
|
|
50
|
-
const RemoveLabelContext = createContext(
|
|
49
|
+
const RemoveLabelContext = createContext(void 0);
|
|
51
50
|
const LABEL_STATE_VALID = { isInvalid: false };
|
|
52
51
|
const LABEL_STATE_INVALID = { isInvalid: true };
|
|
53
52
|
function ChipGroup(t0) {
|
|
@@ -70,8 +69,8 @@ function ChipGroup(t0) {
|
|
|
70
69
|
error = t5;
|
|
71
70
|
items = t6;
|
|
72
71
|
label = t7;
|
|
72
|
+
removeLabel = t8;
|
|
73
73
|
renderEmptyState = t9;
|
|
74
|
-
removeLabel = t8 === void 0 ? "Remove" : t8;
|
|
75
74
|
invalid = invalidFrom(error);
|
|
76
75
|
T0 = TagGroup;
|
|
77
76
|
t1 = props$1;
|
|
@@ -178,7 +177,7 @@ function ChipGroupChip(t0) {
|
|
|
178
177
|
const removeLabel = useContext(RemoveLabelContext);
|
|
179
178
|
const T0 = Tag;
|
|
180
179
|
const t1 = props.textValue ?? textOf(children);
|
|
181
|
-
const t2 = mergeStatefulStyles(
|
|
180
|
+
const t2 = mergeStatefulStyles(groupChipPropsFor, props);
|
|
182
181
|
let t3;
|
|
183
182
|
if ($[0] !== children || $[1] !== removeLabel) {
|
|
184
183
|
t3 = chipContent(children, removeLabel);
|
|
@@ -203,11 +202,11 @@ function ChipGroupChip(t0) {
|
|
|
203
202
|
} else t4 = $[8];
|
|
204
203
|
return t4;
|
|
205
204
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
205
|
+
function groupChipPropsFor(state) {
|
|
206
|
+
return chipPropsFor(state, true);
|
|
208
207
|
}
|
|
209
208
|
ChipGroup.Chip = ChipGroupChip;
|
|
210
209
|
//#endregion
|
|
211
|
-
export { ChipGroup as default };
|
|
210
|
+
export { ChipGroupChip, ChipGroup as default };
|
|
212
211
|
|
|
213
212
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TagGroupProps","RACTagGroupProps","TagListProps","RACTagListProps","TagProps","RACTagProps","TagRenderProps","stylex","createContext","useContext","Button","RACButton","Tag","RACTag","TagGroup","RACTagGroup","TagList","RACTagList","chipGlyph","chipLabel","chipStyles","textOf","FieldLabel","FieldMessage","invalidFrom","groupStyles","CloseGlyph","focus","mergeStatefulStyles","mergeStyles","spacing","ChipGroupChipProps","Omit","children","className","style","ChipGroupProps","description","error","label","removeLabel","Pick","T","chipContent","state","isSelected","allowsRemoving","props","remove","removeGlyph","RemoveLabelContext","LABEL_STATE_VALID","isInvalid","LABEL_STATE_INVALID","ChipGroup","t0","$","T0","invalid","items","renderEmptyState","t1","t2","t3","t4","t5","t6","t7","t8","t9","undefined","root","ChipGroupChip","textValue","chipPropsFor","base","target","targetInGroup","ring","selected","unselected","isDisabled","disabled","disabledSelected","disabledUnselected","Chip","RACButton","stylex.props","_c","props","RACTagGroup","RACTagList","RACTag"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TagGroupProps as RACTagGroupProps, TagListProps as RACTagListProps, TagProps as RACTagProps, TagRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tag as RACTag, TagGroup as RACTagGroup, TagList as RACTagList } from 'react-aria-components';\nimport { chipGlyph, chipLabel } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { textOf } from '../../collection/text';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom } from '../../field/root';\nimport { groupStyles } from '../../field/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The chips page's filter and input chips as a set: one or more chosen from a\n// row, each one removable. The pill is the chip module's in `src/chip`,\n// shared with the standalone Chip, so the two cannot drift; what is here is\n// the group around them.\n//\n// Three things it adds over a row of Chips.\n//\n// **It is a group, not a row of buttons.** React Aria's `TagGroup` names the\n// set, describes it, reports it invalid as a whole, and moves between its\n// chips with the arrow keys rather than making each one a tab stop — which\n// is what a set of a dozen filters needs. The label, the supporting line and\n// the error are the field chrome's, so a group reads like the fields beside\n// it, exactly as CheckboxGroup and RadioGroup do.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws\n// the page's trailing close target, an 18dp glyph in a target of its own so a\n// press there removes rather than toggles. Backspace and Delete remove the\n// focused chip too, which is React Aria's. A chosen chip's check sits at the\n// other end, so a chip that is both selected and removable carries one glyph\n// on each side of its label.\n//\n// **Selection is the group's, not each chip's.** `selectionMode` and\n// `selectedKeys` live on the group, so a set that chooses one of its chips\n// and a set that chooses several are the same component with a different\n// word. A chip on its own that toggles nothing else is still Chip.\n//\n// One thing is worth knowing about how this maps onto React Aria. A chip's\n// text value is read off its children and found only when they are a plain\n// string, and a chip here is always an element — the label sits beside a\n// close target. So a plain-string label is passed through as the text value,\n// which is what typeahead and a screen reader's announcement are made of;\n// see ListBox.Item, where the same thing bit.\n\ntype ChipGroupChipProps = Omit<RACTagProps, 'children' | 'className' | 'style'> & {\n /** The chip's label. */\n children?: ReactNode;\n /** A function may compute the class from the chip's render state. */\n className?: RACTagProps['className'];\n /** A function may compute the style from the chip's render state. */\n style?: RACTagProps['style'];\n};\ntype ChipGroupProps<T extends object = object> = {\n /** The chips, each with an `id` of its own. */\n children?: ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message and `aria-invalid` both\n * follow from it.\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 * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n label: string;\n /**\n * What the close target on each chip is called, for a screen reader. React\n * Aria adds the chip's own label after it, so this is the verb rather than\n * the whole phrase — \"Remove\" becomes \"Remove First item\".\n * @default 'Remove'\n */\n removeLabel?: string;\n} & Omit<RACTagGroupProps, 'children'> & Pick<RACTagListProps<T>, 'items' | 'renderEmptyState'>;\n\n// What the chip draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\n//\n// The check is the chip module's, so a chip in a group and a chip on its own\n// draw the same one. The close target is drawn only where the group allows\n// removing, which React Aria reports rather than the call site saying so on\n// every chip.\nfunction chipContent(children: ReactNode, removeLabel: string) {\n return (state: TagRenderProps) => <>\n {chipGlyph(state.isSelected)}\n {chipLabel(children)}\n {state.allowsRemoving ? <RACButton aria-label={removeLabel} slot=\"remove\" {...stylex.props(chipStyles.remove)}>\n <CloseGlyph {...stylex.props(chipStyles.removeGlyph)} />\n </RACButton> : null}\n </>;\n}\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Aria's: set `selectionMode` to `single`\n * or `multiple` and pass `selectedKeys` with `onSelectionChange` to control\n * it, or `defaultSelectedKeys` to let it keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" selectionMode=\"multiple\" onRemove={remove}>\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. The arrow\n * keys move between chips, so a set of many is one tab stop rather than many.\n *\n * A chip that toggles nothing else is Chip; this is for a set that shares a\n * value.\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\n// What each chip calls its close target. A context rather than a prop on the\n// chip, since it is the group's decision and repeating it on every chip is\n// how the two drift.\nconst RemoveLabelContext = createContext('Remove');\n\n// Hoisted so neither is a new object on every render.\nconst LABEL_STATE_VALID = {\n isInvalid: false\n};\nconst LABEL_STATE_INVALID = {\n isInvalid: true\n};\nfunction ChipGroup<T extends object = object>({\n children,\n description,\n error,\n items,\n label,\n removeLabel = 'Remove',\n renderEmptyState,\n ...props\n}: ChipGroupProps<T> & RefAttributes<HTMLDivElement>) {\n const invalid = invalidFrom(error);\n return <RACTagGroup {...props} {...mergeStyles(stylex.props(groupStyles.root), props)}>\n {/* React Aria's tag group has no disabled state of its own — a chip is\n disabled through the group's `disabledKeys` — so the label follows\n validity alone. */}\n <FieldLabel state={invalid ? LABEL_STATE_INVALID : LABEL_STATE_VALID} variant=\"group\">\n {label}\n </FieldLabel>\n <RemoveLabelContext value={removeLabel}>\n <RACTagList<T> items={items} renderEmptyState={renderEmptyState} className=\"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\">\n {children}\n </RACTagList>\n </RemoveLabelContext>\n <FieldMessage description={description} error={error} inset={false} />\n </RACTagGroup>;\n}\n\n/**\n * One chip. Give every chip an `id` — that is the key selection and removal\n * are reported by.\n */\nfunction ChipGroupChip({\n children,\n ...props\n}: ChipGroupChipProps) {\n const removeLabel = useContext(RemoveLabelContext);\n return <RACTag textValue={props.textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(chipPropsFor, props)}>\n {chipContent(children, removeLabel)}\n </RACTag>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// chip's state comes from the render state React Aria hands its className.\n// Disabled is applied last so it wins over both containers, and StyleX\n// replaces a property whole, so it takes their hover branches with it.\nfunction chipPropsFor(state: TagRenderProps) {\n return stylex.props(chipStyles.base, chipStyles.target, chipStyles.targetInGroup, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, state.isDisabled && chipStyles.disabled, state.isDisabled && (state.isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected));\n}\nChipGroup.Chip = ChipGroupChip;\nexport type { Ch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;CAAA,IAAAR,EAAA,OAAAC,MAAAD,EAAA,OAAAT,SAAAS,EAAA,OAAAK,MAAAL,EAAA,OAAAM,MAAAN,EAAA,OAAAO,IAAA;EADhCC,KAAA,oBAAC,IAAD;GAAmB,WAAAH;GAAmC,GAAMd;GAAK,GAAMe;GACzEC,UAAAA;EADS,CAAA;EAEHP,EAAA,KAAAC;EAAAD,EAAA,KAAAT;EAAAS,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFJQ;AAEI;AAOb,SAASU,aAAa9B,OAAuB;CAC3C,OAAOrC,MAAaa,WAAWuD,MAAMvD,WAAWwD,QAAQxD,WAAWyD,eAAelD,MAAMmD,MAAMlC,MAAMC,aAAazB,WAAW2D,WAAW3D,WAAW4D,YAAYpC,MAAMqC,cAAc7D,WAAW8D,UAAUtC,MAAMqC,eAAerC,MAAMC,aAAazB,WAAW+D,mBAAmB/D,WAAWgE,mBAAmB;AAC7S;AACA9B,UAAU+B,OAAOb"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TagGroupProps","RACTagGroupProps","TagListProps","RACTagListProps","TagProps","RACTagProps","TagRenderProps","stylex","createContext","useContext","Button","RACButton","Tag","RACTag","TagGroup","RACTagGroup","TagList","RACTagList","chipGlyph","chipLabel","chipPropsFor","chipRemoveClassName","chipStyles","textOf","FieldLabel","FieldMessage","invalidFrom","groupStyles","CloseGlyph","mergeStatefulStyles","mergeStyles","spacing","ChipGroupChipProps","Omit","children","className","style","ChipGroupProps","description","error","label","removeLabel","Pick","T","chipContent","state","isSelected","allowsRemoving","props","removeGlyph","RemoveLabelContext","undefined","LABEL_STATE_VALID","isInvalid","LABEL_STATE_INVALID","ChipGroup","t0","$","T0","invalid","items","renderEmptyState","t1","t2","t3","t4","t5","t6","t7","t8","t9","root","ChipGroupChip","textValue","groupChipPropsFor","Chip","RACButton","stylex.props","_c","props","RACTagGroup","RACTagList","RACTag"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TagGroupProps as RACTagGroupProps, TagListProps as RACTagListProps, TagProps as RACTagProps, TagRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tag as RACTag, TagGroup as RACTagGroup, TagList as RACTagList } from 'react-aria-components';\nimport { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { textOf } from '../../collection/text';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom } from '../../field/root';\nimport { groupStyles } from '../../field/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The chips page's filter and input chips as a set: one or more chosen from a\n// row, each one removable. The pill is the chip module's in `src/chip`,\n// shared with the standalone Chip, so the two cannot drift; what is here is\n// the group around them.\n//\n// Three things it adds over a row of Chips.\n//\n// **It is a group, not a row of buttons.** React Aria's `TagGroup` names the\n// set, describes it, reports it invalid as a whole, and moves between its\n// chips with the arrow keys rather than making each one a tab stop — which\n// is what a set of a dozen filters needs. The label, the supporting line and\n// the error are the field chrome's, so a group reads like the fields beside\n// it, exactly as CheckboxGroup and RadioGroup do.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws\n// the page's trailing close target, an 18dp glyph in a target of its own so a\n// press there removes rather than toggles. Backspace and Delete remove the\n// focused chip too, which is React Aria's. A chosen chip's check sits at the\n// other end, so a chip that is both selected and removable carries one glyph\n// on each side of its label.\n//\n// **Selection is the group's, not each chip's.** `selectionMode` and\n// `selectedKeys` live on the group, so a set that chooses one of its chips\n// and a set that chooses several are the same component with a different\n// word. A chip on its own that toggles nothing else is still Chip.\n//\n// One thing is worth knowing about how this maps onto React Aria. A chip's\n// text value is read off its children and found only when they are a plain\n// string, and a chip here is always an element — the label sits beside a\n// close target. So a plain-string label is passed through as the text value,\n// which is what typeahead and a screen reader's announcement are made of;\n// see ListBox.Item, where the same thing bit.\n\ntype ChipGroupChipProps = Omit<RACTagProps, 'children' | 'className' | 'style'> & {\n /** The chip's label. */\n children?: ReactNode;\n /** A function may compute the class from the chip's render state. */\n className?: RACTagProps['className'];\n /** A function may compute the style from the chip's render state. */\n style?: RACTagProps['style'];\n};\ntype ChipGroupProps<T extends object = object> = {\n /** The chips, each with an `id` of its own. */\n children?: ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message and `aria-invalid` both\n * follow from it.\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 * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n label: string;\n /**\n * What the close target on each chip is called, for a screen reader. React\n * Aria adds the chip's own label after it, so this is the verb rather than\n * the whole phrase — \"Remove\" becomes \"Remove First item\". Left out, React\n * Aria names it in the reader's locale — \"Remove\" in English.\n */\n removeLabel?: string;\n} & Omit<RACTagGroupProps, 'children'> & Pick<RACTagListProps<T>, 'items' | 'renderEmptyState'>;\n\n// What the chip draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\n//\n// The check is the chip module's, so a chip in a group and a chip on its own\n// draw the same one. The close target is drawn only where the group allows\n// removing, which React Aria reports rather than the call site saying so on\n// every chip.\nfunction chipContent(children: ReactNode, removeLabel: string | undefined) {\n return (state: TagRenderProps) => <>\n {chipGlyph(state.isSelected)}\n {chipLabel(children)}\n {state.allowsRemoving ? <RACButton aria-label={removeLabel} className={chipRemoveClassName} slot=\"remove\">\n <CloseGlyph {...stylex.props(chipStyles.removeGlyph)} />\n </RACButton> : null}\n </>;\n}\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Aria's: set `selectionMode` to `single`\n * or `multiple` and pass `selectedKeys` with `onSelectionChange` to control\n * it, or `defaultSelectedKeys` to let it keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" selectionMode=\"multiple\" onRemove={remove}>\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. The arrow\n * keys move between chips, so a set of many is one tab stop rather than many.\n *\n * A chip that toggles nothing else is Chip; this is for a set that shares a\n * value.\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\n// What each chip calls its close target. A context rather than a prop on the\n// chip, since it is the group's decision and repeating it on every chip is\n// how the two drift. Undefined unless the group is given one, which leaves\n// the name React Aria gives in the reader's locale.\nconst RemoveLabelContext = createContext<string | undefined>(undefined);\n\n// Hoisted so neither is a new object on every render.\nconst LABEL_STATE_VALID = {\n isInvalid: false\n};\nconst LABEL_STATE_INVALID = {\n isInvalid: true\n};\nfunction ChipGroup<T extends object = object>({\n children,\n description,\n error,\n items,\n label,\n removeLabel,\n renderEmptyState,\n ...props\n}: ChipGroupProps<T> & RefAttributes<HTMLDivElement>) {\n const invalid = invalidFrom(error);\n return <RACTagGroup {...props} {...mergeStyles(stylex.props(groupStyles.root), props)}>\n {/* React Aria's tag group has no disabled state of its own — a chip is\n disabled through the group's `disabledKeys` — so the label follows\n validity alone. */}\n <FieldLabel state={invalid ? LABEL_STATE_INVALID : LABEL_STATE_VALID} variant=\"group\">\n {label}\n </FieldLabel>\n <RemoveLabelContext value={removeLabel}>\n <RACTagList<T> items={items} renderEmptyState={renderEmptyState} className=\"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\">\n {children}\n </RACTagList>\n </RemoveLabelContext>\n <FieldMessage description={description} error={error} inset={false} />\n </RACTagGroup>;\n}\n\n/**\n * One chip. Give every chip an `id` — that is the key selection and removal\n * are reported by.\n */\nfunction ChipGroupChip({\n children,\n ...props\n}: ChipGroupChipProps) {\n const removeLabel = useContext(RemoveLabelContext);\n return <RACTag textValue={props.textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(groupChipPropsFor, props)}>\n {chipContent(children, removeLabel)}\n </RACTag>;\n}\n\n// The pill a standalone Chip draws, from `src/chip`, with the touch target a\n// chip in a group takes instead.\nfunction groupChipPropsFor(state: TagRenderProps) {\n return chipPropsFor(state, true);\n}\nChipGroup.Chip = ChipGroupChip;\nexport type { ChipGroupChipProps, ChipGroupProps };\nexport { ChipGroupChip };\nexport default ChipGroup;"],"mappings":";;;;;;;;;;;;;;;AAoGA,SAASgD,YAAYV,UAAqBO,aAAiC;CACzE,QAAQI,UAA0B,qBAAA,YAAA,EAAA,UAAA;EAC7B3B,UAAU2B,MAAMC,UAAU;EAC1B3B,UAAUe,QAAQ;EAClBW,MAAME,iBAAiB,oBAAC6B,QAAD;GAAW,cAAYnC;GAAa,WAAWpB;GAAqB,MAAK;GAC7F,UAAA,oBAAC,YAAD,EAAY,GAAId,MAAae,WAAW2B,WAAW,EAAE,CAAA;EAC5C,CAAA,IAAI;CACnB,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMC,qBAAqB1C,cAAkC2C,KAAAA,CAAS;AAGtE,MAAMC,oBAAoB,EACxBC,WAAW,MACb;AACA,MAAMC,sBAAsB,EAC1BD,WAAW,KACb;AACA,SAAAE,UAAAC,IAAA;CAAA,MAAAC,IAAA5D,EAAA,EAAA;CAAA,IAAA6D;CAAA,IAAAxB;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAoB;CAAA,IAAAC;CAAA,IAAApB;CAAA,IAAAC;CAAA,IAAAoB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA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AA,GAAAc,UAAAQ;CAIrB,MAAAf,cAAoBhC,WAAWyC,kBAAkB;CACzC,MAAAQ,KAAA7C;CAAkB,MAAAiD,KAAAd,MAAKyB,aAAclD,OAAOW,QAAQ;CAAkB,MAAA6B,KAAAlC,oBAAoB6C,mBAAmB1B,KAAK;CAAC,IAAAgB;CAAA,IAAAP,EAAA,OAAAvB,YAAAuB,EAAA,OAAAhB,aAAA;EACtHuB,KAAApB,YAAYV,UAAUO,WAAW;EAACgB,EAAA,KAAAvB;EAAAuB,EAAA,KAAAhB;EAAAgB,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAC,MAAAD,EAAA,OAAAT,SAAAS,EAAA,OAAAK,MAAAL,EAAA,OAAAM,MAAAN,EAAA,OAAAO,IAAA;EADhCC,KAAA,oBAAC,IAAD;GAAmB,WAAAH;GAAmC,GAAMd;GAAK,GAAMe;GACzEC,UAAAA;EADS,CAAA;EAEHP,EAAA,KAAAC;EAAAD,EAAA,KAAAT;EAAAS,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFJQ;AAEI;AAKb,SAASS,kBAAkB7B,OAAuB;CAChD,OAAOzB,aAAayB,OAAO,IAAI;AACjC;AACAU,UAAUoB,OAAOH"}
|
|
@@ -25,7 +25,7 @@ import { ColorField } from "react-aria-components";
|
|
|
25
25
|
* the field as a whole, which is the element a layout positions.
|
|
26
26
|
*/
|
|
27
27
|
function ColorField$1(t0) {
|
|
28
|
-
const $ = c(
|
|
28
|
+
const $ = c(24);
|
|
29
29
|
const { description, error, floatingLabel: t1, inputRef, isDisabled: t2, label, leadingIcon, trailingIcon, variant: t3, ...props$1 } = t0;
|
|
30
30
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
31
31
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
@@ -46,9 +46,10 @@ function ColorField$1(t0) {
|
|
|
46
46
|
$[3] = t6;
|
|
47
47
|
} else t6 = $[3];
|
|
48
48
|
let t7;
|
|
49
|
-
if ($[4] !== floatingLabel || $[5] !== label || $[6] !== leadingIcon || $[7] !==
|
|
49
|
+
if ($[4] !== floatingLabel || $[5] !== label || $[6] !== leadingIcon || $[7] !== props$1.isRequired || $[8] !== t6 || $[9] !== trailingIcon || $[10] !== variant) {
|
|
50
50
|
t7 = /* @__PURE__ */ jsx(FieldBox, {
|
|
51
51
|
floatingLabel,
|
|
52
|
+
isRequired: props$1.isRequired,
|
|
52
53
|
label,
|
|
53
54
|
leading: leadingIcon,
|
|
54
55
|
trailing: trailingIcon,
|
|
@@ -58,23 +59,24 @@ function ColorField$1(t0) {
|
|
|
58
59
|
$[4] = floatingLabel;
|
|
59
60
|
$[5] = label;
|
|
60
61
|
$[6] = leadingIcon;
|
|
61
|
-
$[7] =
|
|
62
|
-
$[8] =
|
|
63
|
-
$[9] =
|
|
64
|
-
$[10] =
|
|
65
|
-
|
|
62
|
+
$[7] = props$1.isRequired;
|
|
63
|
+
$[8] = t6;
|
|
64
|
+
$[9] = trailingIcon;
|
|
65
|
+
$[10] = variant;
|
|
66
|
+
$[11] = t7;
|
|
67
|
+
} else t7 = $[11];
|
|
66
68
|
let t8;
|
|
67
|
-
if ($[
|
|
69
|
+
if ($[12] !== description || $[13] !== error) {
|
|
68
70
|
t8 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
69
71
|
description,
|
|
70
72
|
error
|
|
71
73
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
} else t8 = $[
|
|
74
|
+
$[12] = description;
|
|
75
|
+
$[13] = error;
|
|
76
|
+
$[14] = t8;
|
|
77
|
+
} else t8 = $[14];
|
|
76
78
|
let t9;
|
|
77
|
-
if ($[
|
|
79
|
+
if ($[15] !== T0 || $[16] !== isDisabled || $[17] !== props$1 || $[18] !== t4 || $[19] !== t5 || $[20] !== t7 || $[21] !== t8 || $[22] !== validationBehavior) {
|
|
78
80
|
t9 = /* @__PURE__ */ jsxs(T0, {
|
|
79
81
|
isDisabled,
|
|
80
82
|
isInvalid: t4,
|
|
@@ -83,16 +85,16 @@ function ColorField$1(t0) {
|
|
|
83
85
|
...t5,
|
|
84
86
|
children: [t7, t8]
|
|
85
87
|
});
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
} else t9 = $[
|
|
88
|
+
$[15] = T0;
|
|
89
|
+
$[16] = isDisabled;
|
|
90
|
+
$[17] = props$1;
|
|
91
|
+
$[18] = t4;
|
|
92
|
+
$[19] = t5;
|
|
93
|
+
$[20] = t7;
|
|
94
|
+
$[21] = t8;
|
|
95
|
+
$[22] = validationBehavior;
|
|
96
|
+
$[23] = t9;
|
|
97
|
+
} else t9 = $[23];
|
|
96
98
|
return t9;
|
|
97
99
|
}
|
|
98
100
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ColorFieldProps","RACColorFieldProps","stylex","ColorField","RACColorField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","className","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","style","trailingIcon","variant","Omit","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","t7","t8","t9","ColorField","_c","props","RACColorField","stylex.props"],"sources":["../../../src/components/color-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ColorFieldProps as RACColorFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorField as RACColorField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A colour typed rather than picked. React Aria renders a plain text input\n// holding the colour's own notation, so this is the text fields page's box\n// with nothing added — the same chrome `TextField` draws through, which is\n// what makes a colour field on a form the same shape as the field beside\n// it.\n//\n// Two things are worth knowing about what it holds.\n//\n// **`channel` turns it from a colour into a number.** Without one the field\n// holds the whole colour — `#6750A4` — and parses what is typed. With one\n// it holds that channel alone, as a number a reader can step, which is what\n// a picker's three boxes beside a plane are.\n//\n// **A swatch is the natural leading icon.** The field's value is a colour,\n// and the chrome already has a slot for something at the box's leading end;\n// passing a `ColorSwatch` there is what makes the field show the colour it\n// holds. It is left to the call site rather than drawn here, since a field\n// inside a picker sits beside a swatch already.\n\ntype ColorFieldProps = {\n /** A function may compute the class from the field's render state. */\n className?: RACColorFieldProps['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 /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\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. A\n * `ColorSwatch` shows the value. An icon drawn in `em` takes that size\n * from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACColorFieldProps['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} & Omit<RACColorFieldProps, 'children' | 'className' | 'style'>;\n\n/**\n * A colour typed into a field. 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 * <ColorField defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * Without `channel` the field holds the whole colour and parses what is\n * typed; with one it holds that channel alone as a number. `colorSpace`\n * decides which space a channel belongs to, the same as on `ColorSlider`.\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 ColorField({\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: ColorFieldProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACColorField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput ref={inputRef} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACColorField>;\n}\nexport type { ColorFieldProps };\nexport default ColorField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAAQ,aAAAsB,IAAA;CAAA,MAAAC,IAAA9B,EAAA,EAAA;CAAoB,MAAA,EAAAkB,aAAAC,OAAAC,eAAAW,IAAAV,UAAAW,YAAAC,IAAAV,OAAAC,aAAAE,cAAAC,SAAAO,IAAA,GAAAC,YAAAN;CAGlB,MAAAT,gBAAAW,OAAAK,KAAAA,IAAA,OAAAL;CAEA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAN,UAAAO,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BtB,2BAA2B;CAC9C,MAAAuB,KAAA9B;CAAa,IAAA+B;CAAA,IAAAT,EAAA,OAAAX,OAAA;EAAoCoB,KAAAzB,YAAYK,KAAK;EAACW,EAAA,KAAAX;EAAAW,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAyD,MAAAU,KAAAxB,oBAAoBV,MAAaO,YAAW4B,IAAK,GAAGN,OAAK;CAAC,IAAAO;CAAA,IAAAZ,EAAA,OAAAT,UAAA;EAExLqB,KAAA,oBAAC,YAAD,EAAiBrB,KAAAA,SAAQ,CAAA;EAAIS,EAAA,KAAAT;EAAAS,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAV,iBAAAU,EAAA,OAAAP,SAAAO,EAAA,OAAAN,eAAAM,EAAA,OAAAY,MAAAZ,EAAA,OAAAJ,gBAAAI,EAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ColorFieldProps","RACColorFieldProps","stylex","ColorField","RACColorField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","className","description","error","floatingLabel","inputRef","HTMLInputElement","label","leadingIcon","style","trailingIcon","variant","Omit","t0","$","t1","isDisabled","t2","t3","props","undefined","validationBehavior","T0","t4","t5","root","t6","t7","isRequired","t8","t9","ColorField","_c","props","RACColorField","stylex.props"],"sources":["../../../src/components/color-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ColorFieldProps as RACColorFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorField as RACColorField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// A colour typed rather than picked. React Aria renders a plain text input\n// holding the colour's own notation, so this is the text fields page's box\n// with nothing added — the same chrome `TextField` draws through, which is\n// what makes a colour field on a form the same shape as the field beside\n// it.\n//\n// Two things are worth knowing about what it holds.\n//\n// **`channel` turns it from a colour into a number.** Without one the field\n// holds the whole colour — `#6750A4` — and parses what is typed. With one\n// it holds that channel alone, as a number a reader can step, which is what\n// a picker's three boxes beside a plane are.\n//\n// **A swatch is the natural leading icon.** The field's value is a colour,\n// and the chrome already has a slot for something at the box's leading end;\n// passing a `ColorSwatch` there is what makes the field show the colour it\n// holds. It is left to the call site rather than drawn here, since a field\n// inside a picker sits beside a swatch already.\n\ntype ColorFieldProps = {\n /** A function may compute the class from the field's render state. */\n className?: RACColorFieldProps['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 /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\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. A\n * `ColorSwatch` shows the value. An icon drawn in `em` takes that size\n * from the slot.\n */\n leadingIcon?: ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACColorFieldProps['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} & Omit<RACColorFieldProps, 'children' | 'className' | 'style'>;\n\n/**\n * A colour typed into a field. 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 * <ColorField defaultValue=\"#6750A4\" label=\"Label\" />\n * ```\n *\n * Without `channel` the field holds the whole colour and parses what is\n * typed; with one it holds that channel alone as a number. `colorSpace`\n * decides which space a channel belongs to, the same as on `ColorSlider`.\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 ColorField({\n description,\n error,\n floatingLabel = true,\n inputRef,\n isDisabled = false,\n label,\n leadingIcon,\n trailingIcon,\n variant = 'filled',\n ...props\n}: ColorFieldProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACColorField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} leading={leadingIcon} trailing={trailingIcon} variant={variant}>\n <FieldInput ref={inputRef} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACColorField>;\n}\nexport type { ColorFieldProps };\nexport default ColorField;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,SAAAQ,aAAAsB,IAAA;CAAA,MAAAC,IAAA9B,EAAA,EAAA;CAAoB,MAAA,EAAAkB,aAAAC,OAAAC,eAAAW,IAAAV,UAAAW,YAAAC,IAAAV,OAAAC,aAAAE,cAAAC,SAAAO,IAAA,GAAAC,YAAAN;CAGlB,MAAAT,gBAAAW,OAAAK,KAAAA,IAAA,OAAAL;CAEA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAIA,MAAAN,UAAAO,OAAAE,KAAAA,IAAA,WAAAF;CAGA,MAAAG,qBAA2BtB,2BAA2B;CAC9C,MAAAuB,KAAA9B;CAAa,IAAA+B;CAAA,IAAAT,EAAA,OAAAX,OAAA;EAAoCoB,KAAAzB,YAAYK,KAAK;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JrDS,KAAA,qBAAC,IAAD;GAA2Bd;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMF;GAAK,GAAMK;GAA7H,UAAA,CACHG,IAGAE,EAJiB;;EAKHf,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OALXgB;AAKW"}
|
|
@@ -10,12 +10,12 @@ import ColorSlider$1 from "../color-slider/index.js";
|
|
|
10
10
|
import ColorSwatch$1 from "../color-swatch/index.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Button, ColorPicker, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
13
|
+
import { Button, ColorPicker, Dialog, DialogTrigger, Popover, parseColor, useLocale } from "react-aria-components";
|
|
14
14
|
//#region src/components/color-picker/index.tsx
|
|
15
15
|
const triggerStyles = {
|
|
16
16
|
base: {
|
|
17
17
|
kGNEyG: "x6s0dn4",
|
|
18
|
-
kWkggS: "
|
|
18
|
+
kWkggS: "x1vnz5z6",
|
|
19
19
|
kaIpWk: "x1dkaolv",
|
|
20
20
|
kMzoRj: "xc342km",
|
|
21
21
|
kB7OPa: "x9f619",
|
|
@@ -37,8 +37,17 @@ const triggerStyles = {
|
|
|
37
37
|
kMwMTN: "x1xj74d8",
|
|
38
38
|
kkrTdU: "x1h6gzvc",
|
|
39
39
|
$$css: true
|
|
40
|
+
},
|
|
41
|
+
hovered: {
|
|
42
|
+
kWkggS: "x1ei6177",
|
|
43
|
+
$$css: true
|
|
44
|
+
},
|
|
45
|
+
pressed: {
|
|
46
|
+
kWkggS: "x1vt8e7r",
|
|
47
|
+
$$css: true
|
|
40
48
|
}
|
|
41
49
|
};
|
|
50
|
+
const CHANNELS = parseColor("hsl(0, 0%, 0%)");
|
|
42
51
|
/**
|
|
43
52
|
* A colour picked from a plane, a hue strip and a text field, behind a
|
|
44
53
|
* trigger showing the colour. The value is React Aria's: pass `value` with
|
|
@@ -64,7 +73,7 @@ const triggerStyles = {
|
|
|
64
73
|
* element a layout positions.
|
|
65
74
|
*/
|
|
66
75
|
function ColorPicker$1(t0) {
|
|
67
|
-
const $ = c(
|
|
76
|
+
const $ = c(44);
|
|
68
77
|
let children;
|
|
69
78
|
let className;
|
|
70
79
|
let container;
|
|
@@ -108,6 +117,7 @@ function ColorPicker$1(t0) {
|
|
|
108
117
|
}
|
|
109
118
|
const alpha = t1 === void 0 ? false : t1;
|
|
110
119
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
120
|
+
const { locale } = useLocale();
|
|
111
121
|
let t3;
|
|
112
122
|
if ($[13] !== className || $[14] !== style) {
|
|
113
123
|
t3 = mergeStatefulStyles(_temp, {
|
|
@@ -148,7 +158,7 @@ function ColorPicker$1(t0) {
|
|
|
148
158
|
$[23] = t7;
|
|
149
159
|
} else t7 = $[23];
|
|
150
160
|
let t8;
|
|
151
|
-
if ($[24] !== alpha || $[25] !== children || $[26] !== isDisabled || $[27] !== label) {
|
|
161
|
+
if ($[24] !== alpha || $[25] !== children || $[26] !== isDisabled || $[27] !== label || $[28] !== locale) {
|
|
152
162
|
t8 = children ?? /* @__PURE__ */ jsxs("div", {
|
|
153
163
|
className: "x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li",
|
|
154
164
|
children: [
|
|
@@ -163,12 +173,12 @@ function ColorPicker$1(t0) {
|
|
|
163
173
|
channel: "hue",
|
|
164
174
|
colorSpace: "hsl",
|
|
165
175
|
isDisabled,
|
|
166
|
-
label: "
|
|
176
|
+
label: CHANNELS.getChannelName("hue", locale)
|
|
167
177
|
}),
|
|
168
178
|
alpha ? /* @__PURE__ */ jsx(ColorSlider$1, {
|
|
169
179
|
channel: "alpha",
|
|
170
180
|
isDisabled,
|
|
171
|
-
label: "
|
|
181
|
+
label: CHANNELS.getChannelName("alpha", locale)
|
|
172
182
|
}) : null,
|
|
173
183
|
/* @__PURE__ */ jsx(ColorField$1, {
|
|
174
184
|
isDisabled,
|
|
@@ -180,57 +190,58 @@ function ColorPicker$1(t0) {
|
|
|
180
190
|
$[25] = children;
|
|
181
191
|
$[26] = isDisabled;
|
|
182
192
|
$[27] = label;
|
|
183
|
-
$[28] =
|
|
184
|
-
|
|
193
|
+
$[28] = locale;
|
|
194
|
+
$[29] = t8;
|
|
195
|
+
} else t8 = $[29];
|
|
185
196
|
let t9;
|
|
186
|
-
if ($[
|
|
197
|
+
if ($[30] !== t8) {
|
|
187
198
|
t9 = /* @__PURE__ */ jsx(Dialog, {
|
|
188
199
|
...t7,
|
|
189
200
|
children: t8
|
|
190
201
|
});
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
} else t9 = $[
|
|
202
|
+
$[30] = t8;
|
|
203
|
+
$[31] = t9;
|
|
204
|
+
} else t9 = $[31];
|
|
194
205
|
let t10;
|
|
195
|
-
if ($[
|
|
206
|
+
if ($[32] !== container || $[33] !== t9) {
|
|
196
207
|
t10 = /* @__PURE__ */ jsx(Popover, {
|
|
197
208
|
UNSTABLE_portalContainer: container,
|
|
198
209
|
...t6,
|
|
199
210
|
children: t9
|
|
200
211
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
} else t10 = $[
|
|
212
|
+
$[32] = container;
|
|
213
|
+
$[33] = t9;
|
|
214
|
+
$[34] = t10;
|
|
215
|
+
} else t10 = $[34];
|
|
205
216
|
let t11;
|
|
206
|
-
if ($[
|
|
217
|
+
if ($[35] !== defaultOpen || $[36] !== isOpen || $[37] !== onOpenChange || $[38] !== t10 || $[39] !== t5) {
|
|
207
218
|
t11 = /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
208
219
|
defaultOpen,
|
|
209
220
|
isOpen,
|
|
210
221
|
onOpenChange,
|
|
211
222
|
children: [t5, t10]
|
|
212
223
|
});
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
} else t11 = $[
|
|
224
|
+
$[35] = defaultOpen;
|
|
225
|
+
$[36] = isOpen;
|
|
226
|
+
$[37] = onOpenChange;
|
|
227
|
+
$[38] = t10;
|
|
228
|
+
$[39] = t5;
|
|
229
|
+
$[40] = t11;
|
|
230
|
+
} else t11 = $[40];
|
|
220
231
|
let t12;
|
|
221
|
-
if ($[
|
|
232
|
+
if ($[41] !== props$1 || $[42] !== t11) {
|
|
222
233
|
t12 = /* @__PURE__ */ jsx(ColorPicker, {
|
|
223
234
|
...props$1,
|
|
224
235
|
children: t11
|
|
225
236
|
});
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else t12 = $[
|
|
237
|
+
$[41] = props$1;
|
|
238
|
+
$[42] = t11;
|
|
239
|
+
$[43] = t12;
|
|
240
|
+
} else t12 = $[43];
|
|
230
241
|
return t12;
|
|
231
242
|
}
|
|
232
243
|
function _temp(state) {
|
|
233
|
-
return props(triggerStyles.base, focus.ring, state.isDisabled && triggerStyles.disabled);
|
|
244
|
+
return props(triggerStyles.base, focus.ring, state.isHovered && triggerStyles.hovered, state.isPressed && triggerStyles.pressed, state.isDisabled && triggerStyles.disabled);
|
|
234
245
|
}
|
|
235
246
|
//#endregion
|
|
236
247
|
export { ColorPicker$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","CSSProperties","ReactNode","RefAttributes","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","t0","$","props","ref","t1","t2","undefined","t3","_temp","t4","Symbol","for","t5","t6","popup","popover","t7","popupDialog","ring","t8","t9","t10","t11","t12","state","ColorPicker","_c","props","ColorSwatch","RACButton","stylex.props","ColorArea","ColorSlider","ColorField","RACDialog","RACPopover","RACDialogTrigger","RACColorPicker"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } 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**, centred\n// over a scrim there — the same swap `DatePicker` makes, at the width `Sheet`\n// changes presentation too, and the shared one in `src/styles/picker.ts`\n// rather than a third copy. A 280dp surface anchored to a trigger is\n// 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: \"x1dkaolv\",\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 /**\n * Whether the whole picker is inert — the trigger, and the plane, strips\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed\n * as `children` is the call site's own to disable.\n * @default false\n */\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?: 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 ref,\n style,\n ...props\n}: ColorPickerProps & RefAttributes<HTMLButtonElement>) {\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled}\n // React Aria's picker renders no element of its own, so the ref\n // lands on the trigger, as the call site's class and style do.\n ref={ref} {...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 {/*\n Disabled reaches every control here, not only the trigger.\n React Aria's colour picker carries no disabled state of its\n own — react-stately's `useColorPickerState` has no such\n concept — so nothing hands it down the way a field's context\n would. And the surface opens independently of the trigger, so\n a disabled picker can still be on screen: already open when a\n form disables it, or opened from outside. Without this the\n plane could be dragged, the strips moved with the arrow keys\n and the field typed into, all changing the value of something\n documented as inert.\n An arrangement a call site passes as `children` is its own to\n disable; there is no context to reach it through.\n */}\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" isDisabled={isDisabled} xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" isDisabled={isDisabled} label=\"Hue\" />\n {alpha ? <ColorSlider channel=\"alpha\" isDisabled={isDisabled} label=\"Alpha\" /> : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\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W,IAAA;EAzCfU,MAAA,qBAACc,eAAD;GAA+B1C;GAAqBE;GAAsBE;GAA1E,UAAA,CACEc,IAeAS,GAhBe;;EA0CEpB,EAAA,MAAAP;EAAAO,EAAA,MAAAL;EAAAK,EAAA,MAAAH;EAAAG,EAAA,MAAAoB;EAAApB,EAAA,MAAAW;EAAAX,EAAA,MAAAqB;CAAA,OAAAA,MAAArB,EAAA;CAAA,IAAAsB;CAAA,IAAAtB,EAAA,QAAAC,WAAAD,EAAA,QAAAqB,KAAA;EA3ChBC,MAAA,oBAACc,aAAD;GAAe,GAAKnC;GACvBoB,UAAAA;EADkB,CAAA;EA4CHrB,EAAA,MAAAC;EAAAD,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,MAAAtB,EAAA;CAAA,OA5CZsB;AA4CY;AA1DrB,SAAAf,MAAAgB,OAAA;CAAA,OAwBoChF,MAAawB,cAAaC,MAAOd,MAAK+D,MAAOM,MAAK7B,cAAe3B,cAAamB,QAAS;AAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","CSSProperties","ReactNode","RefAttributes","ButtonRenderProps","ColorPickerProps","RACColorPickerProps","stylex","parseColor","Button","RACButton","ColorPicker","RACColorPicker","Dialog","RACDialog","DialogTrigger","RACDialogTrigger","Popover","RACPopover","useLocale","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","hovered","pressed","Omit","alpha","children","className","container","Element","defaultOpen","isDisabled","isOpen","label","onOpenChange","style","CHANNELS","t0","$","props","ref","t1","t2","undefined","locale","t3","_temp","t4","Symbol","for","t5","t6","popup","popover","t7","popupDialog","ring","t8","getChannelName","t9","t10","t11","t12","state","isHovered","isPressed","ColorPicker","_c","props","ColorSwatch","RACButton","stylex.props","ColorArea","ColorSlider","ColorField","RACDialog","RACPopover","RACDialogTrigger","RACColorPicker"],"sources":["../../../src/components/color-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, ReactNode, RefAttributes } from 'react';\nimport type { ButtonRenderProps, ColorPickerProps as RACColorPickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { parseColor, Button as RACButton, ColorPicker as RACColorPicker, Dialog as RACDialog, DialogTrigger as RACDialogTrigger, Popover as RACPopover, useLocale } 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**, centred\n// over a scrim there — the same swap `DatePicker` makes, at the width `Sheet`\n// changes presentation too, and the shared one in `src/styles/picker.ts`\n// rather than a third copy. A 280dp surface anchored to a trigger is\n// 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: \"x1vnz5z6\",\n kaIpWk: \"x1dkaolv\",\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 hovered: {\n kWkggS: \"x1ei6177\",\n $$css: true\n },\n pressed: {\n kWkggS: \"x1vt8e7r\",\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 /**\n * Whether the whole picker is inert — the trigger, and the plane, strips\n * and field on the surface, which can be on screen while disabled since\n * the surface opens independently of the trigger. An arrangement passed\n * as `children` is the call site's own to disable.\n * @default false\n */\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?: CSSProperties;\n};\n\n// Any HSL colour names the channels the two strips draw. The labels are read\n// off it in the reader's locale, as React Aria words them, rather than written\n// here in English.\nconst CHANNELS = parseColor('hsl(0, 0%, 0%)');\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 ref,\n style,\n ...props\n}: ColorPickerProps & RefAttributes<HTMLButtonElement>) {\n const {\n locale\n } = useLocale();\n return <RACColorPicker {...props}>\n <RACDialogTrigger defaultOpen={defaultOpen} isOpen={isOpen} onOpenChange={onOpenChange}>\n <RACButton isDisabled={isDisabled}\n // React Aria's picker renders no element of its own, so the ref\n // lands on the trigger, as the call site's class and style do.\n ref={ref} {...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.isHovered && triggerStyles.hovered, state.isPressed && triggerStyles.pressed, 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 {/*\n Disabled reaches every control here, not only the trigger.\n React Aria's colour picker carries no disabled state of its\n own — react-stately's `useColorPickerState` has no such\n concept — so nothing hands it down the way a field's context\n would. And the surface opens independently of the trigger, so\n a disabled picker can still be on screen: already open when a\n form disables it, or opened from outside. Without this the\n plane could be dragged, the strips moved with the arrow keys\n and the field typed into, all changing the value of something\n documented as inert.\n An arrangement a call site passes as `children` is its own to\n disable; there is no context to reach it through.\n */}\n {children ?? <div className=\"x9f619 x78zum5 xdt5ytf x1gka490 x1dz1jew x193iq5w xgc26li\">\n <ColorArea aria-label={label} colorSpace=\"hsl\" isDisabled={isDisabled} xChannel=\"saturation\" yChannel=\"lightness\" />\n <ColorSlider channel=\"hue\" colorSpace=\"hsl\" isDisabled={isDisabled} label={CHANNELS.getChannelName('hue', locale)} />\n {alpha ? <ColorSlider channel=\"alpha\" isDisabled={isDisabled} label={CHANNELS.getChannelName('alpha', locale)} /> : null}\n <ColorField isDisabled={isDisabled} label={label} />\n </div>}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n </RACColorPicker>;\n}\nexport type { ColorPickerProps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GACrCQ,UAAAA;EAHS,CAAA;EAyBErB,EAAA,MAAAV;EAAAU,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,MAAAtB,EAAA;CAAA,IAAAuB;CAAA,IAAAvB,EAAA,QAAAR,eAAAQ,EAAA,QAAAN,UAAAM,EAAA,QAAAJ,gBAAAI,EAAA,QAAAsB,OAAAtB,EAAA,QAAAY,IAAA;EAzCfW,MAAA,qBAACgB,eAAD;GAA+B/C;GAAqBE;GAAsBE;GAA1E,UAAA,CACEgB,IAeAU,GAhBe;;EA0CEtB,EAAA,MAAAR;EAAAQ,EAAA,MAAAN;EAAAM,EAAA,MAAAJ;EAAAI,EAAA,MAAAsB;EAAAtB,EAAA,MAAAY;EAAAZ,EAAA,MAAAuB;CAAA,OAAAA,MAAAvB,EAAA;CAAA,IAAAwB;CAAA,IAAAxB,EAAA,QAAAC,WAAAD,EAAA,QAAAuB,KAAA;EA3ChBC,MAAA,oBAACgB,aAAD;GAAe,GAAKvC;GACvBsB,UAAAA;EADkB,CAAA;EA4CHvB,EAAA,MAAAC;EAAAD,EAAA,MAAAuB;EAAAvB,EAAA,MAAAwB;CAAA,OAAAA,MAAAxB,EAAA;CAAA,OA5CZwB;AA4CY;AA7DrB,SAAAhB,MAAAiB,OAAA;CAAA,OA2BoCvF,MAAa0B,cAAaC,MAAOd,MAAKmE,MAAOO,MAAKC,aAAc9D,cAAaoB,SAAUyC,MAAKE,aAAc/D,cAAaqB,SAAUwC,MAAKhC,cAAe7B,cAAamB,QAAS;AAAC"}
|
|
@@ -45,5 +45,5 @@ declare namespace ColorSwatchPicker$1 {
|
|
|
45
45
|
*/
|
|
46
46
|
declare function ColorSwatchPickerItem$1({ children, ...props }: ColorSwatchPickerItemProps$1): import("react").JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
|
-
export { type ColorSwatchPickerItemProps$1 as ColorSwatchPickerItemProps, type ColorSwatchPickerProps$1 as ColorSwatchPickerProps, ColorSwatchPicker$1 as default };
|
|
48
|
+
export { ColorSwatchPickerItem$1 as ColorSwatchPickerItem, type ColorSwatchPickerItemProps$1 as ColorSwatchPickerItemProps, type ColorSwatchPickerProps$1 as ColorSwatchPickerProps, ColorSwatchPicker$1 as default };
|
|
49
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,14 +8,20 @@ import { ColorSwatchPicker, ColorSwatchPickerItem } from "react-aria-components"
|
|
|
8
8
|
//#region src/components/color-swatch-picker/index.tsx
|
|
9
9
|
const styles = {
|
|
10
10
|
item: {
|
|
11
|
+
kUfP38: "x1upluxz",
|
|
12
|
+
kbwMcY: "x1v5kskh",
|
|
13
|
+
kPGmMm: "x1941vk7",
|
|
14
|
+
kWgvks: "xx38sju",
|
|
15
|
+
k5JduY: "x1s928wv",
|
|
16
|
+
kv0HGH: "xramuyw",
|
|
17
|
+
kloYau: "x2q1x1w",
|
|
18
|
+
kwXMNM: "x1j6awrg",
|
|
11
19
|
kaIpWk: "x1tfhd1",
|
|
12
20
|
kB7OPa: "x9f619",
|
|
13
21
|
kkrTdU: "x1ypdohk",
|
|
14
22
|
k1xSpc: "x3nfvp2",
|
|
15
|
-
kjBf7l: "xrgy624",
|
|
16
|
-
kInvED: "x1hl8ikr",
|
|
17
23
|
k3XXqK: "x1t137rt",
|
|
18
|
-
|
|
24
|
+
kVAEAm: "x1n2onr6",
|
|
19
25
|
$$css: true
|
|
20
26
|
},
|
|
21
27
|
itemDisabled: {
|
|
@@ -27,24 +33,22 @@ const styles = {
|
|
|
27
33
|
kjBf7l: "xrgy624",
|
|
28
34
|
kInvED: "x8wkva7",
|
|
29
35
|
k3XXqK: "xaatb59",
|
|
36
|
+
kMeerF: "x1de99jn",
|
|
30
37
|
$$css: true
|
|
31
38
|
},
|
|
32
39
|
itemHovered: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
k3XXqK: "xaatb59 xq4115o",
|
|
40
|
+
kXtpa: "x1ek9lwj",
|
|
41
|
+
kbwMcY: "x86avzo xssfeg4",
|
|
36
42
|
$$css: true
|
|
37
43
|
},
|
|
38
44
|
itemPressed: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
k3XXqK: "xaatb59 xq4115o",
|
|
45
|
+
kXtpa: "xrwozs3",
|
|
46
|
+
kbwMcY: "x86avzo xssfeg4",
|
|
42
47
|
$$css: true
|
|
43
48
|
},
|
|
44
49
|
itemSelected: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
k3XXqK: "xaatb59",
|
|
50
|
+
kXtpa: "xtl7nvb",
|
|
51
|
+
kbwMcY: "x86avzo",
|
|
48
52
|
$$css: true
|
|
49
53
|
}
|
|
50
54
|
};
|
|
@@ -141,6 +145,6 @@ function itemStyles(state) {
|
|
|
141
145
|
}
|
|
142
146
|
ColorSwatchPicker$1.Item = ColorSwatchPickerItem$1;
|
|
143
147
|
//#endregion
|
|
144
|
-
export { ColorSwatchPicker$1 as default };
|
|
148
|
+
export { ColorSwatchPickerItem$1 as ColorSwatchPickerItem, ColorSwatchPicker$1 as default };
|
|
145
149
|
|
|
146
150
|
//# sourceMappingURL=index.js.map
|