@xds/react 0.1.0 → 0.2.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.
Files changed (140) hide show
  1. package/dist/Accordion.js +191 -33
  2. package/dist/Avatar.js +65 -6
  3. package/dist/AvatarStack.js +101 -6
  4. package/dist/Badge.js +61 -4
  5. package/dist/Banner.js +161 -5
  6. package/dist/Button.js +152 -24
  7. package/dist/Card.js +171 -12
  8. package/dist/Checkbox.js +138 -3
  9. package/dist/Chip.js +71 -4
  10. package/dist/ChipBar.js +36 -3
  11. package/dist/CountBadge.js +62 -9
  12. package/dist/DatePicker.js +421 -25
  13. package/dist/DateRangePicker.js +362 -40
  14. package/dist/Defaults.js +42 -7
  15. package/dist/Dialog.js +128 -24
  16. package/dist/Divider.js +29 -3
  17. package/dist/EmptyState.js +83 -3
  18. package/dist/Icon.js +74 -4
  19. package/dist/IconButton.js +113 -18
  20. package/dist/ListRow.js +180 -10
  21. package/dist/MediaCard.js +273 -11
  22. package/dist/Menu.js +234 -58
  23. package/dist/ProgressBar.js +63 -4
  24. package/dist/RadioGroup.js +173 -12
  25. package/dist/SearchField.js +148 -16
  26. package/dist/SectionHeader.js +121 -5
  27. package/dist/SegmentedControl.js +104 -5
  28. package/dist/Select.js +307 -55
  29. package/dist/Sidebar.js +212 -19
  30. package/dist/Skeleton.js +61 -5
  31. package/dist/Slider.js +142 -35
  32. package/dist/Spinner.js +93 -4
  33. package/dist/Switch.js +114 -3
  34. package/dist/Tabs.js +130 -14
  35. package/dist/Text.js +42 -4
  36. package/dist/TextField.js +209 -26
  37. package/dist/Thumbnail.js +146 -7
  38. package/dist/Toast.js +118 -30
  39. package/dist/Tooltip.js +154 -20
  40. package/dist/base.d.ts +11 -0
  41. package/dist/base.js +10 -0
  42. package/dist/modal-popover.js +32 -10
  43. package/dist/picture.d.ts +6 -4
  44. package/dist/picture.js +72 -17
  45. package/dist/portal.js +24 -4
  46. package/dist/presence.js +30 -9
  47. package/dist/preview.d.ts +14 -3
  48. package/dist/preview.js +118 -74
  49. package/dist/root.js +1 -0
  50. package/dist/trigger.d.ts +7 -0
  51. package/dist/trigger.js +41 -8
  52. package/eject/files/Accordion.tsx +157 -0
  53. package/eject/files/Avatar.tsx +41 -0
  54. package/eject/files/AvatarStack.tsx +47 -0
  55. package/eject/files/Badge.tsx +33 -0
  56. package/eject/files/Banner.tsx +70 -0
  57. package/eject/files/Button.tsx +88 -0
  58. package/eject/files/Card.tsx +85 -0
  59. package/eject/files/Checkbox.tsx +59 -0
  60. package/eject/files/Chip.tsx +43 -0
  61. package/eject/files/ChipBar.tsx +31 -0
  62. package/eject/files/CountBadge.tsx +50 -0
  63. package/eject/files/DatePicker.tsx +192 -0
  64. package/eject/files/DateRangePicker.tsx +271 -0
  65. package/eject/files/Dialog.tsx +108 -0
  66. package/eject/files/Divider.tsx +13 -0
  67. package/eject/files/EmptyState.tsx +39 -0
  68. package/eject/files/Icon.tsx +38 -0
  69. package/eject/files/IconButton.tsx +62 -0
  70. package/eject/files/ListRow.tsx +86 -0
  71. package/eject/files/MediaCard.tsx +111 -0
  72. package/eject/files/Menu.tsx +168 -0
  73. package/eject/files/ProgressBar.tsx +34 -0
  74. package/eject/files/RadioGroup.tsx +112 -0
  75. package/eject/files/SearchField.tsx +88 -0
  76. package/eject/files/SectionHeader.tsx +56 -0
  77. package/eject/files/SegmentedControl.tsx +57 -0
  78. package/eject/files/Select.tsx +228 -0
  79. package/eject/files/Sidebar.tsx +149 -0
  80. package/eject/files/Skeleton.tsx +28 -0
  81. package/eject/files/Slider.tsx +109 -0
  82. package/eject/files/Spinner.tsx +36 -0
  83. package/eject/files/Switch.tsx +53 -0
  84. package/eject/files/Tabs.tsx +71 -0
  85. package/eject/files/Text.tsx +31 -0
  86. package/eject/files/TextField.tsx +122 -0
  87. package/eject/files/Thumbnail.tsx +66 -0
  88. package/eject/files/Toast.tsx +88 -0
  89. package/eject/files/Tooltip.tsx +120 -0
  90. package/eject/files/accordion.css +89 -0
  91. package/eject/files/accordion.ts +67 -0
  92. package/eject/files/avatar-stack.ts +57 -0
  93. package/eject/files/avatar.ts +42 -0
  94. package/eject/files/badge.ts +30 -0
  95. package/eject/files/banner.ts +68 -0
  96. package/eject/files/base.css +38 -0
  97. package/eject/files/button.css +241 -0
  98. package/eject/files/button.ts +106 -0
  99. package/eject/files/card.ts +58 -0
  100. package/eject/files/checkbox.ts +32 -0
  101. package/eject/files/chip-bar.ts +16 -0
  102. package/eject/files/chip.ts +35 -0
  103. package/eject/files/count-badge.ts +32 -0
  104. package/eject/files/date-picker.css +352 -0
  105. package/eject/files/date-picker.ts +250 -0
  106. package/eject/files/date-range-picker.ts +323 -0
  107. package/eject/files/dialog.css +139 -0
  108. package/eject/files/dialog.ts +15 -0
  109. package/eject/files/divider.ts +5 -0
  110. package/eject/files/empty-state.ts +22 -0
  111. package/eject/files/icon.ts +36 -0
  112. package/eject/files/list-row.ts +66 -0
  113. package/eject/files/media-card.ts +66 -0
  114. package/eject/files/menu.css +176 -0
  115. package/eject/files/menu.ts +84 -0
  116. package/eject/files/parts.ts +17 -0
  117. package/eject/files/progress-bar.ts +23 -0
  118. package/eject/files/radio-group.css +160 -0
  119. package/eject/files/radio-group.ts +24 -0
  120. package/eject/files/section-header.ts +32 -0
  121. package/eject/files/segmented-control.ts +30 -0
  122. package/eject/files/select.css +285 -0
  123. package/eject/files/select.ts +36 -0
  124. package/eject/files/sidebar.ts +75 -0
  125. package/eject/files/skeleton.ts +51 -0
  126. package/eject/files/slider.css +136 -0
  127. package/eject/files/slider.ts +65 -0
  128. package/eject/files/spinner.ts +22 -0
  129. package/eject/files/switch.ts +34 -0
  130. package/eject/files/tabs.css +112 -0
  131. package/eject/files/tabs.ts +35 -0
  132. package/eject/files/text-field.css +229 -0
  133. package/eject/files/text-field.ts +48 -0
  134. package/eject/files/text.ts +38 -0
  135. package/eject/files/thumbnail.ts +51 -0
  136. package/eject/files/toast.ts +31 -0
  137. package/eject/files/tooltip.css +104 -0
  138. package/eject/files/tooltip.ts +21 -0
  139. package/eject/manifest.json +814 -0
  140. package/package.json +9 -4
