@panneau/ui 5.0.0-alpha.5 → 5.0.0-alpha.7
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 +77 -1
- package/dist/alert/Alert.js +108 -40
- package/dist/alert/Alert.js.map +1 -1
- package/dist/alert/tokens.js.map +1 -1
- package/dist/badge/Badge.js +34 -6
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/tokens.js.map +1 -1
- package/dist/button/Button.js +111 -17
- package/dist/button/Button.js.map +1 -1
- package/dist/button/tokens.js.map +1 -1
- package/dist/card/Card.js +76 -23
- package/dist/card/Card.js.map +1 -1
- package/dist/card/tokens.js.map +1 -1
- package/dist/checkbox/Checkbox.js +86 -25
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/ChoiceChrome.js +82 -21
- package/dist/checkbox/ChoiceChrome.js.map +1 -1
- package/dist/checkbox/tokens.js.map +1 -1
- package/dist/combo-box/ComboBox.js +291 -79
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/command-palette/CommandPalette.js +463 -160
- package/dist/command-palette/CommandPalette.js.map +1 -1
- package/dist/command-palette/match.js.map +1 -1
- package/dist/command-palette/tokens.js.map +1 -1
- package/dist/command-palette/useCommandShortcut.js +31 -12
- package/dist/command-palette/useCommandShortcut.js.map +1 -1
- package/dist/container/Container.js +48 -5
- package/dist/container/Container.js.map +1 -1
- package/dist/container/tokens.js.map +1 -1
- package/dist/date-picker/DatePicker.js +234 -73
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/calendarTokens.js.map +1 -1
- package/dist/dialog/Dialog.js +161 -45
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/tokens.js.map +1 -1
- package/dist/disclosure/Disclosure.js +132 -28
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/tokens.js.map +1 -1
- package/dist/divider/Divider.js +55 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/tokens.js.map +1 -1
- package/dist/field/FieldParts.js +69 -15
- package/dist/field/FieldParts.js.map +1 -1
- package/dist/field/Fieldset.js +99 -32
- package/dist/field/Fieldset.js.map +1 -1
- package/dist/field/inputTokens.js.map +1 -1
- package/dist/field/tokens.js.map +1 -1
- package/dist/grid/Grid.js +123 -14
- package/dist/grid/Grid.js.map +1 -1
- package/dist/grid/tokens.js.map +1 -1
- package/dist/heading/Heading.js +41 -6
- package/dist/heading/Heading.js.map +1 -1
- package/dist/heading/tokens.js.map +1 -1
- package/dist/icon/Icon.js +36 -11
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/lucideIconLoader.js.map +1 -1
- package/dist/icon/namedIcons.js +87 -26
- package/dist/icon/namedIcons.js.map +1 -1
- package/dist/icon-button/IconButton.js +70 -13
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/inline/Inline.js +65 -7
- package/dist/inline/Inline.js.map +1 -1
- package/dist/inline/tokens.js.map +1 -1
- package/dist/intl/usePanneauIntl.js.map +1 -1
- package/dist/layout/responsive.js.map +1 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/menu/Menu.css +84 -0
- package/dist/menu/Menu.d.ts +33 -6
- package/dist/menu/Menu.d.ts.map +1 -1
- package/dist/menu/Menu.js +243 -32
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/Menu.module.js +22 -0
- package/dist/menu/Menu.module.js.map +1 -0
- package/dist/menu/tokens.d.ts +3 -0
- package/dist/menu/tokens.d.ts.map +1 -0
- package/dist/menu/tokens.js +31 -0
- package/dist/menu/tokens.js.map +1 -0
- package/dist/number-input/NumberInput.css +18 -0
- package/dist/number-input/NumberInput.js +232 -60
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/NumberInput.module.js +3 -1
- package/dist/number-input/NumberInput.module.js.map +1 -1
- package/dist/number-input/tokens.js.map +1 -1
- package/dist/pill-trigger/PillTrigger.css +104 -0
- package/dist/pill-trigger/PillTrigger.d.ts +20 -0
- package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
- package/dist/pill-trigger/PillTrigger.js +94 -0
- package/dist/pill-trigger/PillTrigger.js.map +1 -0
- package/dist/pill-trigger/PillTrigger.module.js +18 -0
- package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
- package/dist/pill-trigger/tokens.d.ts +3 -0
- package/dist/pill-trigger/tokens.d.ts.map +1 -0
- package/dist/pill-trigger/tokens.js +37 -0
- package/dist/pill-trigger/tokens.js.map +1 -0
- package/dist/popover/Popover.js +109 -18
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/tokens.js.map +1 -1
- package/dist/prose/Prose.js +36 -5
- package/dist/prose/Prose.js.map +1 -1
- package/dist/prose/tokens.js.map +1 -1
- package/dist/radio-group/RadioGroup.css +90 -0
- package/dist/radio-group/RadioGroup.d.ts +22 -3
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +214 -43
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +12 -2
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +2 -2
- package/dist/radio-group/tokens.d.ts.map +1 -1
- package/dist/radio-group/tokens.js +22 -2
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.js +197 -49
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/ThemeScope.js +107 -26
- package/dist/root/ThemeScope.js.map +1 -1
- package/dist/segmented-control/SegmentedControl.js +120 -22
- package/dist/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/segmented-control/tokens.js.map +1 -1
- package/dist/select/ListBox.css +15 -0
- package/dist/select/ListBox.module.js.map +1 -1
- package/dist/select/Select.js +298 -92
- package/dist/select/Select.js.map +1 -1
- package/dist/select/listBoxTokens.js.map +1 -1
- package/dist/skeleton/LoadingRegion.d.ts +16 -0
- package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
- package/dist/skeleton/LoadingRegion.js +65 -0
- package/dist/skeleton/LoadingRegion.js.map +1 -0
- package/dist/skeleton/Skeleton.css +62 -0
- package/dist/skeleton/Skeleton.d.ts +25 -0
- package/dist/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/skeleton/Skeleton.js +106 -0
- package/dist/skeleton/Skeleton.js.map +1 -0
- package/dist/skeleton/Skeleton.module.js +22 -0
- package/dist/skeleton/Skeleton.module.js.map +1 -0
- package/dist/skeleton/tokens.d.ts +3 -0
- package/dist/skeleton/tokens.d.ts.map +1 -0
- package/dist/skeleton/tokens.js +15 -0
- package/dist/skeleton/tokens.js.map +1 -0
- package/dist/slider/Slider.css +84 -0
- package/dist/slider/Slider.d.ts +20 -0
- package/dist/slider/Slider.d.ts.map +1 -0
- package/dist/slider/Slider.js +248 -0
- package/dist/slider/Slider.js.map +1 -0
- package/dist/slider/Slider.module.js +20 -0
- package/dist/slider/Slider.module.js.map +1 -0
- package/dist/spinner/Spinner.js +49 -9
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/tokens.js.map +1 -1
- package/dist/stack/Stack.js +60 -7
- package/dist/stack/Stack.js.map +1 -1
- package/dist/stack/tokens.js.map +1 -1
- package/dist/switch/Switch.js +68 -11
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/tokens.js.map +1 -1
- package/dist/tabs/Tabs.js +1 -1
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/tokens.js.map +1 -1
- package/dist/tags-input/TagsInput.css +60 -0
- package/dist/tags-input/TagsInput.d.ts +32 -0
- package/dist/tags-input/TagsInput.d.ts.map +1 -0
- package/dist/tags-input/TagsInput.js +316 -0
- package/dist/tags-input/TagsInput.js.map +1 -0
- package/dist/tags-input/TagsInput.module.js +20 -0
- package/dist/tags-input/TagsInput.module.js.map +1 -0
- package/dist/text/Text.js +70 -5
- package/dist/text/Text.js.map +1 -1
- package/dist/text/tokens.js.map +1 -1
- package/dist/text-area/TextArea.js +135 -28
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-input/TextInput.js +164 -49
- package/dist/text-input/TextInput.js.map +1 -1
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/chartColors.js.map +1 -1
- package/dist/theme/checkTheme.js.map +1 -1
- package/dist/theme/cli.js.map +1 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/colorVision.js.map +1 -1
- package/dist/theme/componentTokens.js.map +1 -1
- package/dist/theme/components.d.ts +4 -1
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +6 -0
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/defineTheme.js.map +1 -1
- package/dist/theme/fonts.js.map +1 -1
- package/dist/theme/semanticTokens.js.map +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/toneClass.js.map +1 -1
- package/dist/theme/tones.js.map +1 -1
- package/dist/time-input/TimeInput.js +138 -31
- package/dist/time-input/TimeInput.js.map +1 -1
- package/dist/toast/Toast.js +1 -1
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/tokens.js.map +1 -1
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/tokens.js.map +1 -1
- package/dist/utils/cx.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/pill-trigger/tokens.ts"],"names":[],"mappings":"AAEA,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,qhBA8B5B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/pill-trigger/tokens.ts
|
|
3
|
+
/** Tokens of PillTrigger. */
|
|
4
|
+
var pillTriggerTokens = defineComponentTokens("pill-trigger", {
|
|
5
|
+
/** Background. */
|
|
6
|
+
bg: "var(--panneau-color-surface-sunken)",
|
|
7
|
+
/** Background of a hovered, pressed or open trigger. */
|
|
8
|
+
"bg-hover": "color-mix(in srgb, var(--panneau-color-text) 8%, var(--panneau-color-surface-sunken))",
|
|
9
|
+
/** Color of the value. */
|
|
10
|
+
color: "var(--panneau-color-text)",
|
|
11
|
+
/** Color of the border: none by default. */
|
|
12
|
+
"border-color": "transparent",
|
|
13
|
+
/** Corner radius. */
|
|
14
|
+
radius: "var(--panneau-radius-full)",
|
|
15
|
+
/** Space between the media, the value and the chevron. */
|
|
16
|
+
gap: "var(--panneau-space-2)",
|
|
17
|
+
/** Horizontal padding. */
|
|
18
|
+
"padding-x": "var(--panneau-space-3)",
|
|
19
|
+
/** Horizontal padding of the small size. */
|
|
20
|
+
"padding-x-sm": "var(--panneau-space-2)",
|
|
21
|
+
/** Font size of the value. */
|
|
22
|
+
"font-size": "var(--panneau-font-size-md)",
|
|
23
|
+
/** Font size of the value, small size. */
|
|
24
|
+
"font-size-sm": "var(--panneau-font-size-sm)",
|
|
25
|
+
/** Font weight of the value. */
|
|
26
|
+
"font-weight": "var(--panneau-font-weight-medium)",
|
|
27
|
+
/** Size of the leading media. */
|
|
28
|
+
"media-size": "1.5rem",
|
|
29
|
+
/** Size of the leading media, small size. */
|
|
30
|
+
"media-size-sm": "1.25rem",
|
|
31
|
+
/** Corner radius of the leading media: its content is clipped to it. */
|
|
32
|
+
"media-radius": "var(--panneau-radius-full)"
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { pillTriggerTokens };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","pillTriggerTokens","bg","color","radius","gap"],"sources":["../../src/pill-trigger/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of PillTrigger. */\nexport const pillTriggerTokens = defineComponentTokens('pill-trigger', {\n /** Background. */\n bg: 'var(--panneau-color-surface-sunken)',\n /** Background of a hovered, pressed or open trigger. */\n 'bg-hover':\n 'color-mix(in srgb, var(--panneau-color-text) 8%, var(--panneau-color-surface-sunken))',\n /** Color of the value. */\n color: 'var(--panneau-color-text)',\n /** Color of the border: none by default. */\n 'border-color': 'transparent',\n /** Corner radius. */\n radius: 'var(--panneau-radius-full)',\n /** Space between the media, the value and the chevron. */\n gap: 'var(--panneau-space-2)',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-3)',\n /** Horizontal padding of the small size. */\n 'padding-x-sm': 'var(--panneau-space-2)',\n /** Font size of the value. */\n 'font-size': 'var(--panneau-font-size-md)',\n /** Font size of the value, small size. */\n 'font-size-sm': 'var(--panneau-font-size-sm)',\n /** Font weight of the value. */\n 'font-weight': 'var(--panneau-font-weight-medium)',\n /** Size of the leading media. */\n 'media-size': '1.5rem',\n /** Size of the leading media, small size. */\n 'media-size-sm': '1.25rem',\n /** Corner radius of the leading media: its content is clipped to it. */\n 'media-radius': 'var(--panneau-radius-full)',\n});\n"],"mappings":";;;AAGA,IAAaC,oBAAoBD,sBAAsB,gBAAgB;;CAEnEE,IAAI;;CAEJ,YACI;;CAEJC,OAAO;;CAEP,gBAAgB;;CAEhBC,QAAQ;;CAERC,KAAK;;CAEL,aAAa;;CAEb,gBAAgB;;CAEhB,aAAa;;CAEb,gBAAgB;;CAEhB,eAAe;;CAEf,cAAc;;CAEd,iBAAiB;;CAEjB,gBAAgB;AACpB,CAAC"}
|
package/dist/popover/Popover.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import { usePortalContainer } from "../root/PanneauRoot.js";
|
|
3
3
|
import Popover_module_default from "./Popover.module.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { Dialog, DialogTrigger as PopoverTrigger, Popover } from "react-aria-components";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
//#region src/popover/Popover.tsx
|
|
@@ -8,32 +9,122 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
* A popover with free content, inside a `PopoverTrigger` with its button as the first child. Its
|
|
9
10
|
* content is a non-modal dialog: focus moves into it and comes back to the button when it closes.
|
|
10
11
|
*/
|
|
11
|
-
function Popover$1(
|
|
12
|
+
function Popover$1(t0) {
|
|
13
|
+
const $ = c(21);
|
|
14
|
+
let ariaLabel;
|
|
15
|
+
let children;
|
|
16
|
+
let className;
|
|
17
|
+
let dialogClassName;
|
|
18
|
+
let props;
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({children, "aria-label": ariaLabel, className, dialogClassName, offset: t1, ...props} = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = ariaLabel;
|
|
24
|
+
$[2] = children;
|
|
25
|
+
$[3] = className;
|
|
26
|
+
$[4] = dialogClassName;
|
|
27
|
+
$[5] = props;
|
|
28
|
+
$[6] = t1;
|
|
29
|
+
} else {
|
|
30
|
+
ariaLabel = $[1];
|
|
31
|
+
children = $[2];
|
|
32
|
+
className = $[3];
|
|
33
|
+
dialogClassName = $[4];
|
|
34
|
+
props = $[5];
|
|
35
|
+
t1 = $[6];
|
|
36
|
+
}
|
|
37
|
+
const offset = t1 === void 0 ? 6 : t1;
|
|
12
38
|
const container = usePortalContainer();
|
|
13
39
|
if (container === null) return null;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[7] !== className) {
|
|
42
|
+
t2 = cx("panneau-popover", Popover_module_default.popover, className);
|
|
43
|
+
$[7] = className;
|
|
44
|
+
$[8] = t2;
|
|
45
|
+
} else t2 = $[8];
|
|
46
|
+
let t3;
|
|
47
|
+
if ($[9] !== dialogClassName) {
|
|
48
|
+
t3 = cx(Popover_module_default.dialog, dialogClassName);
|
|
49
|
+
$[9] = dialogClassName;
|
|
50
|
+
$[10] = t3;
|
|
51
|
+
} else t3 = $[10];
|
|
52
|
+
let t4;
|
|
53
|
+
if ($[11] !== ariaLabel || $[12] !== children || $[13] !== t3) {
|
|
54
|
+
t4 = /* @__PURE__ */ jsx(Dialog, {
|
|
20
55
|
"aria-label": ariaLabel,
|
|
21
|
-
className:
|
|
56
|
+
className: t3,
|
|
22
57
|
children
|
|
23
|
-
})
|
|
24
|
-
|
|
58
|
+
});
|
|
59
|
+
$[11] = ariaLabel;
|
|
60
|
+
$[12] = children;
|
|
61
|
+
$[13] = t3;
|
|
62
|
+
$[14] = t4;
|
|
63
|
+
} else t4 = $[14];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[15] !== container || $[16] !== offset || $[17] !== props || $[18] !== t2 || $[19] !== t4) {
|
|
66
|
+
t5 = /* @__PURE__ */ jsx(Popover, {
|
|
67
|
+
...props,
|
|
68
|
+
offset,
|
|
69
|
+
className: t2,
|
|
70
|
+
UNSTABLE_portalContainer: container,
|
|
71
|
+
children: t4
|
|
72
|
+
});
|
|
73
|
+
$[15] = container;
|
|
74
|
+
$[16] = offset;
|
|
75
|
+
$[17] = props;
|
|
76
|
+
$[18] = t2;
|
|
77
|
+
$[19] = t4;
|
|
78
|
+
$[20] = t5;
|
|
79
|
+
} else t5 = $[20];
|
|
80
|
+
return t5;
|
|
25
81
|
}
|
|
26
82
|
/** The popover surface without a dialog, for listboxes and menus. */
|
|
27
|
-
function PopoverSurface(
|
|
83
|
+
function PopoverSurface(t0) {
|
|
84
|
+
const $ = c(13);
|
|
85
|
+
let children;
|
|
86
|
+
let className;
|
|
87
|
+
let props;
|
|
88
|
+
let t1;
|
|
89
|
+
if ($[0] !== t0) {
|
|
90
|
+
({children, className, offset: t1, ...props} = t0);
|
|
91
|
+
$[0] = t0;
|
|
92
|
+
$[1] = children;
|
|
93
|
+
$[2] = className;
|
|
94
|
+
$[3] = props;
|
|
95
|
+
$[4] = t1;
|
|
96
|
+
} else {
|
|
97
|
+
children = $[1];
|
|
98
|
+
className = $[2];
|
|
99
|
+
props = $[3];
|
|
100
|
+
t1 = $[4];
|
|
101
|
+
}
|
|
102
|
+
const offset = t1 === void 0 ? 6 : t1;
|
|
28
103
|
const container = usePortalContainer();
|
|
29
104
|
if (container === null) return null;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
105
|
+
let t2;
|
|
106
|
+
if ($[5] !== className) {
|
|
107
|
+
t2 = cx("panneau-popover", Popover_module_default.popover, className);
|
|
108
|
+
$[5] = className;
|
|
109
|
+
$[6] = t2;
|
|
110
|
+
} else t2 = $[6];
|
|
111
|
+
let t3;
|
|
112
|
+
if ($[7] !== children || $[8] !== container || $[9] !== offset || $[10] !== props || $[11] !== t2) {
|
|
113
|
+
t3 = /* @__PURE__ */ jsx(Popover, {
|
|
114
|
+
...props,
|
|
115
|
+
offset,
|
|
116
|
+
className: t2,
|
|
117
|
+
UNSTABLE_portalContainer: container,
|
|
118
|
+
children
|
|
119
|
+
});
|
|
120
|
+
$[7] = children;
|
|
121
|
+
$[8] = container;
|
|
122
|
+
$[9] = offset;
|
|
123
|
+
$[10] = props;
|
|
124
|
+
$[11] = t2;
|
|
125
|
+
$[12] = t3;
|
|
126
|
+
} else t3 = $[12];
|
|
127
|
+
return t3;
|
|
37
128
|
}
|
|
38
129
|
//#endregion
|
|
39
130
|
export { Popover$1 as Popover, PopoverSurface, PopoverTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["Popover","AriaPopover","styles"],"sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Popover as AriaPopover,\n type PopoverProps as AriaPopoverProps,\n Dialog,\n} from 'react-aria-components';\n\nimport { usePortalContainer } from '../root/PanneauRoot';\nimport { cx } from '../utils/cx';\nimport styles from './Popover.module.css';\n\nexport interface PopoverProps extends Omit<\n AriaPopoverProps,\n 'className' | 'style' | 'children' | 'UNSTABLE_portalContainer'\n> {\n children?: ReactNode;\n /** Accessible label of the popover's dialog, when it has no heading. */\n 'aria-label'?: string;\n className?: string;\n dialogClassName?: string;\n}\n\n/**\n * A popover with free content, inside a `PopoverTrigger` with its button as the first child. Its\n * content is a non-modal dialog: focus moves into it and comes back to the button when it closes.\n */\nexport function Popover({\n children,\n 'aria-label': ariaLabel,\n className,\n dialogClassName,\n offset = 6,\n ...props\n}: PopoverProps) {\n const container = usePortalContainer();\n if (container === null) {\n return null;\n }\n return (\n <AriaPopover\n {...props}\n offset={offset}\n className={cx('panneau-popover', styles.popover, className)}\n UNSTABLE_portalContainer={container}\n >\n <Dialog aria-label={ariaLabel} className={cx(styles.dialog, dialogClassName)}>\n {children}\n </Dialog>\n </AriaPopover>\n );\n}\n\n/** The popover surface without a dialog, for listboxes and menus. */\nexport function PopoverSurface({\n children,\n className,\n offset = 6,\n ...props\n}: Omit<PopoverProps, 'aria-label' | 'dialogClassName'>) {\n const container = usePortalContainer();\n if (container === null) {\n return null;\n }\n return (\n <AriaPopover\n {...props}\n offset={offset}\n className={cx('panneau-popover', styles.popover, className)}\n UNSTABLE_portalContainer={container}\n >\n {children}\n </AriaPopover>\n );\n}\n\nexport { DialogTrigger as PopoverTrigger } from 'react-aria-components';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["ReactNode","Popover","AriaPopover","PopoverProps","AriaPopoverProps","Dialog","usePortalContainer","cx","styles","Omit","children","className","dialogClassName","t0","$","_c","ariaLabel","props","t1","offset","undefined","container","t2","popover","t3","dialog","t4","t5","PopoverSurface","DialogTrigger","PopoverTrigger","Popover","_c","styles","AriaPopover"],"sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Popover as AriaPopover,\n type PopoverProps as AriaPopoverProps,\n Dialog,\n} from 'react-aria-components';\n\nimport { usePortalContainer } from '../root/PanneauRoot';\nimport { cx } from '../utils/cx';\nimport styles from './Popover.module.css';\n\nexport interface PopoverProps extends Omit<\n AriaPopoverProps,\n 'className' | 'style' | 'children' | 'UNSTABLE_portalContainer'\n> {\n children?: ReactNode;\n /** Accessible label of the popover's dialog, when it has no heading. */\n 'aria-label'?: string;\n className?: string;\n dialogClassName?: string;\n}\n\n/**\n * A popover with free content, inside a `PopoverTrigger` with its button as the first child. Its\n * content is a non-modal dialog: focus moves into it and comes back to the button when it closes.\n */\nexport function Popover({\n children,\n 'aria-label': ariaLabel,\n className,\n dialogClassName,\n offset = 6,\n ...props\n}: PopoverProps) {\n const container = usePortalContainer();\n if (container === null) {\n return null;\n }\n return (\n <AriaPopover\n {...props}\n offset={offset}\n className={cx('panneau-popover', styles.popover, className)}\n UNSTABLE_portalContainer={container}\n >\n <Dialog aria-label={ariaLabel} className={cx(styles.dialog, dialogClassName)}>\n {children}\n </Dialog>\n </AriaPopover>\n );\n}\n\n/** The popover surface without a dialog, for listboxes and menus. */\nexport function PopoverSurface({\n children,\n className,\n offset = 6,\n ...props\n}: Omit<PopoverProps, 'aria-label' | 'dialogClassName'>) {\n const container = usePortalContainer();\n if (container === null) {\n return null;\n }\n return (\n <AriaPopover\n {...props}\n offset={offset}\n className={cx('panneau-popover', styles.popover, className)}\n UNSTABLE_portalContainer={container}\n >\n {children}\n </AriaPopover>\n );\n}\n\nexport { DialogTrigger as PopoverTrigger } from 'react-aria-components';\n"],"mappings":";;;;;;;;;;;AA0BA,SAAOC,UAAAY,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAiB,CAAA,CAAAH,UAAA,cAAAM,WAAAL,WAAAC,iBAAAO,QAAAD,IAAA,GAAAD,SAAAJ;EAOTC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAJ;EAAAI,EAAA,KAAAH;EAA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/popover/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Popover. */\nexport const popoverTokens = defineComponentTokens('popover', {\n /** Background. */\n bg: 'var(--panneau-color-surface-raised)',\n /** Border color. */\n 'border-color': 'var(--panneau-color-border)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-lg)',\n /** Shadow. */\n shadow: 'var(--panneau-shadow-lg)',\n /** Padding of the content. */\n padding: 'var(--panneau-space-3)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","popoverTokens","bg","radius","shadow","padding"],"sources":["../../src/popover/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Popover. */\nexport const popoverTokens = defineComponentTokens('popover', {\n /** Background. */\n bg: 'var(--panneau-color-surface-raised)',\n /** Border color. */\n 'border-color': 'var(--panneau-color-border)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-lg)',\n /** Shadow. */\n shadow: 'var(--panneau-shadow-lg)',\n /** Padding of the content. */\n padding: 'var(--panneau-space-3)',\n});\n"],"mappings":";;;AAGA,IAAaC,gBAAgBD,sBAAsB,WAAW;;CAE1DE,IAAI;;CAEJ,gBAAgB;;CAEhBC,QAAQ;;CAERC,QAAQ;;CAERC,SAAS;AACb,CAAC"}
|
package/dist/prose/Prose.js
CHANGED
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import Prose_module_default from "./Prose.module.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/prose/Prose.tsx
|
|
5
6
|
/**
|
|
6
7
|
* Styles the elements of rich content (headings, paragraphs, lists, links, quotes, code, tables):
|
|
7
8
|
* the output of an editor, Markdown, or a help page. Outside of it, Panneau styles no element.
|
|
8
9
|
*/
|
|
9
|
-
function Prose(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function Prose(t0) {
|
|
11
|
+
const $ = c(10);
|
|
12
|
+
let className;
|
|
13
|
+
let props;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({as: t1, className, ...props} = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = className;
|
|
19
|
+
$[2] = props;
|
|
20
|
+
$[3] = t1;
|
|
21
|
+
} else {
|
|
22
|
+
className = $[1];
|
|
23
|
+
props = $[2];
|
|
24
|
+
t1 = $[3];
|
|
25
|
+
}
|
|
26
|
+
const Element = t1 === void 0 ? "div" : t1;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== className) {
|
|
29
|
+
t2 = cx("panneau-prose", Prose_module_default.prose, className);
|
|
30
|
+
$[4] = className;
|
|
31
|
+
$[5] = t2;
|
|
32
|
+
} else t2 = $[5];
|
|
33
|
+
let t3;
|
|
34
|
+
if ($[6] !== Element || $[7] !== props || $[8] !== t2) {
|
|
35
|
+
t3 = /* @__PURE__ */ jsx(Element, {
|
|
36
|
+
...props,
|
|
37
|
+
className: t2
|
|
38
|
+
});
|
|
39
|
+
$[6] = Element;
|
|
40
|
+
$[7] = props;
|
|
41
|
+
$[8] = t2;
|
|
42
|
+
$[9] = t3;
|
|
43
|
+
} else t3 = $[9];
|
|
44
|
+
return t3;
|
|
14
45
|
}
|
|
15
46
|
//#endregion
|
|
16
47
|
export { Prose };
|
package/dist/prose/Prose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prose.js","names":["styles"],"sources":["../../src/prose/Prose.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Prose.module.css';\n\nexport interface ProseProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'article' | 'section';\n}\n\n/**\n * Styles the elements of rich content (headings, paragraphs, lists, links, quotes, code, tables):\n * the output of an editor, Markdown, or a help page. Outside of it, Panneau styles no element.\n */\nexport function Prose({ as: Element = 'div', className, ...props }: ProseProps) {\n return <Element {...props} className={cx('panneau-prose', styles.prose, className)} />;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Prose.js","names":["HTMLAttributes","cx","styles","ProseProps","HTMLElement","as","Prose","t0","$","_c","className","props","t1","Element","undefined","t2","prose","t3","_c","styles"],"sources":["../../src/prose/Prose.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Prose.module.css';\n\nexport interface ProseProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'article' | 'section';\n}\n\n/**\n * Styles the elements of rich content (headings, paragraphs, lists, links, quotes, code, tables):\n * the output of an editor, Markdown, or a help page. Outside of it, Panneau styles no element.\n */\nexport function Prose({ as: Element = 'div', className, ...props }: ProseProps) {\n return <Element {...props} className={cx('panneau-prose', styles.prose, className)} />;\n}\n"],"mappings":";;;;;;;;;AAcA,SAAOM,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAe,CAAA,CAAAF,IAAAO,IAAAF,WAAA,GAAAC,SAAAJ;EAAwDC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAlD,MAAAK,UAAAD,OAAAE,KAAAA,IAAA,QAAAF;CAAe,IAAAG;CAAA,IAAAP,EAAA,OAAAE,WAAA;EACDK,KAAAd,GAAG,iBAAiBC,qBAAMc,OAAQN,SAAS;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAK,WAAAL,EAAA,OAAAG,SAAAH,EAAA,OAAAO,IAAA;EAA3EE,KAAA,oBAAC,SAAD;GAAQ,GAAKN;GAAkB,WAAAI;EAA4C,CAAA;EAAIP,EAAA,KAAAK;EAAAL,EAAA,KAAAG;EAAAH,EAAA,KAAAO;EAAAP,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAA/ES;AAA+E"}
|
package/dist/prose/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/prose/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Prose. Its headings use the tokens of Heading. */\nexport const proseTokens = defineComponentTokens('prose', {\n /** Line height of the content. */\n 'line-height': '1.6',\n /** Space between blocks: paragraphs, lists, tables. */\n gap: 'var(--panneau-space-4)',\n /** Space above a heading. */\n 'heading-gap': 'var(--panneau-space-6)',\n /** Indent of lists. */\n 'list-indent': '1.5em',\n /** Color of links. */\n 'link-color': 'var(--panneau-color-link)',\n /** Font size of code, relative to the text around it. */\n 'code-font-size': '0.875em',\n /** Text color of code: inherited, so that a site's global `code` color doesn't apply. */\n 'code-color': 'inherit',\n /** Background of code and code blocks. */\n 'code-bg': 'var(--panneau-color-surface-sunken)',\n /** Corner radius of code and code blocks. */\n 'code-radius': 'var(--panneau-radius-sm)',\n /** Border of quotes. */\n 'quote-border-color': 'var(--panneau-color-border)',\n /** Text color of quotes and captions. */\n 'quote-color': 'var(--panneau-color-text-muted)',\n /** Color of the borders of tables and of horizontal rules. */\n 'border-color': 'var(--panneau-color-border)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","proseTokens","gap"],"sources":["../../src/prose/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Prose. Its headings use the tokens of Heading. */\nexport const proseTokens = defineComponentTokens('prose', {\n /** Line height of the content. */\n 'line-height': '1.6',\n /** Space between blocks: paragraphs, lists, tables. */\n gap: 'var(--panneau-space-4)',\n /** Space above a heading. */\n 'heading-gap': 'var(--panneau-space-6)',\n /** Indent of lists. */\n 'list-indent': '1.5em',\n /** Color of links. */\n 'link-color': 'var(--panneau-color-link)',\n /** Font size of code, relative to the text around it. */\n 'code-font-size': '0.875em',\n /** Text color of code: inherited, so that a site's global `code` color doesn't apply. */\n 'code-color': 'inherit',\n /** Background of code and code blocks. */\n 'code-bg': 'var(--panneau-color-surface-sunken)',\n /** Corner radius of code and code blocks. */\n 'code-radius': 'var(--panneau-radius-sm)',\n /** Border of quotes. */\n 'quote-border-color': 'var(--panneau-color-border)',\n /** Text color of quotes and captions. */\n 'quote-color': 'var(--panneau-color-text-muted)',\n /** Color of the borders of tables and of horizontal rules. */\n 'border-color': 'var(--panneau-color-border)',\n});\n"],"mappings":";;;AAGA,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtD,eAAe;;CAEfE,KAAK;;CAEL,eAAe;;CAEf,eAAe;;CAEf,cAAc;;CAEd,kBAAkB;;CAElB,cAAc;;CAEd,WAAW;;CAEX,eAAe;;CAEf,sBAAsB;;CAEtB,eAAe;;CAEf,gBAAgB;AACpB,CAAC"}
|
|
@@ -67,11 +67,101 @@
|
|
|
67
67
|
min-width: 0;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
.panneau-radio-group-option-label {
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
.panneau-radio-group-description {
|
|
71
75
|
font-size: var(--panneau-font-size-sm);
|
|
72
76
|
color: var(--panneau-color-text-muted);
|
|
73
77
|
}
|
|
74
78
|
|
|
79
|
+
/* Leading media of an option, between the radio and the label. */
|
|
80
|
+
.panneau-radio-group-media {
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
flex: 0 0 auto;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
width: var(--panneau-radio-media-size, 2rem);
|
|
86
|
+
height: var(--panneau-radio-media-size, 2rem);
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
border-radius: var(--panneau-radio-media-radius, var(--panneau-radius-full));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.panneau-radio-group-media > :is(img, svg, video, picture) {
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
object-fit: cover;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Cards: the options in a grid of --_panneau-radio-group-columns columns, inside a size container
|
|
99
|
+
* of their own, so that they become a single column when the group is narrow, wherever it is.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
.panneau-radio-group-grid {
|
|
103
|
+
container-type: inline-size;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.panneau-radio-group-cards .panneau-radio-group-options {
|
|
107
|
+
display: grid;
|
|
108
|
+
grid-template-columns: repeat(var(--_panneau-radio-group-columns, 2), minmax(0, 1fr));
|
|
109
|
+
gap: var(--panneau-radio-card-gap, var(--panneau-space-2));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@container (max-width: 28rem) {
|
|
113
|
+
.panneau-radio-group-cards .panneau-radio-group-options {
|
|
114
|
+
grid-template-columns: minmax(0, 1fr);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.panneau-radio-group-card {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: var(--panneau-space-3);
|
|
122
|
+
padding: var(--panneau-radio-card-padding, var(--panneau-space-3));
|
|
123
|
+
background-color: var(--panneau-radio-card-bg, var(--panneau-color-surface));
|
|
124
|
+
border: var(--panneau-border-width) solid
|
|
125
|
+
var(--panneau-radio-card-border-color, var(--panneau-color-border));
|
|
126
|
+
border-radius: var(--panneau-radio-card-radius, var(--panneau-radius-md));
|
|
127
|
+
transition:
|
|
128
|
+
border-color var(--panneau-duration),
|
|
129
|
+
box-shadow var(--panneau-duration);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.panneau-radio-group-card .panneau-radio-group-circle {
|
|
133
|
+
margin-top: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.panneau-radio-group-card .panneau-radio-group-option-label {
|
|
137
|
+
font-weight: var(--panneau-radio-card-label-font-weight, var(--panneau-font-weight-medium));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.panneau-radio-group-card[data-hovered] {
|
|
141
|
+
border-color: var(--panneau-radio-card-border-color-hover, var(--panneau-color-border-control));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* The selected card: a border of twice the width, drawn inside so that nothing moves. */
|
|
145
|
+
.panneau-radio-group-card[data-selected] {
|
|
146
|
+
border-color: var(--panneau-radio-card-border-color-selected, var(--panneau-color-accent));
|
|
147
|
+
box-shadow: inset 0 0 0 var(--panneau-border-width)
|
|
148
|
+
var(--panneau-radio-card-border-color-selected, var(--panneau-color-accent));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.panneau-radio-group-card[data-invalid] {
|
|
152
|
+
border-color: var(--panneau-color-danger);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* A card shows the focus ring around itself, instead of around its radio. */
|
|
156
|
+
.panneau-radio-group-card[data-focus-visible] {
|
|
157
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
158
|
+
outline-offset: 2px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.panneau-radio-group-card[data-focus-visible] .panneau-radio-group-circle {
|
|
162
|
+
outline: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
75
165
|
@media (pointer: coarse) {
|
|
76
166
|
.panneau-radio-group-radio {
|
|
77
167
|
min-height: 2.75rem;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import { type RadioGroupProps as AriaRadioGroupProps } from 'react-aria-components';
|
|
2
3
|
import { type FieldChromeProps } from '../field/FieldParts';
|
|
3
4
|
import type { OptionValue, SelectOption } from '../select/Select';
|
|
5
|
+
/** An option of a `RadioGroup`: a `SelectOption`, with an optional leading media. */
|
|
6
|
+
export interface RadioGroupOption extends SelectOption {
|
|
7
|
+
/** Leading media, such as an avatar or an image, between the radio and the label. */
|
|
8
|
+
media?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** How a `RadioGroup` shows its options: a list of radios, or bordered cards in a grid. */
|
|
11
|
+
export type RadioGroupAppearance = 'list' | 'cards';
|
|
4
12
|
export interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate' | 'value' | 'defaultValue' | 'onChange'>, FieldChromeProps {
|
|
5
|
-
options: readonly
|
|
13
|
+
options: readonly RadioGroupOption[];
|
|
6
14
|
value?: OptionValue | null;
|
|
7
15
|
onChange?: (value: OptionValue) => void;
|
|
16
|
+
/**
|
|
17
|
+
* `list` (default) shows the options as radios, one under the other or side by side with
|
|
18
|
+
* `orientation="horizontal"`. `cards` shows them as bordered cards in a grid of `columns`, which
|
|
19
|
+
* becomes a single column in a narrow container. The selected card has a stronger border.
|
|
20
|
+
*/
|
|
21
|
+
appearance?: RadioGroupAppearance;
|
|
22
|
+
/** Columns of cards, with `appearance="cards"`. Defaults to 2. */
|
|
23
|
+
columns?: number;
|
|
8
24
|
radioClassName?: string;
|
|
9
25
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
26
|
+
/**
|
|
27
|
+
* A set of options where one can be picked, all visible at once, as a list of radios or as cards
|
|
28
|
+
* (`appearance="cards"`). Arrow keys move between options in both appearances.
|
|
29
|
+
*/
|
|
30
|
+
export declare function RadioGroup({ options, value, onChange, label, description, errors, orientation, appearance, columns, isRequired, className, labelClassName, descriptionClassName, errorsClassName, radioClassName, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
12
31
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/radio-group/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,eAAe,IAAI,mBAAmB,EAE9C,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,KAAK,gBAAgB,EAKxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,MAAM,WAAW,eACb,SACI,IAAI,CACA,mBAAmB,EACjB,WAAW,GACX,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,OAAO,GACP,cAAc,GACd,UAAU,CACf,EACD,gBAAgB;IACpB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/radio-group/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAEH,KAAK,eAAe,IAAI,mBAAmB,EAE9C,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,KAAK,gBAAgB,EAKxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,qFAAqF;AACrF,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IAClD,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,2FAA2F;AAC3F,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,eACb,SACI,IAAI,CACA,mBAAmB,EACjB,WAAW,GACX,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,OAAO,GACP,cAAc,GACd,UAAU,CACf,EACD,gBAAgB;IACpB,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC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