@kanso-labs/kanso-ui 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/index.js +80 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/months.js +14 -0
- package/dist/calendar/months.js.map +1 -0
- package/dist/calendar/styles.js +150 -0
- package/dist/calendar/styles.js.map +1 -0
- package/dist/components/calendar/index.d.ts +32 -0
- package/dist/components/calendar/index.js +97 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/color-slider/index.d.ts +41 -0
- package/dist/components/color-slider/index.js +81 -0
- package/dist/components/color-slider/index.js.map +1 -0
- package/dist/components/color-swatch/index.d.ts +37 -0
- package/dist/components/color-swatch/index.js +88 -0
- package/dist/components/color-swatch/index.js.map +1 -0
- package/dist/components/color-swatch-picker/index.d.ts +49 -0
- package/dist/components/color-swatch-picker/index.js +99 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -0
- package/dist/components/date-field/index.d.ts +54 -0
- package/dist/components/date-field/index.js +58 -0
- package/dist/components/date-field/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +57 -0
- package/dist/components/date-picker/index.js +75 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/date-range-picker/index.d.ts +69 -0
- package/dist/components/date-range-picker/index.js +95 -0
- package/dist/components/date-range-picker/index.js.map +1 -0
- package/dist/components/drop-zone/index.d.ts +60 -0
- package/dist/components/drop-zone/index.js +118 -0
- package/dist/components/drop-zone/index.js.map +1 -0
- package/dist/components/drop-zone/styles.js +61 -0
- package/dist/components/drop-zone/styles.js.map +1 -0
- package/dist/components/icon-button/index.d.ts +4 -3
- package/dist/components/icon-button/index.js +48 -2
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +14 -1
- package/dist/components/list-item/index.d.ts +14 -5
- package/dist/components/list-item/index.js +12 -7
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/navigation-tree/index.d.ts +94 -0
- package/dist/components/navigation-tree/index.js +266 -0
- package/dist/components/navigation-tree/index.js.map +1 -0
- package/dist/components/range-calendar/index.d.ts +39 -0
- package/dist/components/range-calendar/index.js +105 -0
- package/dist/components/range-calendar/index.js.map +1 -0
- package/dist/components/separator/index.d.ts +17 -4
- package/dist/components/separator/index.js +38 -20
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/table/index.d.ts +197 -0
- package/dist/components/table/index.js +327 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/time-field/index.d.ts +53 -0
- package/dist/components/time-field/index.js +57 -0
- package/dist/components/time-field/index.js.map +1 -0
- package/dist/components/tree/index.d.ts +116 -0
- package/dist/components/tree/index.js +245 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/date.d.ts +1 -0
- package/dist/date.js +1 -0
- package/dist/drag/hooks.d.ts +25 -0
- package/dist/drag/hooks.js +55 -0
- package/dist/drag/hooks.js.map +1 -0
- package/dist/drag/index.js +28 -0
- package/dist/drag/index.js.map +1 -0
- package/dist/drag/styles.js +46 -0
- package/dist/drag/styles.js.map +1 -0
- package/dist/glyphs/index.js +64 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.js +17 -2
- package/dist/layout.d.ts +44 -0
- package/dist/layout.js +45 -0
- package/dist/layout.js.map +1 -0
- package/dist/react-aria.d.ts +3 -2
- package/dist/react-aria.js +3 -2
- package/dist/row/index.js +25 -13
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +30 -0
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/index.js +22 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/segments/styles.js +42 -0
- package/dist/segments/styles.js.map +1 -0
- package/dist/styles/chequer.js +14 -0
- package/dist/styles/chequer.js.map +1 -0
- package/dist/styles/picker.js +61 -0
- package/dist/styles/picker.js.map +1 -0
- package/dist/styles.css +255 -3
- package/dist/tokens/design.tokens.stylex.js +61 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { ChevronEndGlyph } from "../glyphs/index.js";
|
|
3
|
+
import { calendarStyles } from "./styles.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { Button, CalendarGridHeader, CalendarHeaderCell, Heading } from "react-aria-components";
|
|
7
|
+
//#region src/calendar/index.tsx
|
|
8
|
+
function CalendarGridHeader$1() {
|
|
9
|
+
const $ = c(1);
|
|
10
|
+
let t0;
|
|
11
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
12
|
+
t0 = /* @__PURE__ */ jsx(CalendarGridHeader, { children: calendarHeaderCell });
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
} else t0 = $[0];
|
|
15
|
+
return t0;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The two chevrons with the month between them. React Aria wires
|
|
19
|
+
* `slot="previous"` and `slot="next"` on its own `Button`, and `IconButton`
|
|
20
|
+
* renders React Aria's `Button` too — so nesting one inside a slot would put
|
|
21
|
+
* two buttons where the date pickers page draws one. The chevrons take the
|
|
22
|
+
* icon buttons page's 40dp square and its state layer instead.
|
|
23
|
+
*
|
|
24
|
+
* A plain element rather than a `<header>`: a header is a banner landmark,
|
|
25
|
+
* landmarks may not nest, and React Aria puts a calendar in
|
|
26
|
+
* `role="application"` — axe fails the page on it.
|
|
27
|
+
*/
|
|
28
|
+
function CalendarHeader() {
|
|
29
|
+
const $ = c(4);
|
|
30
|
+
let t0;
|
|
31
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
32
|
+
t0 = props(calendarStyles.header);
|
|
33
|
+
$[0] = t0;
|
|
34
|
+
} else t0 = $[0];
|
|
35
|
+
let t1;
|
|
36
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
37
|
+
t1 = /* @__PURE__ */ jsx(Button, {
|
|
38
|
+
className: chevronClassName,
|
|
39
|
+
slot: "previous",
|
|
40
|
+
children: /* @__PURE__ */ jsx(ChevronEndGlyph, { ...props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious) })
|
|
41
|
+
});
|
|
42
|
+
$[1] = t1;
|
|
43
|
+
} else t1 = $[1];
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
|
+
t2 = /* @__PURE__ */ jsx(Heading, { ...props(calendarStyles.heading) });
|
|
47
|
+
$[2] = t2;
|
|
48
|
+
} else t2 = $[2];
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
...t0,
|
|
53
|
+
children: [
|
|
54
|
+
t1,
|
|
55
|
+
t2,
|
|
56
|
+
/* @__PURE__ */ jsx(Button, {
|
|
57
|
+
className: chevronClassName,
|
|
58
|
+
slot: "next",
|
|
59
|
+
children: /* @__PURE__ */ jsx(ChevronEndGlyph, { ...props(calendarStyles.chevronGlyph) })
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
$[3] = t3;
|
|
64
|
+
} else t3 = $[3];
|
|
65
|
+
return t3;
|
|
66
|
+
}
|
|
67
|
+
/** The weekday row, in the type the page gives both it and the dates. */
|
|
68
|
+
function calendarHeaderCell(day) {
|
|
69
|
+
return /* @__PURE__ */ jsx(CalendarHeaderCell, {
|
|
70
|
+
...props(calendarStyles.headerCell),
|
|
71
|
+
children: day
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function chevronClassName() {
|
|
75
|
+
return props(calendarStyles.chevron).className ?? "";
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { CalendarGridHeader$1 as CalendarGridHeader, CalendarHeader };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["calendarHeaderCell","chevronClassName"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../glyphs';\nimport { calendarStyles } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the weekday header, and the offsets that put more than one month\n// side by side. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\nfunction CalendarGridHeader(): ReactElement {\n return <RACCalendarGridHeader>{calendarHeaderCell}</RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell)}>\n {day}\n </RACCalendarHeaderCell>;\n}\nfunction chevronClassName() {\n return stylex.props(calendarStyles.chevron).className ?? '';\n}\nexport { CalendarGridHeader, CalendarHeader };"],"mappings":";;;;;;;AAWA,SAAA,uBAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACS,KAAA,oBAAC,oBAAD,EAAA,UAAwB,mBAAF,CAAA;EAA6C,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAnE;AAAmE;;;;;;;;;;;;AAc5E,SAAA,iBAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACkB,KAAA,MAAa,eAAc,MAAO;EAAC,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAC/C,KAAA,oBAAC,QAAD;GAAsBC,WAAA;GAAuB,MAAA;GAC3C,UAAA,oBAAC,iBAAD,EAAgB,GAAK,MAAa,eAAc,cAAe,eAAc,oBAAqB,EAAC,CAAA;EAD3F,CAAA;EAEE,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACZ,KAAA,oBAAC,SAAD,EAAW,GAAK,MAAa,eAAc,OAAQ,EAAC,CAAA;EAAI,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAJrD,KAAA,qBAAA,OAAA;GAQC,GARQ;GAAT,UAAA;IACH;IAGA;IACA,oBAAC,QAAD;KAAsBA,WAAA;KAAuB,MAAA;KAC3C,UAAA,oBAAC,iBAAD,EAAgB,GAAK,MAAa,eAAc,YAAa,EAAC,CAAA;IADtD,CAAA;GAGN;;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OARD;AAQC;;AAIV,SAAS,mBAAmB,KAA2B;CACrD,OAAO,oBAAC,oBAAD;EAAuB,GAAI,MAAa,eAAe,UAAU;EACnE,UAAA;CACoB,CAAA;AAC3B;AACA,SAAS,mBAAmB;CAC1B,OAAO,MAAa,eAAe,OAAO,CAAC,CAAC,aAAa;AAC3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/calendar/months.ts
|
|
2
|
+
/**
|
|
3
|
+
* One offset per visible month, so `visibleDuration` of more than one draws
|
|
4
|
+
* the months side by side rather than one grid that scrolls between them.
|
|
5
|
+
* React Aria positions each grid from its own offset; the heading names the
|
|
6
|
+
* whole range, which is what its own `Heading` renders.
|
|
7
|
+
*/
|
|
8
|
+
function monthOffsets(months) {
|
|
9
|
+
return Array.from({ length: Math.max(1, months) }, (_unused, index) => ({ months: index }));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { monthOffsets };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=months.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"months.js","names":[],"sources":["../../src/calendar/months.ts"],"sourcesContent":["// 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/**\n * One offset per visible month, so `visibleDuration` of more than one draws\n * the months side by side rather than one grid that scrolls between them.\n * React Aria positions each grid from its own offset; the heading names the\n * whole range, which is what its own `Heading` renders.\n */\nfunction monthOffsets(months: number) {\n return Array.from({ length: Math.max(1, months) }, (_unused, index) => ({\n months: index,\n }))\n}\n\nexport { monthOffsets }\n"],"mappings":";;;;;;;AASA,SAAS,aAAa,QAAgB;CACpC,OAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EACtE,QAAQ,MACV,EAAE;AACJ"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//#region src/calendar/styles.ts
|
|
2
|
+
const calendarStyles = {
|
|
3
|
+
cell: {
|
|
4
|
+
kGNEyG: "x6s0dn4",
|
|
5
|
+
kWkggS: "x83qkoq x1p2om7n xjbqb8w",
|
|
6
|
+
kZKoxP: "x1vqgdyp",
|
|
7
|
+
kaIpWk: "x3y1ksm",
|
|
8
|
+
kB7OPa: "x9f619",
|
|
9
|
+
kMwMTN: "x139gbkf",
|
|
10
|
+
kkrTdU: "x1ypdohk",
|
|
11
|
+
k1xSpc: "x78zum5",
|
|
12
|
+
kMv6JI: "x16svsjw",
|
|
13
|
+
kGuDYH: "x1848etk",
|
|
14
|
+
k63SB2: "x1c52epr",
|
|
15
|
+
kzqmXN: "x100vrsf",
|
|
16
|
+
kjj79g: "xl56j7k",
|
|
17
|
+
kb6lSQ: "x1qn8t5l",
|
|
18
|
+
kLWn49: "xh7dzej",
|
|
19
|
+
kUOVxO: "x34s64n",
|
|
20
|
+
kjBf7l: "xrgy624",
|
|
21
|
+
kInvED: "x1hl8ikr",
|
|
22
|
+
k3XXqK: "x9v5kkp x1t137rt",
|
|
23
|
+
kMeerF: "x1de99jn",
|
|
24
|
+
$$css: true
|
|
25
|
+
},
|
|
26
|
+
cellDisabled: {
|
|
27
|
+
kWkggS: "xjbqb8w",
|
|
28
|
+
kMwMTN: "x9w6zvh",
|
|
29
|
+
kkrTdU: "x1h6gzvc",
|
|
30
|
+
$$css: true
|
|
31
|
+
},
|
|
32
|
+
cellInRange: {
|
|
33
|
+
kWkggS: "x1mpme18 x1q7sp4o x15dekr4",
|
|
34
|
+
kaIpWk: "x2u8bby",
|
|
35
|
+
kMwMTN: "x1sawysd",
|
|
36
|
+
kzqmXN: "xh8yej3",
|
|
37
|
+
kUOVxO: "xrxpjvj",
|
|
38
|
+
$$css: true
|
|
39
|
+
},
|
|
40
|
+
cellRangeEnd: {
|
|
41
|
+
kT0f0o: "x1mh50ju",
|
|
42
|
+
kfmiAY: "x13dhofw",
|
|
43
|
+
$$css: true
|
|
44
|
+
},
|
|
45
|
+
cellRangeStart: {
|
|
46
|
+
kVL7Gh: "xqmr837",
|
|
47
|
+
krdFHd: "xz4iguh",
|
|
48
|
+
$$css: true
|
|
49
|
+
},
|
|
50
|
+
cellSelected: {
|
|
51
|
+
kWkggS: "x1nik15g x1q2w5h1 xnety89",
|
|
52
|
+
kMwMTN: "xwjo7ld",
|
|
53
|
+
$$css: true
|
|
54
|
+
},
|
|
55
|
+
cellToday: {
|
|
56
|
+
kVAM5u: "x1uajy3w",
|
|
57
|
+
ksu8eU: "x1y0btm7",
|
|
58
|
+
kMzoRj: "xmkeg23",
|
|
59
|
+
kMwMTN: "x1mxwv8y",
|
|
60
|
+
$$css: true
|
|
61
|
+
},
|
|
62
|
+
chevron: {
|
|
63
|
+
kGNEyG: "x6s0dn4",
|
|
64
|
+
kWkggS: "x1dg9itu x1728qcm xjbqb8w",
|
|
65
|
+
kZKoxP: "x1vqgdyp",
|
|
66
|
+
kaIpWk: "x3y1ksm",
|
|
67
|
+
kMzoRj: "xc342km",
|
|
68
|
+
kB7OPa: "x9f619",
|
|
69
|
+
kMwMTN: "x1w5n3ug",
|
|
70
|
+
kkrTdU: "x1ypdohk",
|
|
71
|
+
k1xSpc: "x78zum5",
|
|
72
|
+
kmuXW: "x2lah0s",
|
|
73
|
+
kzqmXN: "x100vrsf",
|
|
74
|
+
kjj79g: "xl56j7k",
|
|
75
|
+
kUOVxO: "x34s64n",
|
|
76
|
+
kjBf7l: "xrgy624",
|
|
77
|
+
kInvED: "x1hl8ikr",
|
|
78
|
+
k3XXqK: "x9v5kkp x1t137rt",
|
|
79
|
+
kMeerF: "x1de99jn",
|
|
80
|
+
kmVPX3: "x1717udv",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
83
|
+
chevronGlyph: {
|
|
84
|
+
kZKoxP: "xxk0z11",
|
|
85
|
+
kzqmXN: "xvy4d1p",
|
|
86
|
+
k3aq6I: "x19axjrm x1c071of",
|
|
87
|
+
$$css: true
|
|
88
|
+
},
|
|
89
|
+
chevronGlyphPrevious: {
|
|
90
|
+
k3aq6I: "xdg80k9 xpk2tj9",
|
|
91
|
+
$$css: true
|
|
92
|
+
},
|
|
93
|
+
grid: {
|
|
94
|
+
kLvRdT: "x1vathgz",
|
|
95
|
+
kheTzg: "x1gukg7c",
|
|
96
|
+
kzqmXN: "xh8yej3",
|
|
97
|
+
$$css: true
|
|
98
|
+
},
|
|
99
|
+
header: {
|
|
100
|
+
kGNEyG: "x6s0dn4",
|
|
101
|
+
k1xSpc: "x78zum5",
|
|
102
|
+
kOIVth: "x126z3so",
|
|
103
|
+
kjj79g: "x1qughib",
|
|
104
|
+
kAzted: "x1ba4aug",
|
|
105
|
+
$$css: true
|
|
106
|
+
},
|
|
107
|
+
headerCell: {
|
|
108
|
+
kZKoxP: "x1vqgdyp",
|
|
109
|
+
kMwMTN: "x139gbkf",
|
|
110
|
+
kMv6JI: "x16svsjw",
|
|
111
|
+
kGuDYH: "x1848etk",
|
|
112
|
+
k63SB2: "x1c52epr",
|
|
113
|
+
kb6lSQ: "x1qn8t5l",
|
|
114
|
+
kLWn49: "xh7dzej",
|
|
115
|
+
$$css: true
|
|
116
|
+
},
|
|
117
|
+
heading: {
|
|
118
|
+
kMwMTN: "x1w5n3ug",
|
|
119
|
+
kMv6JI: "xkknnkr",
|
|
120
|
+
kGuDYH: "x14zspaw",
|
|
121
|
+
k63SB2: "x1v9cpvo",
|
|
122
|
+
kb6lSQ: "x155f00i",
|
|
123
|
+
kLWn49: "x1lz68p4",
|
|
124
|
+
kogj98: "x1ghz6dp",
|
|
125
|
+
k9WMMc: "x2b8uid",
|
|
126
|
+
$$css: true
|
|
127
|
+
},
|
|
128
|
+
months: {
|
|
129
|
+
k1xSpc: "x78zum5",
|
|
130
|
+
kOIVth: "xj2l1yv",
|
|
131
|
+
$$css: true
|
|
132
|
+
},
|
|
133
|
+
root: {
|
|
134
|
+
kWkggS: "xvkjz1l",
|
|
135
|
+
kaIpWk: "xhpdng0",
|
|
136
|
+
kB7OPa: "x9f619",
|
|
137
|
+
kMwMTN: "x139gbkf",
|
|
138
|
+
k1xSpc: "x78zum5",
|
|
139
|
+
kXwgrk: "xdt5ytf",
|
|
140
|
+
kOIVth: "x1gka490",
|
|
141
|
+
kzqmXN: "xeq5yr9",
|
|
142
|
+
k7Eaqz: "x1gvwcb",
|
|
143
|
+
kmVPX3: "xa36j16",
|
|
144
|
+
$$css: true
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { calendarStyles };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":[],"sources":["../../src/calendar/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The styles Calendar and RangeCalendar both draw. Apart from either\n// component so the two cannot drift, and outside `src/components` because a\n// directory there is a public component with stories, a barrel entry and a\n// `styling.test.tsx` case — which shared styles are none of.\n//\n// The values are the date pickers page's docked calendar, named in\n// `src/components/calendar/index.tsx` along with the departures from it. What\n// is only a range's — the band between the two ends — is marked as the\n// library's own where it is defined, since the page tokenises no such thing.\n\nconst calendarStyles = {\n cell: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x83qkoq x1p2om7n xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x3y1ksm\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kUOVxO: \"x34s64n\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n cellDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n cellInRange: {\n kWkggS: \"x1mpme18 x1q7sp4o x15dekr4\",\n kaIpWk: \"x2u8bby\",\n kMwMTN: \"x1sawysd\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xrxpjvj\",\n $$css: true\n },\n cellRangeEnd: {\n kT0f0o: \"x1mh50ju\",\n kfmiAY: \"x13dhofw\",\n $$css: true\n },\n cellRangeStart: {\n kVL7Gh: \"xqmr837\",\n krdFHd: \"xz4iguh\",\n $$css: true\n },\n cellSelected: {\n kWkggS: \"x1nik15g x1q2w5h1 xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n cellToday: {\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1dg9itu x1728qcm xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kUOVxO: \"x34s64n\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n chevronGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n k3aq6I: \"x19axjrm x1c071of\",\n $$css: true\n },\n chevronGlyphPrevious: {\n k3aq6I: \"xdg80k9 xpk2tj9\",\n $$css: true\n },\n grid: {\n kLvRdT: \"x1vathgz\",\n kheTzg: \"x1gukg7c\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x1qughib\",\n kAzted: \"x1ba4aug\",\n $$css: true\n },\n headerCell: {\n kZKoxP: \"x1vqgdyp\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n heading: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n months: {\n k1xSpc: \"x78zum5\",\n kOIVth: \"xj2l1yv\",\n $$css: true\n },\n root: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"xhpdng0\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kzqmXN: \"xeq5yr9\",\n k7Eaqz: \"x1gvwcb\",\n kmVPX3: \"xa36j16\",\n $$css: true\n }\n};\nexport { calendarStyles };"],"mappings":";AAcA,MAAM,iBAAiB;CACrB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,sBAAsB;EACpB,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CalendarProps, DateValue } from "react-aria-components";
|
|
2
|
+
//#region src/components/calendar/index.d.ts
|
|
3
|
+
type CalendarProps$1<T extends DateValue> = Omit<CalendarProps<T>, 'children' | 'className' | 'style'> & {
|
|
4
|
+
/** A function may compute the class from the calendar's render state. */
|
|
5
|
+
className?: CalendarProps<T>['className'];
|
|
6
|
+
/** A function may compute the style from the calendar's render state. */
|
|
7
|
+
style?: CalendarProps<T>['style'];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A month calendar for picking a date. The value is React Aria's: pass
|
|
11
|
+
* `value` with `onChange` to control it, or `defaultValue` to let it keep its
|
|
12
|
+
* own, both as an `@internationalized/date` value from this package's
|
|
13
|
+
* `./date` subpath.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { today, getLocalTimeZone } from '@kanso-labs/kanso-ui/date'
|
|
17
|
+
*
|
|
18
|
+
* <Calendar aria-label="Label" defaultValue={today(getLocalTimeZone())} />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* `minValue` and `maxValue` bound it, `isDateUnavailable` rules individual
|
|
22
|
+
* dates out, and `visibleDuration` of `{ months: 2 }` draws two months side
|
|
23
|
+
* by side. Name it with `aria-label` or `aria-labelledby`; React Aria
|
|
24
|
+
* composes the visible month into that name itself.
|
|
25
|
+
*
|
|
26
|
+
* The call site's `className` and `style` land on the container, which is the
|
|
27
|
+
* element a layout positions.
|
|
28
|
+
*/
|
|
29
|
+
declare function Calendar$1<T extends DateValue>(props: CalendarProps$1<T>): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { type CalendarProps$1 as CalendarProps, Calendar$1 as default };
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
3
|
+
import { calendarStyles } from "../../calendar/styles.js";
|
|
4
|
+
import { CalendarGridHeader as CalendarGridHeader$1, CalendarHeader } from "../../calendar/index.js";
|
|
5
|
+
import { monthOffsets } from "../../calendar/months.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { Calendar, CalendarCell, CalendarGrid, CalendarGridBody } from "react-aria-components";
|
|
9
|
+
//#region src/components/calendar/index.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A month calendar for picking a date. The value is React Aria's: pass
|
|
12
|
+
* `value` with `onChange` to control it, or `defaultValue` to let it keep its
|
|
13
|
+
* own, both as an `@internationalized/date` value from this package's
|
|
14
|
+
* `./date` subpath.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { today, getLocalTimeZone } from '@kanso-labs/kanso-ui/date'
|
|
18
|
+
*
|
|
19
|
+
* <Calendar aria-label="Label" defaultValue={today(getLocalTimeZone())} />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* `minValue` and `maxValue` bound it, `isDateUnavailable` rules individual
|
|
23
|
+
* dates out, and `visibleDuration` of `{ months: 2 }` draws two months side
|
|
24
|
+
* by side. Name it with `aria-label` or `aria-labelledby`; React Aria
|
|
25
|
+
* composes the visible month into that name itself.
|
|
26
|
+
*
|
|
27
|
+
* The call site's `className` and `style` land on the container, which is the
|
|
28
|
+
* element a layout positions.
|
|
29
|
+
*/
|
|
30
|
+
function Calendar$1(props$1) {
|
|
31
|
+
const $ = c(12);
|
|
32
|
+
let t0;
|
|
33
|
+
if ($[0] !== props$1) {
|
|
34
|
+
t0 = mergeStatefulStyles(props(calendarStyles.root), props$1);
|
|
35
|
+
$[0] = props$1;
|
|
36
|
+
$[1] = t0;
|
|
37
|
+
} else t0 = $[1];
|
|
38
|
+
let t1;
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t1 = /* @__PURE__ */ jsx(CalendarHeader, {});
|
|
42
|
+
t2 = props(calendarStyles.months);
|
|
43
|
+
$[2] = t1;
|
|
44
|
+
$[3] = t2;
|
|
45
|
+
} else {
|
|
46
|
+
t1 = $[2];
|
|
47
|
+
t2 = $[3];
|
|
48
|
+
}
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[4] !== props$1.visibleDuration?.months) {
|
|
51
|
+
t3 = monthOffsets(props$1.visibleDuration?.months ?? 1).map(_temp);
|
|
52
|
+
$[4] = props$1.visibleDuration?.months;
|
|
53
|
+
$[5] = t3;
|
|
54
|
+
} else t3 = $[5];
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[6] !== t3) {
|
|
57
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
58
|
+
...t2,
|
|
59
|
+
children: t3
|
|
60
|
+
});
|
|
61
|
+
$[6] = t3;
|
|
62
|
+
$[7] = t4;
|
|
63
|
+
} else t4 = $[7];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[8] !== props$1 || $[9] !== t0 || $[10] !== t4) {
|
|
66
|
+
t5 = /* @__PURE__ */ jsxs(Calendar, {
|
|
67
|
+
...props$1,
|
|
68
|
+
...t0,
|
|
69
|
+
children: [t1, t4]
|
|
70
|
+
});
|
|
71
|
+
$[8] = props$1;
|
|
72
|
+
$[9] = t0;
|
|
73
|
+
$[10] = t4;
|
|
74
|
+
$[11] = t5;
|
|
75
|
+
} else t5 = $[11];
|
|
76
|
+
return t5;
|
|
77
|
+
}
|
|
78
|
+
function _temp(offset) {
|
|
79
|
+
return /* @__PURE__ */ jsxs(CalendarGrid, {
|
|
80
|
+
offset,
|
|
81
|
+
...props(calendarStyles.grid),
|
|
82
|
+
children: [/* @__PURE__ */ jsx(CalendarGridHeader$1, {}), /* @__PURE__ */ jsx(CalendarGridBody, { children: gridCell })]
|
|
83
|
+
}, offset.months);
|
|
84
|
+
}
|
|
85
|
+
function cellClassName(state) {
|
|
86
|
+
return props(calendarStyles.cell, state.isToday && calendarStyles.cellToday, state.isSelected && calendarStyles.cellSelected, state.isDisabled && calendarStyles.cellDisabled).className ?? "";
|
|
87
|
+
}
|
|
88
|
+
function gridCell(date) {
|
|
89
|
+
return /* @__PURE__ */ jsx(CalendarCell, {
|
|
90
|
+
className: cellClassName,
|
|
91
|
+
date
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Calendar$1 as default };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["offset","gridCell"],"sources":["../../../src/components/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement } from 'react';\nimport type { DateValue, CalendarProps as RACCalendarProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Calendar as RACCalendar, CalendarCell as RACCalendarCell, CalendarGrid as RACCalendarGrid, CalendarGridBody as RACCalendarGridBody } from 'react-aria-components';\nimport { CalendarGridHeader, CalendarHeader } from '../../calendar';\nimport { monthOffsets } from '../../calendar/months';\nimport { calendarStyles } from '../../calendar/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The date pickers page's docked calendar: a month grid with a circle on the\n// selected date and an outline on today. Its values are that page's — a\n// 360dp container on the high surface container, 48dp date cells with a 40dp\n// state layer inside them, body-large for both the weekday row and the dates,\n// primary for the selected circle and for today's outline.\n//\n// The page's container is 456dp tall, which this does not fix: that height is\n// a picker's, counting a headline and an action row the calendar itself does\n// not draw. A month grid is as tall as its weeks, and six-week months are\n// taller than five-week ones — pinning 456 would crop one or pad the other.\n//\n// Three things are this component's own.\n//\n// **The cell is a circle in a square.** The page gives the date a 48dp\n// container and a 40dp state layer, which is a 40dp circle with 4dp of room\n// around it. The grid's `border-spacing` is what supplies that room, so the\n// circle is the element and the square is the space between circles — rather\n// than a 48dp box with a 40dp box inside it.\n//\n// **A date from the month either side is faded because it is disabled, not\n// because it is outside.** React Aria marks those cells `data-outside-month`\n// and disables them in the same breath, so a treatment keyed on the first\n// would never draw anything the second had not already drawn. The disabled\n// fade is the page's 38% either way.\n//\n// **Today reads as today whether or not it is selected.** The page gives it\n// an outline and the primary label; selected gives it a filled circle and the\n// on-primary label. A selected today takes the fill, since a circle already\n// says where you are and two rings would say it twice.\n//\n// **The month is moved by IconButton's shape rather than by IconButton.**\n// React Aria wires `slot=\"previous\"` and `slot=\"next\"` on its own `Button`,\n// and IconButton renders React Aria's `Button` too — so nesting one inside\n// the slot would put two buttons where the page draws one. The chevrons take\n// the standard icon button's 40dp square and its state layer instead.\n\ntype CalendarProps<T extends DateValue> = Omit<RACCalendarProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the calendar's render state. */\n className?: RACCalendarProps<T>['className'];\n /** A function may compute the style from the calendar's render state. */\n style?: RACCalendarProps<T>['style'];\n};\n\n/**\n * A month calendar for picking a date. The value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep its\n * own, both as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { today, getLocalTimeZone } from '@kanso-labs/kanso-ui/date'\n *\n * <Calendar aria-label=\"Label\" defaultValue={today(getLocalTimeZone())} />\n * ```\n *\n * `minValue` and `maxValue` bound it, `isDateUnavailable` rules individual\n * dates out, and `visibleDuration` of `{ months: 2 }` draws two months side\n * by side. Name it with `aria-label` or `aria-labelledby`; React Aria\n * composes the visible month into that name itself.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction Calendar<T extends DateValue>(props: CalendarProps<T>) {\n return <RACCalendar<T> {...props} {...mergeStatefulStyles(stylex.props(calendarStyles.root), props)}>\n <CalendarHeader />\n <div {...stylex.props(calendarStyles.months)}>\n {monthOffsets(props.visibleDuration?.months ?? 1).map(offset => <RACCalendarGrid key={offset.months} offset={offset} {...stylex.props(calendarStyles.grid)}>\n <CalendarGridHeader />\n <RACCalendarGridBody>{gridCell}</RACCalendarGridBody>\n </RACCalendarGrid>)}\n </div>\n </RACCalendar>;\n}\n\n// A date's classes, from React Aria's render state. StyleX cannot target\n// `[data-selected]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters. `selected` is applied after `today`, so a selected today\n// takes the fill rather than the outline — a circle already says where you\n// are, and two rings would say it twice. `disabled` is last of all, and\n// StyleX replaces a property whole, so it takes the hover branches with it.\nfunction cellClassName(state: {\n isDisabled: boolean;\n isSelected: boolean;\n isToday: boolean;\n}) {\n return stylex.props(calendarStyles.cell, state.isToday && calendarStyles.cellToday, state.isSelected && calendarStyles.cellSelected, state.isDisabled && calendarStyles.cellDisabled).className ?? '';\n}\nfunction gridCell(date: CalendarDate): ReactElement {\n return <RACCalendarCell className={cellClassName} date={date} />;\n}\nexport type { CalendarProps };\nexport default Calendar;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,SAAA,WAAA,SAAA;CAAA,MAAA,IAAA,EAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA;EACwC,KAAA,oBAAoB,MAAa,eAAc,IAAK,GAAG,OAAK;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAC/F,KAAA,oBAAC,gBAAD,CAAe,CAAA;EACN,KAAA,MAAa,eAAc,MAAO;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,QAAA,iBAAA,QAAA;EACzC,KAAA,aAAa,QAAK,iBAAwB,UAA7B,CAAkC,CAAC,CAAA,IAAK,KAGlC;EAAC,EAAA,KAAA,QAAA,iBAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAJvB,KAAA,oBAAA,OAAA;GAKM,GALG;GACN,UAAA;EAIG,CAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA,EAAA,OAAA,MAAA,EAAA,QAAA,IAAA;EAPH,KAAA,qBAAC,UAAD;GAAY,GAAQ;GAAK,GAAM;GAA/B,UAAA,CACH,IACA,EAFe;;EAQH,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OART;AAQS;AATlB,SAAA,MAAA,QAAA;CAAA,OAIwE,qBAAC,cAAD;EAA6C;EAAM,GAAM,MAAa,eAAc,IAAK;EAAzF,UAAA,CAC5D,oBAAC,sBAAD,CAAmB,CAAA,GACnB,oBAAC,kBAAD,EAAA,UAAsB,SAAF,CAAA,CAFwD;CAAM,GAAA,OAAM,MAAZ;AAG5D;AAa5B,SAAS,cAAc,OAIpB;CACD,OAAO,MAAa,eAAe,MAAM,MAAM,WAAW,eAAe,WAAW,MAAM,cAAc,eAAe,cAAc,MAAM,cAAc,eAAe,YAAY,CAAC,CAAC,aAAa;AACrM;AACA,SAAS,SAAS,MAAkC;CAClD,OAAO,oBAAC,cAAD;EAAiB,WAAW;EAAqB;CAAK,CAAA;AAC/D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ColorSliderProps } from "react-aria-components";
|
|
2
|
+
//#region src/components/color-slider/index.d.ts
|
|
3
|
+
type ColorSliderProps$1 = Omit<ColorSliderProps, 'children' | 'className' | 'style'> & {
|
|
4
|
+
/** A function may compute the class from the slider's render state. */
|
|
5
|
+
className?: ColorSliderProps['className'];
|
|
6
|
+
/** What the slider is for. Always rendered; React Aria names the channel otherwise. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the value React Aria announces is also shown, at the end of the
|
|
10
|
+
* label's line.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
showValue?: boolean;
|
|
14
|
+
/** A function may compute the style from the slider's render state. */
|
|
15
|
+
style?: ColorSliderProps['style'];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A slider over one channel of a colour — hue, saturation, lightness, alpha
|
|
19
|
+
* and the rest. The value is React Aria's: pass `value` with `onChange` to
|
|
20
|
+
* control it, or `defaultValue`, as a CSS colour string or a `Color` from
|
|
21
|
+
* `parseColor`, which this package re-exports.
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <ColorSlider channel="hue" defaultValue="hsl(200, 100%, 50%)" label="Label" />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* **`channel` has to name a channel the value's own space has.** A hex or
|
|
28
|
+
* `rgb()` value parses as RGB, which has no hue, so `channel="hue"` against
|
|
29
|
+
* one throws rather than converting — pass `colorSpace="hsl"` to convert it,
|
|
30
|
+
* or give the value in the space you mean to slide.
|
|
31
|
+
*
|
|
32
|
+
* React Aria paints the gradient and names the value — "200°, cyan blue" —
|
|
33
|
+
* so the readout beside the label is what it announces.
|
|
34
|
+
*
|
|
35
|
+
* The call site's `className` and `style` land on the slider as a whole,
|
|
36
|
+
* which is the element a layout positions.
|
|
37
|
+
*/
|
|
38
|
+
declare function ColorSlider$1({ isDisabled, label, showValue, ...props }: ColorSliderProps$1): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { type ColorSliderProps$1 as ColorSliderProps, ColorSlider$1 as default };
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
3
|
+
import { FieldLabel } from "../../field/index.js";
|
|
4
|
+
import { chequer } from "../../styles/chequer.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ColorSlider, ColorThumb, SliderOutput, SliderTrack } from "react-aria-components";
|
|
7
|
+
//#region src/components/color-slider/index.tsx
|
|
8
|
+
const styles = {
|
|
9
|
+
trackGround: {
|
|
10
|
+
kZKoxP: "xlup9mm",
|
|
11
|
+
kaIpWk: "x1xdvaa9",
|
|
12
|
+
kB7OPa: "x9f619",
|
|
13
|
+
kzqmXN: "xh8yej3",
|
|
14
|
+
kqGvvJ: "x2k5q2m",
|
|
15
|
+
$$css: true
|
|
16
|
+
},
|
|
17
|
+
trackGroundDisabled: {
|
|
18
|
+
kSiTet: "x1ppv7y9",
|
|
19
|
+
$$css: true
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A slider over one channel of a colour — hue, saturation, lightness, alpha
|
|
24
|
+
* and the rest. The value is React Aria's: pass `value` with `onChange` to
|
|
25
|
+
* control it, or `defaultValue`, as a CSS colour string or a `Color` from
|
|
26
|
+
* `parseColor`, which this package re-exports.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <ColorSlider channel="hue" defaultValue="hsl(200, 100%, 50%)" label="Label" />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* **`channel` has to name a channel the value's own space has.** A hex or
|
|
33
|
+
* `rgb()` value parses as RGB, which has no hue, so `channel="hue"` against
|
|
34
|
+
* one throws rather than converting — pass `colorSpace="hsl"` to convert it,
|
|
35
|
+
* or give the value in the space you mean to slide.
|
|
36
|
+
*
|
|
37
|
+
* React Aria paints the gradient and names the value — "200°, cyan blue" —
|
|
38
|
+
* so the readout beside the label is what it announces.
|
|
39
|
+
*
|
|
40
|
+
* The call site's `className` and `style` land on the slider as a whole,
|
|
41
|
+
* which is the element a layout positions.
|
|
42
|
+
*/
|
|
43
|
+
function ColorSlider$1({ isDisabled = false, label, showValue = true, ...props$1 }) {
|
|
44
|
+
return /* @__PURE__ */ jsxs(ColorSlider, {
|
|
45
|
+
isDisabled,
|
|
46
|
+
...props$1,
|
|
47
|
+
...mergeStatefulStyles({ className: "x9f619 x78zum5 xdt5ytf xzoy561 xh8yej3" }, props$1),
|
|
48
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "x1pha0wt x78zum5 x126z3so",
|
|
50
|
+
children: [label === void 0 ? null : /* @__PURE__ */ jsx(FieldLabel, {
|
|
51
|
+
className: "xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4",
|
|
52
|
+
children: label
|
|
53
|
+
}), showValue ? /* @__PURE__ */ jsx(SliderOutput, { className: "x1w5n3ug x1yicsit x1b35g6e xwth0xh xybisxh xvc5jky" }) : null]
|
|
54
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
55
|
+
...props(chequer.ground, styles.trackGround, isDisabled && styles.trackGroundDisabled),
|
|
56
|
+
children: /* @__PURE__ */ jsx(SliderTrack, {
|
|
57
|
+
...{
|
|
58
|
+
0: { className: "x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6" },
|
|
59
|
+
1: { className: "x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc" }
|
|
60
|
+
}[!!isDisabled << 0],
|
|
61
|
+
children: /* @__PURE__ */ jsx(ColorThumb, { className: thumbClassName })
|
|
62
|
+
})
|
|
63
|
+
})]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function thumbClassName(state) {
|
|
67
|
+
return {
|
|
68
|
+
0: { className: "x1qx5ct2 x3y1ksm xlzcsym x9f619 x1jm3nie xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7" },
|
|
69
|
+
4: { className: "x1qx5ct2 x3y1ksm xlzcsym x9f619 x1jm3nie xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59" },
|
|
70
|
+
2: { className: "x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1kr41ut xi9pz9s" },
|
|
71
|
+
6: { className: "x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1kr41ut xi9pz9s" },
|
|
72
|
+
1: { className: "x1qx5ct2 x3y1ksm xlzcsym x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1h6gzvc" },
|
|
73
|
+
5: { className: "x1qx5ct2 x3y1ksm xlzcsym x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1h6gzvc" },
|
|
74
|
+
3: { className: "x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1kr41ut x1h6gzvc" },
|
|
75
|
+
7: { className: "x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1kr41ut x1h6gzvc" }
|
|
76
|
+
}[!!state.isFocusVisible << 2 | !!state.isDragging << 1 | !!state.isDisabled << 0].className ?? "";
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { ColorSlider$1 as default };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/color-slider/index.tsx"],"sourcesContent":["import type { ColorThumbRenderProps, ColorSliderProps as RACColorSliderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ColorSlider as RACColorSlider, ColorThumb as RACColorThumb, SliderOutput as RACSliderOutput, SliderTrack as RACSliderTrack } from 'react-aria-components';\nimport { FieldLabel } from '../../field';\nimport { chequer } from '../../styles/chequer';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The sliders page's track, carrying one channel of a colour instead of an\n// active and an inactive part: the page's 16dp strip with its 8dp corner,\n// centred in the 44dp a handle takes, and the same label-large label above\n// it. React Aria paints the gradient itself, on the track's own inline\n// `background`, so what runs along the strip is the channel rather than\n// anything chosen here.\n//\n// Three things depart from the page, each because a colour slider shows a\n// value the page's slider does not have.\n//\n// **The handle is a circle carrying the colour, not the page's 4dp bar.**\n// The page's handle is a mark on a track whose colour it already knows; this\n// one has to show the value it sits on, and 4dp of a colour is not a colour\n// anyone can read. It keeps the page's 44dp of height as the target it is\n// centred in.\n//\n// **The handle is ringed rather than filled with primary.** Its fill is the\n// value, so the ring is what has to read against it — and against every\n// other colour the track runs through. It is a surface-coloured ring with a\n// hairline outside it, which reads on a light track and a dark one alike.\n//\n// **There is no stop at the inactive end.** The page puts one 6dp from the\n// end of the inactive part; a channel has no inactive part, so there is no\n// end for it to mark.\n//\n// The alpha channel is the one that needs a chequer, for the reason\n// `src/styles/chequer.ts` gives: a track fading to transparent over a light\n// surface and one fading to white are the same pixels without it.\n\nconst styles = {\n trackGround: {\n kZKoxP: \"xlup9mm\",\n kaIpWk: \"x1xdvaa9\",\n kB7OPa: \"x9f619\",\n kzqmXN: \"xh8yej3\",\n kqGvvJ: \"x2k5q2m\",\n $$css: true\n },\n trackGroundDisabled: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n }\n};\ntype ColorSliderProps = Omit<RACColorSliderProps, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the slider's render state. */\n className?: RACColorSliderProps['className'];\n /** What the slider is for. Always rendered; React Aria names the channel otherwise. */\n label?: string;\n /**\n * Whether the value React Aria announces is also shown, at the end of the\n * label's line.\n * @default true\n */\n showValue?: boolean;\n /** A function may compute the style from the slider's render state. */\n style?: RACColorSliderProps['style'];\n};\n\n/**\n * A slider over one channel of a colour — hue, saturation, lightness, alpha\n * and the rest. The value is React Aria's: pass `value` with `onChange` to\n * control it, or `defaultValue`, as a CSS colour string or a `Color` from\n * `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorSlider channel=\"hue\" defaultValue=\"hsl(200, 100%, 50%)\" label=\"Label\" />\n * ```\n *\n * **`channel` has to name a channel the value's own space has.** A hex or\n * `rgb()` value parses as RGB, which has no hue, so `channel=\"hue\"` against\n * one throws rather than converting — pass `colorSpace=\"hsl\"` to convert it,\n * or give the value in the space you mean to slide.\n *\n * React Aria paints the gradient and names the value — \"200°, cyan blue\" —\n * so the readout beside the label is what it announces.\n *\n * The call site's `className` and `style` land on the slider as a whole,\n * which is the element a layout positions.\n */\nfunction ColorSlider({\n isDisabled = false,\n label,\n showValue = true,\n ...props\n}: ColorSliderProps) {\n return <RACColorSlider isDisabled={isDisabled} {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf xzoy561 xh8yej3\"\n }, props)}>\n <div className=\"x1pha0wt x78zum5 x126z3so\">\n {label === undefined ? null : <FieldLabel className=\"xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\">{label}</FieldLabel>}\n {showValue ? <RACSliderOutput className=\"x1w5n3ug x1yicsit x1b35g6e xwth0xh xybisxh xvc5jky\" /> : null}\n </div>\n <div {...stylex.props(chequer.ground, styles.trackGround, isDisabled && styles.trackGroundDisabled)}>\n <RACSliderTrack {...{\n 0: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 x1ypdohk xh8yej3 x1n2onr6\"\n },\n 1: {\n className: \"x1cpjm7i x1mtdikz xm4btww x1hmns74 x5yr21d x9f619 xh8yej3 x1n2onr6 x1h6gzvc\"\n }\n }[!!isDisabled << 0]}>\n <RACColorThumb className={thumbClassName} />\n </RACSliderTrack>\n </div>\n </RACColorSlider>;\n}\n\n// The handle's classes, from React Aria's render state. StyleX cannot target\n// `[data-dragging]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// `dragging` is applied after `focused`, and StyleX replaces a property\n// whole, so a handle being dragged takes the lifted shadow rather than\n// keeping the resting ring under it.\nfunction thumbClassName(state: ColorThumbRenderProps) {\n return {\n 0: {\n className: \"x1qx5ct2 x3y1ksm xlzcsym x9f619 x1jm3nie xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7\"\n },\n 4: {\n className: \"x1qx5ct2 x3y1ksm xlzcsym x9f619 x1jm3nie xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59\"\n },\n 2: {\n className: \"x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1kr41ut xi9pz9s\"\n },\n 6: {\n className: \"x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1kr41ut xi9pz9s\"\n },\n 1: {\n className: \"x1qx5ct2 x3y1ksm xlzcsym x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1h6gzvc\"\n },\n 5: {\n className: \"x1qx5ct2 x3y1ksm xlzcsym x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1h6gzvc\"\n },\n 3: {\n className: \"x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1t137rt x1de99jn x1qno0dh xkdsq27 xpc4ca7 x1kr41ut x1h6gzvc\"\n },\n 7: {\n className: \"x1qx5ct2 x3y1ksm x9f619 xw4jnvo xwa60dl xrgy624 x2wh2y9 x1de99jn x1qno0dh xkdsq27 xpc4ca7 xaatb59 x1kr41ut x1h6gzvc\"\n }\n }[!!state.isFocusVisible << 2 | !!state.isDragging << 1 | !!state.isDisabled << 0].className ?? '';\n}\nexport type { ColorSliderProps };\nexport default ColorSlider;"],"mappings":";;;;;;;AAsCA,MAAM,SAAS;CACb,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,qBAAqB;EACnB,QAAQ;EACR,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAS,cAAY,EACnB,aAAa,OACb,OACA,YAAY,MACZ,GAAG,WACgB;CACnB,OAAO,qBAAC,aAAD;EAA4B;EAAY,GAAI;EAAO,GAAI,oBAAoB,EAChF,WAAW,yCACb,GAAG,OAAK;EAFD,UAAA,CAGH,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,UAAU,KAAA,IAAY,OAAO,oBAAC,YAAD;IAAY,WAAU;IAA+C,UAAA;GAAkB,CAAA,GACpH,YAAY,oBAAC,cAAD,EAAiB,WAAU,qDAAoD,CAAA,IAAM,IAC/F;EACL,CAAA,GAAA,oBAAC,OAAD;GAAK,GAAI,MAAa,QAAQ,QAAQ,OAAO,aAAa,cAAc,OAAO,mBAAmB;GAChG,UAAA,oBAAC,aAAD;IAAgB,GAAI;KACpB,GAAG,EACD,WAAW,8EACb;KACA,GAAG,EACD,WAAW,8EACb;IACF,EAAE,CAAC,CAAC,cAAc;IACd,UAAA,oBAAC,YAAD,EAAe,WAAW,eAAe,CAAA;GAC3B,CAAA;EACb,CAAA,CACS;;AACpB;AASA,SAAS,eAAe,OAA8B;CACpD,OAAO;EACL,GAAG,EACD,WAAW,sHACb;EACA,GAAG,EACD,WAAW,qHACb;EACA,GAAG,EACD,WAAW,sHACb;EACA,GAAG,EACD,WAAW,qHACb;EACA,GAAG,EACD,WAAW,sHACb;EACA,GAAG,EACD,WAAW,qHACb;EACA,GAAG,EACD,WAAW,uHACb;EACA,GAAG,EACD,WAAW,sHACb;CACF,EAAE,CAAC,CAAC,MAAM,kBAAkB,IAAI,CAAC,CAAC,MAAM,cAAc,IAAI,CAAC,CAAC,MAAM,cAAc,EAAE,CAAC,aAAa;AAClG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { ColorSwatchProps } from "react-aria-components";
|
|
3
|
+
//#region src/components/color-swatch/index.d.ts
|
|
4
|
+
type ColorSwatchProps$1 = Omit<ColorSwatchProps, 'className' | 'style'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Lands on the square around the swatch, which is the element a layout
|
|
7
|
+
* positions and the one that carries its size.
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Lands on the square around the swatch, as `className` does. */
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A colour shown as a value: a square of it, with a chequer behind so
|
|
15
|
+
* transparency reads as transparency. The colour is React Aria's — a CSS
|
|
16
|
+
* string, or a `Color` from `parseColor`, which this package re-exports.
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { parseColor } from '@kanso-labs/kanso-ui'
|
|
20
|
+
*
|
|
21
|
+
* <ColorSwatch color={parseColor('hsla(200, 100%, 50%, 0.4)')} />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* React Aria names it from the colour itself — "light vibrant cyan blue, 60%
|
|
25
|
+
* transparent" — so it needs no label. Pass `colorName` to say something
|
|
26
|
+
* else instead.
|
|
27
|
+
*
|
|
28
|
+
* The call site's `className` and `style` land on the square around the
|
|
29
|
+
* swatch rather than on the swatch itself, which is what makes setting a
|
|
30
|
+
* size from outside work — the colour fills whatever square it is given.
|
|
31
|
+
* React Aria's function forms are not taken here, since a swatch has no
|
|
32
|
+
* interactive state for one to read.
|
|
33
|
+
*/
|
|
34
|
+
declare function ColorSwatch$1({ className, style, ...props }: ColorSwatchProps$1): import("react").JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { type ColorSwatchProps$1 as ColorSwatchProps, ColorSwatch$1 as default };
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|