package/dist/Button.js CHANGED
@@ -1,31 +1,159 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { BUTTON_ICON, buttonClass, classes, isHeld } from "@xds/core";
3
3
  import { useDefaults } from "./Defaults.js";
4
4
  import { Icon } from "./Icon.js";
5
5
  import { Spinner } from "./Spinner.js";
6
6
  import { useTrigger } from "./trigger.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
8
  export function Button(props) {
8
- const defaults = useDefaults("Button");
9
- const { variant = defaults.variant ?? "secondary", size = defaults.size ?? "md", iconStart, iconEnd, selected, disabled = false, loading = false, fullWidth = false, type = "button", onPress, "aria-label": label, className, style, children, } = props;
10
- const icon = BUTTON_ICON[size];
11
- const attributes = useTrigger({
12
- className: classes(buttonClass({
13
- variant,
14
- size,
15
- iconOnly: children == null && (iconStart !== undefined || iconEnd !== undefined),
16
- fullWidth,
17
- }), className),
18
- style,
19
- disabled,
20
- "aria-disabled": loading || undefined,
21
- "data-pending": loading ? "" : undefined,
22
- "aria-pressed": selected,
23
- "aria-label": label,
24
- onClick: () => {
25
- if (!loading)
26
- onPress?.();
27
- },
28
- }, loading);
29
- return (_jsxs("button", { ...attributes, type: type, children: [loading &&
30
- (iconStart ? (_jsx("span", { className: icon.box, children: _jsx(Spinner, { size: "sm" }) })) : (_jsx(Spinner, { size: "sm" }))), iconStart && !loading && (_jsx(Icon, { name: iconStart, size: icon.size, filled: isHeld({ variant, selected, disabled }) })), children, iconEnd && _jsx(Icon, { name: iconEnd, size: icon.size })] }));
9
+ const $ = _c(41);
10
+ const defaults = useDefaults("Button");
11
+ const {
12
+ iconStart,
13
+ iconEnd,
14
+ selected,
15
+ disabled: t0,
16
+ loading: t1,
17
+ fullWidth: t2,
18
+ type: t3,
19
+ onPress,
20
+ "aria-label": label,
21
+ className,
22
+ style,
23
+ children
24
+ } = props;
25
+ const disabled = t0 === undefined ? false : t0;
26
+ const loading = t1 === undefined ? false : t1;
27
+ const fullWidth = t2 === undefined ? false : t2;
28
+ const type = t3 === undefined ? "button" : t3;
29
+ const variant = props.variant ?? defaults.variant ?? "secondary";
30
+ const size = props.size ?? defaults.size ?? "md";
31
+ const icon = BUTTON_ICON[size];
32
+ let t4;
33
+ if ($[0] !== children || $[1] !== className || $[2] !== fullWidth || $[3] !== iconEnd || $[4] !== iconStart || $[5] !== size || $[6] !== variant) {
34
+ t4 = classes(buttonClass({
35
+ variant,
36
+ size,
37
+ iconOnly: children == null && (iconStart !== undefined || iconEnd !== undefined),
38
+ fullWidth
39
+ }), className);
40
+ $[0] = children;
41
+ $[1] = className;
42
+ $[2] = fullWidth;
43
+ $[3] = iconEnd;
44
+ $[4] = iconStart;
45
+ $[5] = size;
46
+ $[6] = variant;
47
+ $[7] = t4;
48
+ } else {
49
+ t4 = $[7];
50
+ }
51
+ const t5 = loading || undefined;
52
+ const t6 = loading ? "" : undefined;
53
+ let t7;
54
+ if ($[8] !== loading || $[9] !== onPress) {
55
+ t7 = () => {
56
+ if (!loading) {
57
+ onPress?.();
58
+ }
59
+ };
60
+ $[8] = loading;
61
+ $[9] = onPress;
62
+ $[10] = t7;
63
+ } else {
64
+ t7 = $[10];
65
+ }
66
+ let t8;
67
+ if ($[11] !== disabled || $[12] !== label || $[13] !== selected || $[14] !== style || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
68
+ t8 = {
69
+ className: t4,
70
+ style,
71
+ disabled,
72
+ "aria-disabled": t5,
73
+ "data-pending": t6,
74
+ "aria-pressed": selected,
75
+ "aria-label": label,
76
+ onClick: t7
77
+ };
78
+ $[11] = disabled;
79
+ $[12] = label;
80
+ $[13] = selected;
81
+ $[14] = style;
82
+ $[15] = t4;
83
+ $[16] = t5;
84
+ $[17] = t6;
85
+ $[18] = t7;
86
+ $[19] = t8;
87
+ } else {
88
+ t8 = $[19];
89
+ }
90
+ const attributes = useTrigger(t8, loading);
91
+ let t9;
92
+ if ($[20] !== icon || $[21] !== iconStart || $[22] !== loading) {
93
+ t9 = loading && (iconStart ? /*#__PURE__*/_jsx("span", {
94
+ className: icon.box,
95
+ children: /*#__PURE__*/_jsx(Spinner, {
96
+ size: "sm"
97
+ })
98
+ }) : /*#__PURE__*/_jsx(Spinner, {
99
+ size: "sm"
100
+ }));
101
+ $[20] = icon;
102
+ $[21] = iconStart;
103
+ $[22] = loading;
104
+ $[23] = t9;
105
+ } else {
106
+ t9 = $[23];
107
+ }
108
+ let t10;
109
+ if ($[24] !== disabled || $[25] !== icon || $[26] !== iconStart || $[27] !== loading || $[28] !== selected || $[29] !== variant) {
110
+ t10 = iconStart && !loading && /*#__PURE__*/_jsx(Icon, {
111
+ name: iconStart,
112
+ size: icon.size,
113
+ filled: isHeld({
114
+ variant,
115
+ selected,
116
+ disabled
117
+ })
118
+ });
119
+ $[24] = disabled;
120
+ $[25] = icon;
121
+ $[26] = iconStart;
122
+ $[27] = loading;
123
+ $[28] = selected;
124
+ $[29] = variant;
125
+ $[30] = t10;
126
+ } else {
127
+ t10 = $[30];
128
+ }
129
+ let t11;
130
+ if ($[31] !== icon || $[32] !== iconEnd) {
131
+ t11 = iconEnd && /*#__PURE__*/_jsx(Icon, {
132
+ name: iconEnd,
133
+ size: icon.size
134
+ });
135
+ $[31] = icon;
136
+ $[32] = iconEnd;
137
+ $[33] = t11;
138
+ } else {
139
+ t11 = $[33];
140
+ }
141
+ let t12;
142
+ if ($[34] !== attributes || $[35] !== children || $[36] !== t10 || $[37] !== t11 || $[38] !== t9 || $[39] !== type) {
143
+ t12 = /*#__PURE__*/_jsxs("button", {
144
+ ...attributes,
145
+ type: type,
146
+ children: [t9, t10, children, t11]
147
+ });
148
+ $[34] = attributes;
149
+ $[35] = children;
150
+ $[36] = t10;
151
+ $[37] = t11;
152
+ $[38] = t9;
153
+ $[39] = type;
154
+ $[40] = t12;
155
+ } else {
156
+ t12 = $[40];
157
+ }
158
+ return t12;
31
159
  }
package/dist/Card.js CHANGED
@@ -1,14 +1,173 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CARD_PARTS, cardClass, cardMediaClass, classes, rootPart, } from "@xds/core";
3
- export function Card({ title, description, actions, media, flush = false, onPress, selected, className, style, children, }) {
4
- const surface = classes(rootPart("Card"), cardClass({ selected, flush, pressable: onPress !== undefined }), className);
5
- const [Header, Box, Title, Line] = onPress
6
- ? ["span", "span", "span", "span"]
7
- : ["header", "div", "h2", "p"];
8
- const parts = (_jsxs(_Fragment, { children: [media != null && _jsx(Box, { className: cardMediaClass(flush), children: media }), (title || (actions && !onPress)) && (_jsxs(Header, { className: CARD_PARTS.header, children: [_jsxs(Box, { className: CARD_PARTS.heading, children: [title && _jsx(Title, { className: CARD_PARTS.title, children: title }), description && _jsx(Line, { className: CARD_PARTS.description, children: description })] }), actions && !onPress && _jsx("div", { className: CARD_PARTS.actions, children: actions })] })), children] }));
9
- const content = flush ? _jsx(Box, { className: CARD_PARTS.flush, children: parts }) : parts;
10
- if (!onPress) {
11
- return (_jsx("section", { ...(selected ? { "aria-current": "true" } : {}), className: surface, style: style, children: content }));
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { CARD_PARTS, cardClass, cardMediaClass, classes, rootPart } from "@xds/core";
3
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
+ export function Card(t0) {
5
+ const $ = _c(43);
6
+ const {
7
+ title,
8
+ description,
9
+ actions,
10
+ media,
11
+ flush: t1,
12
+ onPress,
13
+ selected,
14
+ className,
15
+ style,
16
+ children
17
+ } = t0;
18
+ const flush = t1 === undefined ? false : t1;
19
+ let t2;
20
+ if ($[0] !== className || $[1] !== flush || $[2] !== onPress || $[3] !== selected) {
21
+ t2 = classes(rootPart("Card"), cardClass({
22
+ selected,
23
+ flush,
24
+ pressable: onPress !== undefined
25
+ }), className);
26
+ $[0] = className;
27
+ $[1] = flush;
28
+ $[2] = onPress;
29
+ $[3] = selected;
30
+ $[4] = t2;
31
+ } else {
32
+ t2 = $[4];
33
+ }
34
+ const surface = t2;
35
+ let t3;
36
+ if ($[5] !== onPress) {
37
+ t3 = onPress ? ["span", "span", "span", "span"] : ["header", "div", "h2", "p"];
38
+ $[5] = onPress;
39
+ $[6] = t3;
40
+ } else {
41
+ t3 = $[6];
42
+ }
43
+ const [Header, Box, Title, Line] = t3;
44
+ let t4;
45
+ if ($[7] !== Box || $[8] !== flush || $[9] !== media) {
46
+ t4 = media != null && /*#__PURE__*/_jsx(Box, {
47
+ className: cardMediaClass(flush),
48
+ children: media
49
+ });
50
+ $[7] = Box;
51
+ $[8] = flush;
52
+ $[9] = media;
53
+ $[10] = t4;
54
+ } else {
55
+ t4 = $[10];
56
+ }
57
+ let t5;
58
+ if ($[11] !== Box || $[12] !== Header || $[13] !== Line || $[14] !== Title || $[15] !== actions || $[16] !== description || $[17] !== onPress || $[18] !== title) {
59
+ t5 = (title || actions && !onPress) && /*#__PURE__*/_jsxs(Header, {
60
+ className: CARD_PARTS.header,
61
+ children: [/*#__PURE__*/_jsxs(Box, {
62
+ className: CARD_PARTS.heading,
63
+ children: [title && /*#__PURE__*/_jsx(Title, {
64
+ className: CARD_PARTS.title,
65
+ children: title
66
+ }), description && /*#__PURE__*/_jsx(Line, {
67
+ className: CARD_PARTS.description,
68
+ children: description
69
+ })]
70
+ }), actions && !onPress && /*#__PURE__*/_jsx("div", {
71
+ className: CARD_PARTS.actions,
72
+ children: actions
73
+ })]
74
+ });
75
+ $[11] = Box;
76
+ $[12] = Header;
77
+ $[13] = Line;
78
+ $[14] = Title;
79
+ $[15] = actions;
80
+ $[16] = description;
81
+ $[17] = onPress;
82
+ $[18] = title;
83
+ $[19] = t5;
84
+ } else {
85
+ t5 = $[19];
86
+ }
87
+ let t6;
88
+ if ($[20] !== children || $[21] !== t4 || $[22] !== t5) {
89
+ t6 = /*#__PURE__*/_jsxs(_Fragment, {
90
+ children: [t4, t5, children]
91
+ });
92
+ $[20] = children;
93
+ $[21] = t4;
94
+ $[22] = t5;
95
+ $[23] = t6;
96
+ } else {
97
+ t6 = $[23];
98
+ }
99
+ const parts = t6;
100
+ let t7;
101
+ if ($[24] !== Box || $[25] !== flush || $[26] !== parts) {
102
+ t7 = flush ? /*#__PURE__*/_jsx(Box, {
103
+ className: CARD_PARTS.flush,
104
+ children: parts
105
+ }) : parts;
106
+ $[24] = Box;
107
+ $[25] = flush;
108
+ $[26] = parts;
109
+ $[27] = t7;
110
+ } else {
111
+ t7 = $[27];
112
+ }
113
+ const content = t7;
114
+ if (!onPress) {
115
+ let t8;
116
+ if ($[28] !== selected) {
117
+ t8 = selected ? {
118
+ "aria-current": "true"
119
+ } : {};
120
+ $[28] = selected;
121
+ $[29] = t8;
122
+ } else {
123
+ t8 = $[29];
12
124
  }
13
- return (_jsx("button", { type: "button", onClick: onPress, ...(selected === undefined ? {} : { "aria-pressed": selected }), className: surface, style: style, children: content }));
125
+ let t9;
126
+ if ($[30] !== content || $[31] !== style || $[32] !== surface || $[33] !== t8) {
127
+ t9 = /*#__PURE__*/_jsx("section", {
128
+ ...t8,
129
+ className: surface,
130
+ style: style,
131
+ children: content
132
+ });
133
+ $[30] = content;
134
+ $[31] = style;
135
+ $[32] = surface;
136
+ $[33] = t8;
137
+ $[34] = t9;
138
+ } else {
139
+ t9 = $[34];
140
+ }
141
+ return t9;
142
+ }
143
+ let t8;
144
+ if ($[35] !== selected) {
145
+ t8 = selected === undefined ? {} : {
146
+ "aria-pressed": selected
147
+ };
148
+ $[35] = selected;
149
+ $[36] = t8;
150
+ } else {
151
+ t8 = $[36];
152
+ }
153
+ let t9;
154
+ if ($[37] !== content || $[38] !== onPress || $[39] !== style || $[40] !== surface || $[41] !== t8) {
155
+ t9 = /*#__PURE__*/_jsx("button", {
156
+ type: "button",
157
+ onClick: onPress,
158
+ ...t8,
159
+ className: surface,
160
+ style: style,
161
+ children: content
162
+ });
163
+ $[37] = content;
164
+ $[38] = onPress;
165
+ $[39] = style;
166
+ $[40] = surface;
167
+ $[41] = t8;
168
+ $[42] = t9;
169
+ } else {
170
+ t9 = $[42];
171
+ }
172
+ return t9;
14
173
  }
package/dist/Checkbox.js CHANGED
@@ -1,5 +1,140 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { CHECKBOX_MARK, checkboxBoxClass, checkboxClass, checkboxLabelClass, checkboxMarkClass, classes, rootPart } from "@xds/core";
1
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CHECKBOX_MARK, checkboxBoxClass, checkboxClass, checkboxLabelClass, checkboxMarkClass, classes, rootPart, } from "@xds/core";
3
- export function Checkbox({ checked, onChange, label, name, disabled = false, className, style, ...aria }) {
4
- return (_jsxs("label", { className: classes(rootPart("Checkbox"), checkboxClass, className), style: style, children: [_jsx("input", { ...aria, type: "checkbox", className: "peer sr-only", checked: checked, disabled: disabled, onChange: (event) => onChange(event.target.checked), ...(name ? { name } : {}) }), _jsx("span", { className: checkboxBoxClass, children: _jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", className: checkboxMarkClass, children: _jsx("path", { d: CHECKBOX_MARK, stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), label && _jsx("span", { className: checkboxLabelClass, children: label })] }));
4
+ export function Checkbox(t0) {
5
+ const $ = _c(29);
6
+ let aria;
7
+ let checked;
8
+ let className;
9
+ let label;
10
+ let name;
11
+ let onChange;
12
+ let style;
13
+ let t1;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ checked,
17
+ onChange,
18
+ label,
19
+ name,
20
+ disabled: t1,
21
+ className,
22
+ style,
23
+ ...aria
24
+ } = t0);
25
+ $[0] = t0;
26
+ $[1] = aria;
27
+ $[2] = checked;
28
+ $[3] = className;
29
+ $[4] = label;
30
+ $[5] = name;
31
+ $[6] = onChange;
32
+ $[7] = style;
33
+ $[8] = t1;
34
+ } else {
35
+ aria = $[1];
36
+ checked = $[2];
37
+ className = $[3];
38
+ label = $[4];
39
+ name = $[5];
40
+ onChange = $[6];
41
+ style = $[7];
42
+ t1 = $[8];
43
+ }
44
+ const disabled = t1 === undefined ? false : t1;
45
+ let t2;
46
+ if ($[9] !== className) {
47
+ t2 = classes(rootPart("Checkbox"), checkboxClass, className);
48
+ $[9] = className;
49
+ $[10] = t2;
50
+ } else {
51
+ t2 = $[10];
52
+ }
53
+ let t3;
54
+ if ($[11] !== onChange) {
55
+ t3 = event => onChange(event.target.checked);
56
+ $[11] = onChange;
57
+ $[12] = t3;
58
+ } else {
59
+ t3 = $[12];
60
+ }
61
+ let t4;
62
+ if ($[13] !== name) {
63
+ t4 = name ? {
64
+ name
65
+ } : {};
66
+ $[13] = name;
67
+ $[14] = t4;
68
+ } else {
69
+ t4 = $[14];
70
+ }
71
+ let t5;
72
+ if ($[15] !== aria || $[16] !== checked || $[17] !== disabled || $[18] !== t3 || $[19] !== t4) {
73
+ t5 = /*#__PURE__*/_jsx("input", {
74
+ ...aria,
75
+ type: "checkbox",
76
+ className: "peer sr-only",
77
+ checked: checked,
78
+ disabled: disabled,
79
+ onChange: t3,
80
+ ...t4
81
+ });
82
+ $[15] = aria;
83
+ $[16] = checked;
84
+ $[17] = disabled;
85
+ $[18] = t3;
86
+ $[19] = t4;
87
+ $[20] = t5;
88
+ } else {
89
+ t5 = $[20];
90
+ }
91
+ let t6;
92
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
93
+ t6 = /*#__PURE__*/_jsx("span", {
94
+ className: checkboxBoxClass,
95
+ children: /*#__PURE__*/_jsx("svg", {
96
+ viewBox: "0 0 16 16",
97
+ fill: "none",
98
+ "aria-hidden": "true",
99
+ className: checkboxMarkClass,
100
+ children: /*#__PURE__*/_jsx("path", {
101
+ d: CHECKBOX_MARK,
102
+ stroke: "currentColor",
103
+ strokeWidth: "2",
104
+ strokeLinecap: "round",
105
+ strokeLinejoin: "round"
106
+ })
107
+ })
108
+ });
109
+ $[21] = t6;
110
+ } else {
111
+ t6 = $[21];
112
+ }
113
+ let t7;
114
+ if ($[22] !== label) {
115
+ t7 = label && /*#__PURE__*/_jsx("span", {
116
+ className: checkboxLabelClass,
117
+ children: label
118
+ });
119
+ $[22] = label;
120
+ $[23] = t7;
121
+ } else {
122
+ t7 = $[23];
123
+ }
124
+ let t8;
125
+ if ($[24] !== style || $[25] !== t2 || $[26] !== t5 || $[27] !== t7) {
126
+ t8 = /*#__PURE__*/_jsxs("label", {
127
+ className: t2,
128
+ style: style,
129
+ children: [t5, t6, t7]
130
+ });
131
+ $[24] = style;
132
+ $[25] = t2;
133
+ $[26] = t5;
134
+ $[27] = t7;
135
+ $[28] = t8;
136
+ } else {
137
+ t8 = $[28];
138
+ }
139
+ return t8;
5
140
  }
package/dist/Chip.js CHANGED
@@ -1,7 +1,74 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { chipClass, chipIcon, classes, rootPart } from "@xds/core";
3
3
  import { Icon } from "./Icon.js";
4
- export function Chip({ label, selected = false, onPress, iconStart, disabled = false, className, style, }) {
5
- const icon = chipIcon({ selected, iconStart });
6
- return (_jsxs("button", { type: "button", "aria-pressed": selected, disabled: disabled, onClick: onPress, className: classes(rootPart("Chip"), chipClass(selected), className), style: style, children: [icon && _jsx(Icon, { name: icon, size: "sm" }), label] }));
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export function Chip(t0) {
6
+ const $ = _c(16);
7
+ const {
8
+ label,
9
+ selected: t1,
10
+ onPress,
11
+ iconStart,
12
+ disabled: t2,
13
+ className,
14
+ style
15
+ } = t0;
16
+ const selected = t1 === undefined ? false : t1;
17
+ const disabled = t2 === undefined ? false : t2;
18
+ let t3;
19
+ if ($[0] !== iconStart || $[1] !== selected) {
20
+ t3 = chipIcon({
21
+ selected,
22
+ iconStart
23
+ });
24
+ $[0] = iconStart;
25
+ $[1] = selected;
26
+ $[2] = t3;
27
+ } else {
28
+ t3 = $[2];
29
+ }
30
+ const icon = t3;
31
+ let t4;
32
+ if ($[3] !== className || $[4] !== selected) {
33
+ t4 = classes(rootPart("Chip"), chipClass(selected), className);
34
+ $[3] = className;
35
+ $[4] = selected;
36
+ $[5] = t4;
37
+ } else {
38
+ t4 = $[5];
39
+ }
40
+ let t5;
41
+ if ($[6] !== icon) {
42
+ t5 = icon && /*#__PURE__*/_jsx(Icon, {
43
+ name: icon,
44
+ size: "sm"
45
+ });
46
+ $[6] = icon;
47
+ $[7] = t5;
48
+ } else {
49
+ t5 = $[7];
50
+ }
51
+ let t6;
52
+ if ($[8] !== disabled || $[9] !== label || $[10] !== onPress || $[11] !== selected || $[12] !== style || $[13] !== t4 || $[14] !== t5) {
53
+ t6 = /*#__PURE__*/_jsxs("button", {
54
+ type: "button",
55
+ "aria-pressed": selected,
56
+ disabled: disabled,
57
+ onClick: onPress,
58
+ className: t4,
59
+ style: style,
60
+ children: [t5, label]
61
+ });
62
+ $[8] = disabled;
63
+ $[9] = label;
64
+ $[10] = onPress;
65
+ $[11] = selected;
66
+ $[12] = style;
67
+ $[13] = t4;
68
+ $[14] = t5;
69
+ $[15] = t6;
70
+ } else {
71
+ t6 = $[15];
72
+ }
73
+ return t6;
7
74
  }
package/dist/ChipBar.js CHANGED
@@ -1,5 +1,38 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { chipBarClass, classes, rootPart } from "@xds/core";
3
- export function ChipBar({ label, className, style, children }) {
4
- return (_jsx("div", { role: "group", "aria-label": label, className: classes(rootPart("ChipBar"), chipBarClass, className), style: style, children: children }));
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export function ChipBar(t0) {
5
+ const $ = _c(7);
6
+ const {
7
+ label,
8
+ className,
9
+ style,
10
+ children
11
+ } = t0;
12
+ let t1;
13
+ if ($[0] !== className) {
14
+ t1 = classes(rootPart("ChipBar"), chipBarClass, className);
15
+ $[0] = className;
16
+ $[1] = t1;
17
+ } else {
18
+ t1 = $[1];
19
+ }
20
+ let t2;
21
+ if ($[2] !== children || $[3] !== label || $[4] !== style || $[5] !== t1) {
22
+ t2 = /*#__PURE__*/_jsx("div", {
23
+ role: "group",
24
+ "aria-label": label,
25
+ className: t1,
26
+ style: style,
27
+ children: children
28
+ });
29
+ $[2] = children;
30
+ $[3] = label;
31
+ $[4] = style;
32
+ $[5] = t1;
33
+ $[6] = t2;
34
+ } else {
35
+ t2 = $[6];
36
+ }
37
+ return t2;
5
38
  }