@panneau/ui 0.0.0-stage → 5.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/dist/alert/Alert.css +78 -0
- package/dist/alert/Alert.d.ts +30 -0
- package/dist/alert/Alert.d.ts.map +1 -0
- package/dist/alert/Alert.js +64 -0
- package/dist/alert/Alert.js.map +1 -0
- package/dist/alert/Alert.module.js +30 -0
- package/dist/alert/Alert.module.js.map +1 -0
- package/dist/badge/Badge.css +60 -0
- package/dist/badge/Badge.d.ts +15 -0
- package/dist/badge/Badge.d.ts.map +1 -0
- package/dist/badge/Badge.js +21 -0
- package/dist/badge/Badge.js.map +1 -0
- package/dist/badge/Badge.module.js +22 -0
- package/dist/badge/Badge.module.js.map +1 -0
- package/dist/button/Button.css +112 -0
- package/dist/button/Button.d.ts +26 -0
- package/dist/button/Button.d.ts.map +1 -0
- package/dist/button/Button.js +39 -0
- package/dist/button/Button.js.map +1 -0
- package/dist/button/Button.module.js +28 -0
- package/dist/button/Button.module.js.map +1 -0
- package/dist/card/Card.css +50 -0
- package/dist/card/Card.d.ts +20 -0
- package/dist/card/Card.d.ts.map +1 -0
- package/dist/card/Card.js +38 -0
- package/dist/card/Card.js.map +1 -0
- package/dist/card/Card.module.js +18 -0
- package/dist/card/Card.module.js.map +1 -0
- package/dist/checkbox/Checkbox.css +79 -0
- package/dist/checkbox/Checkbox.d.ts +11 -0
- package/dist/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/checkbox/Checkbox.js +43 -0
- package/dist/checkbox/Checkbox.js.map +1 -0
- package/dist/checkbox/Checkbox.module.js +16 -0
- package/dist/checkbox/Checkbox.module.js.map +1 -0
- package/dist/checkbox/ChoiceChrome.d.ts +15 -0
- package/dist/checkbox/ChoiceChrome.d.ts.map +1 -0
- package/dist/checkbox/ChoiceChrome.js +36 -0
- package/dist/checkbox/ChoiceChrome.js.map +1 -0
- package/dist/combo-box/ComboBox.css +26 -0
- package/dist/combo-box/ComboBox.d.ts +30 -0
- package/dist/combo-box/ComboBox.d.ts.map +1 -0
- package/dist/combo-box/ComboBox.js +106 -0
- package/dist/combo-box/ComboBox.js.map +1 -0
- package/dist/combo-box/ComboBox.module.js +14 -0
- package/dist/combo-box/ComboBox.module.js.map +1 -0
- package/dist/date-picker/DatePicker.css +135 -0
- package/dist/date-picker/DatePicker.d.ts +12 -0
- package/dist/date-picker/DatePicker.d.ts.map +1 -0
- package/dist/date-picker/DatePicker.js +93 -0
- package/dist/date-picker/DatePicker.js.map +1 -0
- package/dist/date-picker/DatePicker.module.js +30 -0
- package/dist/date-picker/DatePicker.module.js.map +1 -0
- package/dist/dialog/Dialog.css +126 -0
- package/dist/dialog/Dialog.d.ts +31 -0
- package/dist/dialog/Dialog.d.ts.map +1 -0
- package/dist/dialog/Dialog.js +61 -0
- package/dist/dialog/Dialog.js.map +1 -0
- package/dist/dialog/Dialog.module.js +30 -0
- package/dist/dialog/Dialog.module.js.map +1 -0
- package/dist/disclosure/Disclosure.css +54 -0
- package/dist/disclosure/Disclosure.d.ts +20 -0
- package/dist/disclosure/Disclosure.d.ts.map +1 -0
- package/dist/disclosure/Disclosure.js +43 -0
- package/dist/disclosure/Disclosure.js.map +1 -0
- package/dist/disclosure/Disclosure.module.js +22 -0
- package/dist/disclosure/Disclosure.module.js.map +1 -0
- package/dist/field/Field.css +145 -0
- package/dist/field/Field.module.js +30 -0
- package/dist/field/Field.module.js.map +1 -0
- package/dist/field/FieldParts.d.ts +32 -0
- package/dist/field/FieldParts.d.ts.map +1 -0
- package/dist/field/FieldParts.js +56 -0
- package/dist/field/FieldParts.js.map +1 -0
- package/dist/field/Fieldset.d.ts +22 -0
- package/dist/field/Fieldset.d.ts.map +1 -0
- package/dist/field/Fieldset.js +50 -0
- package/dist/field/Fieldset.js.map +1 -0
- package/dist/icon/Icon.css +5 -0
- package/dist/icon/Icon.d.ts +31 -0
- package/dist/icon/Icon.d.ts.map +1 -0
- package/dist/icon/Icon.js +29 -0
- package/dist/icon/Icon.js.map +1 -0
- package/dist/icon/Icon.module.js +8 -0
- package/dist/icon/Icon.module.js.map +1 -0
- package/dist/icon-button/IconButton.css +9 -0
- package/dist/icon-button/IconButton.d.ts +15 -0
- package/dist/icon-button/IconButton.d.ts.map +1 -0
- package/dist/icon-button/IconButton.js +26 -0
- package/dist/icon-button/IconButton.js.map +1 -0
- package/dist/icon-button/IconButton.module.js +12 -0
- package/dist/icon-button/IconButton.module.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/intl/messages.d.ts +2 -0
- package/dist/intl/messages.d.ts.map +1 -0
- package/dist/intl/messages.js +1 -0
- package/dist/intl/usePanneauIntl.d.ts +7 -0
- package/dist/intl/usePanneauIntl.d.ts.map +1 -0
- package/dist/intl/usePanneauIntl.js +22 -0
- package/dist/intl/usePanneauIntl.js.map +1 -0
- package/dist/locales/index.d.ts +15 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/index.js +21 -0
- package/dist/locales/index.js.map +1 -0
- package/dist/menu/Menu.d.ts +27 -0
- package/dist/menu/Menu.d.ts.map +1 -0
- package/dist/menu/Menu.js +57 -0
- package/dist/menu/Menu.js.map +1 -0
- package/dist/number-input/NumberInput.css +57 -0
- package/dist/number-input/NumberInput.d.ts +21 -0
- package/dist/number-input/NumberInput.d.ts.map +1 -0
- package/dist/number-input/NumberInput.js +82 -0
- package/dist/number-input/NumberInput.js.map +1 -0
- package/dist/number-input/NumberInput.module.js +16 -0
- package/dist/number-input/NumberInput.module.js.map +1 -0
- package/dist/popover/Popover.css +32 -0
- package/dist/popover/Popover.d.ts +18 -0
- package/dist/popover/Popover.d.ts.map +1 -0
- package/dist/popover/Popover.js +41 -0
- package/dist/popover/Popover.js.map +1 -0
- package/dist/popover/Popover.module.js +14 -0
- package/dist/popover/Popover.module.js.map +1 -0
- package/dist/radio-group/RadioGroup.css +83 -0
- package/dist/radio-group/RadioGroup.d.ts +12 -0
- package/dist/radio-group/RadioGroup.d.ts.map +1 -0
- package/dist/radio-group/RadioGroup.js +61 -0
- package/dist/radio-group/RadioGroup.js.map +1 -0
- package/dist/radio-group/RadioGroup.module.js +20 -0
- package/dist/radio-group/RadioGroup.module.js.map +1 -0
- package/dist/root/PanneauRoot.css +251 -0
- package/dist/root/PanneauRoot.d.ts +34 -0
- package/dist/root/PanneauRoot.d.ts.map +1 -0
- package/dist/root/PanneauRoot.js +84 -0
- package/dist/root/PanneauRoot.js.map +1 -0
- package/dist/root/PanneauRoot.module.js +12 -0
- package/dist/root/PanneauRoot.module.js.map +1 -0
- package/dist/select/ListBox.css +104 -0
- package/dist/select/ListBox.module.js +32 -0
- package/dist/select/ListBox.module.js.map +1 -0
- package/dist/select/Select.d.ts +45 -0
- package/dist/select/Select.d.ts.map +1 -0
- package/dist/select/Select.js +136 -0
- package/dist/select/Select.js.map +1 -0
- package/dist/spinner/Spinner.css +40 -0
- package/dist/spinner/Spinner.d.ts +11 -0
- package/dist/spinner/Spinner.d.ts.map +1 -0
- package/dist/spinner/Spinner.js +25 -0
- package/dist/spinner/Spinner.js.map +1 -0
- package/dist/spinner/Spinner.module.js +18 -0
- package/dist/spinner/Spinner.module.js.map +1 -0
- package/dist/switch/Switch.css +69 -0
- package/dist/switch/Switch.d.ts +11 -0
- package/dist/switch/Switch.d.ts.map +1 -0
- package/dist/switch/Switch.js +33 -0
- package/dist/switch/Switch.js.map +1 -0
- package/dist/switch/Switch.module.js +15 -0
- package/dist/switch/Switch.module.js.map +1 -0
- package/dist/tabs/Tabs.css +83 -0
- package/dist/tabs/Tabs.d.ts +27 -0
- package/dist/tabs/Tabs.d.ts.map +1 -0
- package/dist/tabs/Tabs.js +141 -0
- package/dist/tabs/Tabs.js.map +1 -0
- package/dist/tabs/Tabs.module.js +16 -0
- package/dist/tabs/Tabs.module.js.map +1 -0
- package/dist/text-area/TextArea.css +8 -0
- package/dist/text-area/TextArea.d.ts +11 -0
- package/dist/text-area/TextArea.d.ts.map +1 -0
- package/dist/text-area/TextArea.js +41 -0
- package/dist/text-area/TextArea.js.map +1 -0
- package/dist/text-area/TextArea.module.js +8 -0
- package/dist/text-area/TextArea.module.js.map +1 -0
- package/dist/text-input/TextInput.d.ts +17 -0
- package/dist/text-input/TextInput.d.ts.map +1 -0
- package/dist/text-input/TextInput.js +61 -0
- package/dist/text-input/TextInput.js.map +1 -0
- package/dist/theme/bootstrap.d.ts +8 -0
- package/dist/theme/bootstrap.d.ts.map +1 -0
- package/dist/theme/bootstrap.js +61 -0
- package/dist/theme/bootstrap.js.map +1 -0
- package/dist/theme/theme.d.ts +23 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +30 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/time-input/TimeInput.d.ts +8 -0
- package/dist/time-input/TimeInput.d.ts.map +1 -0
- package/dist/time-input/TimeInput.js +45 -0
- package/dist/time-input/TimeInput.js.map +1 -0
- package/dist/toast/Toast.css +109 -0
- package/dist/toast/Toast.d.ts +39 -0
- package/dist/toast/Toast.d.ts.map +1 -0
- package/dist/toast/Toast.js +152 -0
- package/dist/toast/Toast.js.map +1 -0
- package/dist/toast/Toast.module.js +30 -0
- package/dist/toast/Toast.module.js.map +1 -0
- package/dist/tooltip/Tooltip.css +25 -0
- package/dist/tooltip/Tooltip.d.ts +19 -0
- package/dist/tooltip/Tooltip.d.ts.map +1 -0
- package/dist/tooltip/Tooltip.js +29 -0
- package/dist/tooltip/Tooltip.js.map +1 -0
- package/dist/tooltip/Tooltip.module.js +12 -0
- package/dist/tooltip/Tooltip.module.js.map +1 -0
- package/dist/utils/cx.d.ts +3 -0
- package/dist/utils/cx.d.ts.map +1 -0
- package/dist/utils/cx.js +9 -0
- package/dist/utils/cx.js.map +1 -0
- package/package.json +48 -5
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.panneau-options-QPuFOV {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--panneau-space-1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.panneau-horizontal-KgXsCy .panneau-options-QPuFOV {
|
|
8
|
+
flex-flow: row wrap;
|
|
9
|
+
gap: var(--panneau-space-1) var(--panneau-space-4);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.panneau-radio-zz4Tx- {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
gap: var(--panneau-space-2);
|
|
16
|
+
min-height: 1.5rem;
|
|
17
|
+
font-size: var(--panneau-font-size-md);
|
|
18
|
+
color: var(--panneau-color-text);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
-webkit-tap-highlight-color: transparent;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.panneau-radio-zz4Tx-[data-disabled] {
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
opacity: 0.55;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.panneau-radio-zz4Tx-[data-readonly] {
|
|
29
|
+
cursor: default;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.panneau-circle-IySLxv {
|
|
33
|
+
flex: 0 0 auto;
|
|
34
|
+
width: 1.125rem;
|
|
35
|
+
height: 1.125rem;
|
|
36
|
+
margin-top: 0.125rem;
|
|
37
|
+
background-color: var(--panneau-color-surface);
|
|
38
|
+
border: var(--panneau-border-width) solid var(--panneau-color-border-control);
|
|
39
|
+
border-radius: var(--panneau-radius-full);
|
|
40
|
+
transition:
|
|
41
|
+
border-color var(--panneau-duration),
|
|
42
|
+
border-width var(--panneau-duration);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.panneau-radio-zz4Tx-[data-hovered] .panneau-circle-IySLxv {
|
|
46
|
+
border-color: var(--panneau-color-text-muted);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.panneau-radio-zz4Tx-[data-selected] .panneau-circle-IySLxv {
|
|
50
|
+
border-color: var(--panneau-color-accent);
|
|
51
|
+
border-width: 0.3125rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.panneau-radio-zz4Tx-[data-invalid] .panneau-circle-IySLxv {
|
|
55
|
+
border-color: var(--panneau-color-danger);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.panneau-radio-zz4Tx-[data-focus-visible] .panneau-circle-IySLxv {
|
|
59
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
60
|
+
outline-offset: 2px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.panneau-text-W98R9k {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.panneau-description-SPgnUk {
|
|
70
|
+
font-size: var(--panneau-font-size-sm);
|
|
71
|
+
color: var(--panneau-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (pointer: coarse) {
|
|
75
|
+
.panneau-radio-zz4Tx- {
|
|
76
|
+
min-height: 2.75rem;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.panneau-circle-IySLxv {
|
|
81
|
+
margin-top: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RadioGroupProps as AriaRadioGroupProps } from 'react-aria-components';
|
|
2
|
+
import { type FieldChromeProps } from '../field/FieldParts';
|
|
3
|
+
import type { OptionValue, SelectOption } from '../select/Select';
|
|
4
|
+
export interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate' | 'value' | 'defaultValue' | 'onChange'>, FieldChromeProps {
|
|
5
|
+
options: readonly SelectOption[];
|
|
6
|
+
value?: OptionValue | null;
|
|
7
|
+
onChange?: (value: OptionValue) => void;
|
|
8
|
+
radioClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
/** A set of options where one can be picked, all visible at once. */
|
|
11
|
+
export declare function RadioGroup({ options, value, onChange, label, description, errors, orientation, isRequired, className, labelClassName, descriptionClassName, errorsClassName, radioClassName, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +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,YAAY,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,MAAW,EACX,WAAwB,EACxB,UAAU,EACV,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,GAAG,KAAK,EACX,EAAE,eAAe,+BA+CjB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import Field_module_default from "../field/Field.module.js";
|
|
3
|
+
import { FieldDescription, FieldErrors, FieldLabel } from "../field/FieldParts.js";
|
|
4
|
+
import RadioGroup_module_default from "./RadioGroup.module.js";
|
|
5
|
+
import { Radio, RadioGroup } from "react-aria-components";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/radio-group/RadioGroup.tsx
|
|
8
|
+
/** A set of options where one can be picked, all visible at once. */
|
|
9
|
+
function RadioGroup$1({ options, value, onChange, label, description, errors = [], orientation = "vertical", isRequired, className, labelClassName, descriptionClassName, errorsClassName, radioClassName, ...props }) {
|
|
10
|
+
const index = value === void 0 ? void 0 : options.findIndex((o) => o.value === value);
|
|
11
|
+
return /* @__PURE__ */ jsxs(RadioGroup, {
|
|
12
|
+
...props,
|
|
13
|
+
orientation,
|
|
14
|
+
isRequired,
|
|
15
|
+
value: index === void 0 ? void 0 : index === -1 ? null : String(index),
|
|
16
|
+
onChange: (key) => {
|
|
17
|
+
const option = options[Number(key)];
|
|
18
|
+
if (option !== void 0) onChange?.(option.value);
|
|
19
|
+
},
|
|
20
|
+
isInvalid: errors.length > 0,
|
|
21
|
+
validationBehavior: "aria",
|
|
22
|
+
className: cx(Field_module_default.field, orientation === "horizontal" && RadioGroup_module_default.horizontal, className),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx(FieldLabel, {
|
|
25
|
+
isRequired,
|
|
26
|
+
className: labelClassName,
|
|
27
|
+
children: label
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: RadioGroup_module_default.options,
|
|
31
|
+
children: options.map((option_0, position) => /* @__PURE__ */ jsxs(Radio, {
|
|
32
|
+
value: String(position),
|
|
33
|
+
isDisabled: option_0.disabled,
|
|
34
|
+
className: cx(RadioGroup_module_default.radio, radioClassName),
|
|
35
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: RadioGroup_module_default.circle,
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
39
|
+
className: RadioGroup_module_default.text,
|
|
40
|
+
children: [/* @__PURE__ */ jsx("span", { children: option_0.label }), option_0.description !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: RadioGroup_module_default.description,
|
|
42
|
+
children: option_0.description
|
|
43
|
+
}) : null]
|
|
44
|
+
})]
|
|
45
|
+
}, position))
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ jsx(FieldDescription, {
|
|
48
|
+
className: descriptionClassName,
|
|
49
|
+
children: description
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx(FieldErrors, {
|
|
52
|
+
errors,
|
|
53
|
+
className: errorsClassName
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { RadioGroup$1 as RadioGroup };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["option","RadioGroup","AriaRadioGroup","fieldStyles","styles"],"sources":["../../src/radio-group/RadioGroup.tsx"],"sourcesContent":["import {\n RadioGroup as AriaRadioGroup,\n type RadioGroupProps as AriaRadioGroupProps,\n Radio,\n} from 'react-aria-components';\n\nimport {\n type FieldChromeProps,\n FieldDescription,\n FieldErrors,\n FieldLabel,\n fieldStyles,\n} from '../field/FieldParts';\nimport type { OptionValue, SelectOption } from '../select/Select';\nimport { cx } from '../utils/cx';\nimport styles from './RadioGroup.module.css';\n\nexport interface RadioGroupProps\n extends\n Omit<\n AriaRadioGroupProps,\n | 'className'\n | 'style'\n | 'children'\n | 'isInvalid'\n | 'validate'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n >,\n FieldChromeProps {\n options: readonly SelectOption[];\n value?: OptionValue | null;\n onChange?: (value: OptionValue) => void;\n radioClassName?: string;\n}\n\n/** A set of options where one can be picked, all visible at once. */\nexport function RadioGroup({\n options,\n value,\n onChange,\n label,\n description,\n errors = [],\n orientation = 'vertical',\n isRequired,\n className,\n labelClassName,\n descriptionClassName,\n errorsClassName,\n radioClassName,\n ...props\n}: RadioGroupProps) {\n const index = value === undefined ? undefined : options.findIndex((o) => o.value === value);\n return (\n <AriaRadioGroup\n {...props}\n orientation={orientation}\n isRequired={isRequired}\n value={index === undefined ? undefined : index === -1 ? null : String(index)}\n onChange={(key) => {\n const option = options[Number(key)];\n if (option !== undefined) {\n onChange?.(option.value);\n }\n }}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx(\n fieldStyles.field,\n orientation === 'horizontal' && styles.horizontal,\n className,\n )}\n >\n <FieldLabel isRequired={isRequired} className={labelClassName}>\n {label}\n </FieldLabel>\n <div className={styles.options}>\n {options.map((option, position) => (\n <Radio\n key={position}\n value={String(position)}\n isDisabled={option.disabled}\n className={cx(styles.radio, radioClassName)}\n >\n <span className={styles.circle} aria-hidden=\"true\" />\n <span className={styles.text}>\n <span>{option.label}</span>\n {option.description !== undefined ? (\n <span className={styles.description}>{option.description}</span>\n ) : null}\n </span>\n </Radio>\n ))}\n </div>\n <FieldDescription className={descriptionClassName}>{description}</FieldDescription>\n <FieldErrors errors={errors} className={errorsClassName} />\n </AriaRadioGroup>\n );\n}\n"],"mappings":";;;;;;;;AAsCA,SAAgBC,aAAW,EACvB,SACA,OACA,UACA,OACA,aACA,SAAS,CAAA,GACT,cAAc,YACd,YACA,WACA,gBACA,sBACA,iBACA,gBACA,GAAG,SACa;CAChB,MAAM,QAAQ,UAAU,KAAA,IAAY,KAAA,IAAY,QAAQ,WAAW,MAAM,EAAE,UAAU,KAAK;CAC1F,OACI,qBAACC,YAAD;EACI,GAAI;EACS;EACD;EACZ,OAAO,UAAU,KAAA,IAAY,KAAA,IAAY,UAAU,KAAK,OAAO,OAAO,KAAK;EAC3E,WAAW,QAAQ;GACf,MAAM,SAAS,QAAQ,OAAO,GAAG;GACjC,IAAI,WAAW,KAAA,GACX,WAAW,OAAO,KAAK;EAE/B;EACA,WAAW,OAAO,SAAS;EAC3B,oBAAmB;EACnB,WAAW,GACPC,qBAAY,OACZ,gBAAgB,gBAAgBC,0BAAO,YACvC,SACJ;EAjBJ,UAAA;GAmBI,oBAAC,YAAD;IAAwB;IAAY,WAAW;IAC1C,UAAA;GACO,CAAA;GACZ,oBAAC,OAAD;IAAK,WAAWA,0BAAO;IAClB,UAAA,QAAQ,KAAKJ,UAAQ,aAClB,qBAAC,OAAD;KAEI,OAAO,OAAO,QAAQ;KACtB,YAAYA,SAAO;KACnB,WAAW,GAAGI,0BAAO,OAAO,cAAc;KAJ9C,UAAA,CAMI,oBAAC,QAAD;MAAM,WAAWA,0BAAO;MAAQ,eAAY;KAAM,CAAA,GAClD,qBAAC,QAAD;MAAM,WAAWA,0BAAO;MAAxB,UAAA,CACI,oBAAC,QAAD,EAAA,UAAOJ,SAAO,MAAY,CAAA,GACzBA,SAAO,gBAAgB,KAAA,IACpB,oBAAC,QAAD;OAAM,WAAWI,0BAAO;OAAcJ,UAAAA,SAAO;MAAkB,CAAA,IAC/D,IACF;KACH,CAAA,CAAA;IAZE,GAAA,QAYF,CACV;GACA,CAAA;GACL,oBAAC,kBAAD;IAAkB,WAAW;IAAuB,UAAA;GAA8B,CAAA;GAClF,oBAAC,aAAD;IAAqB;IAAQ,WAAW;GAAgB,CAAA;EAC5C;;AAExB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./RadioGroup.css";
|
|
2
|
+
//#region src/radio-group/RadioGroup.module.css
|
|
3
|
+
var options = "panneau-options-QPuFOV";
|
|
4
|
+
var horizontal = "panneau-horizontal-KgXsCy";
|
|
5
|
+
var radio = "panneau-radio-zz4Tx-";
|
|
6
|
+
var circle = "panneau-circle-IySLxv";
|
|
7
|
+
var text = "panneau-text-W98R9k";
|
|
8
|
+
var description = "panneau-description-SPgnUk";
|
|
9
|
+
var RadioGroup_module_default = {
|
|
10
|
+
options,
|
|
11
|
+
horizontal,
|
|
12
|
+
radio,
|
|
13
|
+
circle,
|
|
14
|
+
text,
|
|
15
|
+
description
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { circle, RadioGroup_module_default as default, description, horizontal, options, radio, text };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=RadioGroup.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.module.js","names":[],"sources":["../../src/radio-group/RadioGroup.module.css"],"sourcesContent":[".options {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n}\n\n.horizontal .options {\n flex-flow: row wrap;\n gap: var(--panneau-space-1) var(--panneau-space-4);\n}\n\n.radio {\n display: inline-flex;\n align-items: flex-start;\n gap: var(--panneau-space-2);\n min-height: 1.5rem;\n font-size: var(--panneau-font-size-md);\n color: var(--panneau-color-text);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n}\n\n.radio[data-disabled] {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.radio[data-readonly] {\n cursor: default;\n}\n\n.circle {\n flex: 0 0 auto;\n width: 1.125rem;\n height: 1.125rem;\n margin-top: 0.125rem;\n background-color: var(--panneau-color-surface);\n border: var(--panneau-border-width) solid var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-full);\n transition:\n border-color var(--panneau-duration),\n border-width var(--panneau-duration);\n}\n\n.radio[data-hovered] .circle {\n border-color: var(--panneau-color-text-muted);\n}\n\n.radio[data-selected] .circle {\n border-color: var(--panneau-color-accent);\n border-width: 0.3125rem;\n}\n\n.radio[data-invalid] .circle {\n border-color: var(--panneau-color-danger);\n}\n\n.radio[data-focus-visible] .circle {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n.text {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.description {\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n}\n\n@media (pointer: coarse) {\n .radio {\n min-height: 2.75rem;\n align-items: center;\n }\n\n .circle {\n margin-top: 0;\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Design tokens of the default theme, and the base stylesheet of Panneau. Everything is scoped to
|
|
3
|
+
* the root element: nothing here applies outside of it (decision 0005).
|
|
4
|
+
*
|
|
5
|
+
* Defaults are wrapped in :where() so that they have no specificity: a theme, or a project's own
|
|
6
|
+
* class on the root, overrides any token without fighting the cascade.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
:where(.panneau-root--wA35w) {
|
|
10
|
+
/* Surfaces */
|
|
11
|
+
--panneau-color-bg: #ffffff;
|
|
12
|
+
--panneau-color-surface: #ffffff;
|
|
13
|
+
--panneau-color-surface-sunken: #f4f4f5;
|
|
14
|
+
--panneau-color-surface-raised: #ffffff;
|
|
15
|
+
--panneau-color-hover: rgb(24 24 27 / 0.06);
|
|
16
|
+
--panneau-color-pressed: rgb(24 24 27 / 0.1);
|
|
17
|
+
--panneau-color-backdrop: rgb(9 9 11 / 0.45);
|
|
18
|
+
|
|
19
|
+
/* Text */
|
|
20
|
+
--panneau-color-text: #18181b;
|
|
21
|
+
--panneau-color-text-muted: #52525b;
|
|
22
|
+
--panneau-color-link: #1d4ed8;
|
|
23
|
+
|
|
24
|
+
/* Borders: separators, and the outline of controls (3:1 against the surface) */
|
|
25
|
+
--panneau-color-border: #e4e4e7;
|
|
26
|
+
--panneau-color-border-control: #8b8b94;
|
|
27
|
+
|
|
28
|
+
/* Accent: primary buttons, checked controls, selection */
|
|
29
|
+
--panneau-color-accent: #18181b;
|
|
30
|
+
--panneau-color-accent-hover: #3f3f46;
|
|
31
|
+
--panneau-color-accent-text: #ffffff;
|
|
32
|
+
--panneau-color-accent-subtle: #f4f4f5;
|
|
33
|
+
--panneau-color-focus: #2563eb;
|
|
34
|
+
|
|
35
|
+
/* Tones: text on surfaces, subtle backgrounds, borders */
|
|
36
|
+
--panneau-color-danger: #b91c1c;
|
|
37
|
+
--panneau-color-danger-subtle: #fef2f2;
|
|
38
|
+
--panneau-color-danger-border: #fca5a5;
|
|
39
|
+
--panneau-color-danger-solid: #b91c1c;
|
|
40
|
+
--panneau-color-danger-solid-hover: #991b1b;
|
|
41
|
+
--panneau-color-danger-solid-text: #ffffff;
|
|
42
|
+
--panneau-color-success: #15803d;
|
|
43
|
+
--panneau-color-success-subtle: #f0fdf4;
|
|
44
|
+
--panneau-color-success-border: #86efac;
|
|
45
|
+
--panneau-color-warning: #a16207;
|
|
46
|
+
--panneau-color-warning-subtle: #fefce8;
|
|
47
|
+
--panneau-color-warning-border: #fcd34d;
|
|
48
|
+
--panneau-color-info: #1d4ed8;
|
|
49
|
+
--panneau-color-info-subtle: #eff6ff;
|
|
50
|
+
--panneau-color-info-border: #93c5fd;
|
|
51
|
+
|
|
52
|
+
/* Typography */
|
|
53
|
+
--panneau-font-family:
|
|
54
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
55
|
+
--panneau-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
56
|
+
--panneau-font-size-xs: 0.75rem;
|
|
57
|
+
--panneau-font-size-sm: 0.8125rem;
|
|
58
|
+
--panneau-font-size-md: 0.875rem;
|
|
59
|
+
--panneau-font-size-lg: 1rem;
|
|
60
|
+
--panneau-font-size-xl: 1.25rem;
|
|
61
|
+
--panneau-font-size-control: 0.875rem;
|
|
62
|
+
--panneau-line-height: 1.5;
|
|
63
|
+
--panneau-line-height-tight: 1.25;
|
|
64
|
+
--panneau-font-weight-normal: 400;
|
|
65
|
+
--panneau-font-weight-medium: 500;
|
|
66
|
+
--panneau-font-weight-bold: 600;
|
|
67
|
+
|
|
68
|
+
/* Spacing, on a 4px scale */
|
|
69
|
+
--panneau-space-1: 0.25rem;
|
|
70
|
+
--panneau-space-2: 0.5rem;
|
|
71
|
+
--panneau-space-3: 0.75rem;
|
|
72
|
+
--panneau-space-4: 1rem;
|
|
73
|
+
--panneau-space-5: 1.25rem;
|
|
74
|
+
--panneau-space-6: 1.5rem;
|
|
75
|
+
--panneau-space-8: 2rem;
|
|
76
|
+
--panneau-space-10: 2.5rem;
|
|
77
|
+
|
|
78
|
+
/* Shapes */
|
|
79
|
+
--panneau-radius-sm: 0.25rem;
|
|
80
|
+
--panneau-radius-md: 0.375rem;
|
|
81
|
+
--panneau-radius-lg: 0.5rem;
|
|
82
|
+
--panneau-radius-full: 9999px;
|
|
83
|
+
--panneau-border-width: 1px;
|
|
84
|
+
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
|
|
85
|
+
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);
|
|
86
|
+
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);
|
|
87
|
+
|
|
88
|
+
/* Controls */
|
|
89
|
+
--panneau-control-height: 2.25rem;
|
|
90
|
+
--panneau-control-height-sm: 1.875rem;
|
|
91
|
+
--panneau-focus-width: 2px;
|
|
92
|
+
|
|
93
|
+
/* Motion and layers */
|
|
94
|
+
--panneau-duration: 150ms;
|
|
95
|
+
--panneau-z-overlay: 1000;
|
|
96
|
+
--panneau-z-toast: 1100;
|
|
97
|
+
|
|
98
|
+
color-scheme: light;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:where(.panneau-root--wA35w[data-color-scheme='dark']) {
|
|
102
|
+
--panneau-color-bg: #09090b;
|
|
103
|
+
--panneau-color-surface: #18181b;
|
|
104
|
+
--panneau-color-surface-sunken: #111113;
|
|
105
|
+
--panneau-color-surface-raised: #232326;
|
|
106
|
+
--panneau-color-hover: rgb(255 255 255 / 0.07);
|
|
107
|
+
--panneau-color-pressed: rgb(255 255 255 / 0.12);
|
|
108
|
+
--panneau-color-backdrop: rgb(0 0 0 / 0.6);
|
|
109
|
+
--panneau-color-text: #fafafa;
|
|
110
|
+
--panneau-color-text-muted: #a1a1aa;
|
|
111
|
+
--panneau-color-link: #93c5fd;
|
|
112
|
+
--panneau-color-border: #2e2e33;
|
|
113
|
+
--panneau-color-border-control: #71717a;
|
|
114
|
+
--panneau-color-accent: #fafafa;
|
|
115
|
+
--panneau-color-accent-hover: #d4d4d8;
|
|
116
|
+
--panneau-color-accent-text: #18181b;
|
|
117
|
+
--panneau-color-accent-subtle: #2e2e33;
|
|
118
|
+
--panneau-color-focus: #60a5fa;
|
|
119
|
+
--panneau-color-danger: #fca5a5;
|
|
120
|
+
--panneau-color-danger-subtle: rgb(127 29 29 / 0.35);
|
|
121
|
+
--panneau-color-danger-border: #b91c1c;
|
|
122
|
+
--panneau-color-danger-solid: #dc2626;
|
|
123
|
+
--panneau-color-danger-solid-hover: #b91c1c;
|
|
124
|
+
--panneau-color-danger-solid-text: #ffffff;
|
|
125
|
+
--panneau-color-success: #86efac;
|
|
126
|
+
--panneau-color-success-subtle: rgb(20 83 45 / 0.35);
|
|
127
|
+
--panneau-color-success-border: #15803d;
|
|
128
|
+
--panneau-color-warning: #fcd34d;
|
|
129
|
+
--panneau-color-warning-subtle: rgb(113 63 18 / 0.35);
|
|
130
|
+
--panneau-color-warning-border: #a16207;
|
|
131
|
+
--panneau-color-info: #93c5fd;
|
|
132
|
+
--panneau-color-info-subtle: rgb(30 58 138 / 0.35);
|
|
133
|
+
--panneau-color-info-border: #1d4ed8;
|
|
134
|
+
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
|
|
135
|
+
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);
|
|
136
|
+
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);
|
|
137
|
+
|
|
138
|
+
color-scheme: dark;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media (prefers-color-scheme: dark) {
|
|
142
|
+
:where(.panneau-root--wA35w[data-color-scheme='auto']) {
|
|
143
|
+
--panneau-color-bg: #09090b;
|
|
144
|
+
--panneau-color-surface: #18181b;
|
|
145
|
+
--panneau-color-surface-sunken: #111113;
|
|
146
|
+
--panneau-color-surface-raised: #232326;
|
|
147
|
+
--panneau-color-hover: rgb(255 255 255 / 0.07);
|
|
148
|
+
--panneau-color-pressed: rgb(255 255 255 / 0.12);
|
|
149
|
+
--panneau-color-backdrop: rgb(0 0 0 / 0.6);
|
|
150
|
+
--panneau-color-text: #fafafa;
|
|
151
|
+
--panneau-color-text-muted: #a1a1aa;
|
|
152
|
+
--panneau-color-link: #93c5fd;
|
|
153
|
+
--panneau-color-border: #2e2e33;
|
|
154
|
+
--panneau-color-border-control: #71717a;
|
|
155
|
+
--panneau-color-accent: #fafafa;
|
|
156
|
+
--panneau-color-accent-hover: #d4d4d8;
|
|
157
|
+
--panneau-color-accent-text: #18181b;
|
|
158
|
+
--panneau-color-accent-subtle: #2e2e33;
|
|
159
|
+
--panneau-color-focus: #60a5fa;
|
|
160
|
+
--panneau-color-danger: #fca5a5;
|
|
161
|
+
--panneau-color-danger-subtle: rgb(127 29 29 / 0.35);
|
|
162
|
+
--panneau-color-danger-border: #b91c1c;
|
|
163
|
+
--panneau-color-danger-solid: #dc2626;
|
|
164
|
+
--panneau-color-danger-solid-hover: #b91c1c;
|
|
165
|
+
--panneau-color-danger-solid-text: #ffffff;
|
|
166
|
+
--panneau-color-success: #86efac;
|
|
167
|
+
--panneau-color-success-subtle: rgb(20 83 45 / 0.35);
|
|
168
|
+
--panneau-color-success-border: #15803d;
|
|
169
|
+
--panneau-color-warning: #fcd34d;
|
|
170
|
+
--panneau-color-warning-subtle: rgb(113 63 18 / 0.35);
|
|
171
|
+
--panneau-color-warning-border: #a16207;
|
|
172
|
+
--panneau-color-info: #93c5fd;
|
|
173
|
+
--panneau-color-info-subtle: rgb(30 58 138 / 0.35);
|
|
174
|
+
--panneau-color-info-border: #1d4ed8;
|
|
175
|
+
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
|
|
176
|
+
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);
|
|
177
|
+
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);
|
|
178
|
+
|
|
179
|
+
color-scheme: dark;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* Touch screens: larger targets, and 16px text in inputs so that iOS doesn't zoom on focus. */
|
|
184
|
+
@media (pointer: coarse) {
|
|
185
|
+
:where(.panneau-root--wA35w) {
|
|
186
|
+
--panneau-control-height: 2.75rem;
|
|
187
|
+
--panneau-control-height-sm: 2.25rem;
|
|
188
|
+
--panneau-font-size-control: 1rem;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (prefers-reduced-motion: reduce) {
|
|
193
|
+
:where(.panneau-root--wA35w) {
|
|
194
|
+
--panneau-duration: 0ms;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Base stylesheet, scoped to the root, without specificity: components and projects override it. */
|
|
199
|
+
|
|
200
|
+
.panneau-root--wA35w {
|
|
201
|
+
/* The class is mostly a hook for the rules below, which use :where(). */
|
|
202
|
+
display: block;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:where(.panneau-root--wA35w) {
|
|
206
|
+
font-family: var(--panneau-font-family);
|
|
207
|
+
font-size: var(--panneau-font-size-md);
|
|
208
|
+
line-height: var(--panneau-line-height);
|
|
209
|
+
color: var(--panneau-color-text);
|
|
210
|
+
background-color: var(--panneau-color-bg);
|
|
211
|
+
-webkit-font-smoothing: antialiased;
|
|
212
|
+
-webkit-text-size-adjust: 100%;
|
|
213
|
+
text-size-adjust: 100%;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:where(.panneau-root--wA35w) :where(*, *::before, *::after) {
|
|
217
|
+
box-sizing: border-box;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:where(.panneau-root--wA35w) :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, fieldset, legend) {
|
|
221
|
+
margin: 0;
|
|
222
|
+
padding: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:where(.panneau-root--wA35w) :where(fieldset) {
|
|
226
|
+
border: 0;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:where(.panneau-root--wA35w) :where(button, input, select, textarea) {
|
|
231
|
+
font: inherit;
|
|
232
|
+
color: inherit;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
:where(.panneau-root--wA35w) :where(a) {
|
|
236
|
+
color: var(--panneau-color-link);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:where(.panneau-root--wA35w) :where(img, svg, video) {
|
|
240
|
+
max-width: 100%;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:where(.panneau-root--wA35w) :where(:focus-visible) {
|
|
244
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
245
|
+
outline-offset: 2px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Overlays (dialogs, popovers, menus, tooltips) render here, so that they get the tokens. */
|
|
249
|
+
.panneau-portal-keLcJN {
|
|
250
|
+
display: contents;
|
|
251
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type ColorScheme, type Theme } from '../theme/theme';
|
|
3
|
+
export interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Tokens that override the default theme: `bootstrapTheme`, or a project's own. */
|
|
5
|
+
theme?: Theme | null;
|
|
6
|
+
/** Defaults to `light`. `auto` follows the system setting. */
|
|
7
|
+
colorScheme?: ColorScheme;
|
|
8
|
+
/**
|
|
9
|
+
* Locale of dates and numbers in React Aria components. Defaults to the react-intl locale, or
|
|
10
|
+
* to the browser's without an `IntlProvider`.
|
|
11
|
+
*
|
|
12
|
+
* Without an `IntlProvider` above it, the root provides one, with the messages of every Panneau
|
|
13
|
+
* package in this locale (English without a locale, or for a locale Panneau doesn't translate).
|
|
14
|
+
* An app with its own `IntlProvider` adds them with `withPanneauMessages()` from
|
|
15
|
+
* `@panneau/intl`.
|
|
16
|
+
*/
|
|
17
|
+
locale?: string;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The element overlays render into: the closest `PanneauRoot`'s, or `undefined` for the body
|
|
22
|
+
* without a root. It is `null` during the first render of a root: overlays wait for it, since
|
|
23
|
+
* React Aria hides everything outside of a modal from assistive technologies when it opens.
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePortalContainer(): Element | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its
|
|
28
|
+
* element (no global CSS), applies a theme and a color scheme, and hosts overlays and toasts so
|
|
29
|
+
* that they get the tokens too. Panneau components must render inside one. A project can override
|
|
30
|
+
* any token with its own class on the root. Without an `IntlProvider` above it, it provides one
|
|
31
|
+
* with Panneau's messages in its `locale`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function PanneauRoot({ theme, colorScheme, locale, className, children, ...props }: PanneauRootProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=PanneauRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanneauRoot.d.ts","sourceRoot":"","sources":["../../src/root/PanneauRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAM1F,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,KAAK,EAA2B,MAAM,gBAAgB,CAAC;AAKvF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,oFAAoF;IACpF,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,GAAG,IAAI,GAAG,SAAS,CAE/D;AA2BD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAY,EACZ,WAAqB,EACrB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,gBAAgB,+BAqClB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { getThemeCss, hashString } from "../theme/theme.js";
|
|
3
|
+
import { ToastProvider } from "../toast/Toast.js";
|
|
4
|
+
import PanneauRoot_module_default from "./PanneauRoot.module.js";
|
|
5
|
+
import { I18nProvider } from "react-aria-components";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { getPanneauMessages } from "@panneau/intl";
|
|
8
|
+
import { createContext, use, useState } from "react";
|
|
9
|
+
import { IntlContext, IntlProvider } from "react-intl";
|
|
10
|
+
//#region src/root/PanneauRoot.tsx
|
|
11
|
+
/** `undefined` outside of a root, `null` while the root's container isn't mounted yet. */
|
|
12
|
+
var PortalContext = createContext(void 0);
|
|
13
|
+
/**
|
|
14
|
+
* The element overlays render into: the closest `PanneauRoot`'s, or `undefined` for the body
|
|
15
|
+
* without a root. It is `null` during the first render of a root: overlays wait for it, since
|
|
16
|
+
* React Aria hides everything outside of a modal from assistive technologies when it opens.
|
|
17
|
+
*/
|
|
18
|
+
function usePortalContainer() {
|
|
19
|
+
return use(PortalContext);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An `IntlProvider` with Panneau's messages in a locale, for a root without one above it. A locale
|
|
23
|
+
* Panneau doesn't translate gets English, so that react-intl doesn't report every message as
|
|
24
|
+
* missing.
|
|
25
|
+
*/
|
|
26
|
+
function PanneauIntlProvider({ locale = "en", children }) {
|
|
27
|
+
const messages = getPanneauMessages(locale);
|
|
28
|
+
const translated = Object.keys(messages).length > 0;
|
|
29
|
+
return /* @__PURE__ */ jsx(IntlProvider, {
|
|
30
|
+
locale: translated ? locale : "en",
|
|
31
|
+
defaultLocale: "en",
|
|
32
|
+
messages: translated ? messages : getPanneauMessages("en"),
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its
|
|
38
|
+
* element (no global CSS), applies a theme and a color scheme, and hosts overlays and toasts so
|
|
39
|
+
* that they get the tokens too. Panneau components must render inside one. A project can override
|
|
40
|
+
* any token with its own class on the root. Without an `IntlProvider` above it, it provides one
|
|
41
|
+
* with Panneau's messages in its `locale`.
|
|
42
|
+
*/
|
|
43
|
+
function PanneauRoot({ theme = null, colorScheme = "light", locale, className, children, ...props }) {
|
|
44
|
+
const intl = use(IntlContext);
|
|
45
|
+
const [container, setContainer] = useState(null);
|
|
46
|
+
const css = theme !== null ? getThemeCss(theme, "§") : "";
|
|
47
|
+
const scope = css !== "" ? hashString(css) : void 0;
|
|
48
|
+
const root = /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
...props,
|
|
50
|
+
className: cx(PanneauRoot_module_default.root, className),
|
|
51
|
+
"data-color-scheme": colorScheme,
|
|
52
|
+
"data-panneau-theme": scope,
|
|
53
|
+
children: [scope !== void 0 ? /* @__PURE__ */ jsx("style", {
|
|
54
|
+
href: `panneau-theme-${scope}`,
|
|
55
|
+
precedence: "panneau",
|
|
56
|
+
children: css.replaceAll("§", scope)
|
|
57
|
+
}) : null, /* @__PURE__ */ jsxs(I18nProvider, {
|
|
58
|
+
locale: locale ?? intl?.locale,
|
|
59
|
+
children: [/* @__PURE__ */ jsx(PortalContext, {
|
|
60
|
+
value: container,
|
|
61
|
+
children: /* @__PURE__ */ jsx(ToastProvider, {
|
|
62
|
+
regionClassName: PanneauRoot_module_default.root,
|
|
63
|
+
regionProps: {
|
|
64
|
+
"data-color-scheme": colorScheme,
|
|
65
|
+
"data-panneau-theme": scope
|
|
66
|
+
},
|
|
67
|
+
children
|
|
68
|
+
})
|
|
69
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
70
|
+
ref: setContainer,
|
|
71
|
+
className: PanneauRoot_module_default.portal
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
if (intl === null || intl === void 0) return /* @__PURE__ */ jsx(PanneauIntlProvider, {
|
|
76
|
+
locale,
|
|
77
|
+
children: root
|
|
78
|
+
});
|
|
79
|
+
return root;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { PanneauRoot, usePortalContainer };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=PanneauRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanneauRoot.js","names":["styles"],"sources":["../../src/root/PanneauRoot.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, createContext, use, useState } from 'react';\nimport { I18nProvider } from 'react-aria-components';\nimport { IntlContext, IntlProvider, type IntlShape } from 'react-intl';\n\nimport { getPanneauMessages } from '@panneau/intl';\n\nimport { type ColorScheme, type Theme, getThemeCss, hashString } from '../theme/theme';\nimport { ToastProvider } from '../toast/Toast';\nimport { cx } from '../utils/cx';\nimport styles from './PanneauRoot.module.css';\n\nexport interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {\n /** Tokens that override the default theme: `bootstrapTheme`, or a project's own. */\n theme?: Theme | null;\n /** Defaults to `light`. `auto` follows the system setting. */\n colorScheme?: ColorScheme;\n /**\n * Locale of dates and numbers in React Aria components. Defaults to the react-intl locale, or\n * to the browser's without an `IntlProvider`.\n *\n * Without an `IntlProvider` above it, the root provides one, with the messages of every Panneau\n * package in this locale (English without a locale, or for a locale Panneau doesn't translate).\n * An app with its own `IntlProvider` adds them with `withPanneauMessages()` from\n * `@panneau/intl`.\n */\n locale?: string;\n children?: ReactNode;\n}\n\n/** `undefined` outside of a root, `null` while the root's container isn't mounted yet. */\nconst PortalContext = createContext<Element | null | undefined>(undefined);\n\n/**\n * The element overlays render into: the closest `PanneauRoot`'s, or `undefined` for the body\n * without a root. It is `null` during the first render of a root: overlays wait for it, since\n * React Aria hides everything outside of a modal from assistive technologies when it opens.\n */\nexport function usePortalContainer(): Element | null | undefined {\n return use(PortalContext);\n}\n\n/**\n * An `IntlProvider` with Panneau's messages in a locale, for a root without one above it. A locale\n * Panneau doesn't translate gets English, so that react-intl doesn't report every message as\n * missing.\n */\nfunction PanneauIntlProvider({\n locale = 'en',\n children,\n}: {\n locale?: string;\n children: ReactNode;\n}) {\n const messages = getPanneauMessages(locale);\n const translated = Object.keys(messages).length > 0;\n return (\n <IntlProvider\n locale={translated ? locale : 'en'}\n defaultLocale=\"en\"\n messages={translated ? messages : getPanneauMessages('en')}\n >\n {children}\n </IntlProvider>\n );\n}\n\n/**\n * The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its\n * element (no global CSS), applies a theme and a color scheme, and hosts overlays and toasts so\n * that they get the tokens too. Panneau components must render inside one. A project can override\n * any token with its own class on the root. Without an `IntlProvider` above it, it provides one\n * with Panneau's messages in its `locale`.\n */\nexport function PanneauRoot({\n theme = null,\n colorScheme = 'light',\n locale,\n className,\n children,\n ...props\n}: PanneauRootProps) {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const css = theme !== null ? getThemeCss(theme, '§') : '';\n const scope = css !== '' ? hashString(css) : undefined;\n const root = (\n <div\n {...props}\n className={cx(styles.root, className)}\n data-color-scheme={colorScheme}\n data-panneau-theme={scope}\n >\n {scope !== undefined ? (\n <style href={`panneau-theme-${scope}`} precedence=\"panneau\">\n {css.replaceAll('§', scope)}\n </style>\n ) : null}\n <I18nProvider locale={locale ?? intl?.locale}>\n <PortalContext value={container}>\n <ToastProvider\n regionClassName={styles.root}\n regionProps={{\n 'data-color-scheme': colorScheme,\n 'data-panneau-theme': scope,\n }}\n >\n {children}\n </ToastProvider>\n </PortalContext>\n <div ref={setContainer} className={styles.portal} />\n </I18nProvider>\n </div>\n );\n if (intl === null || intl === undefined) {\n return <PanneauIntlProvider locale={locale}>{root}</PanneauIntlProvider>;\n }\n return root;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IAAM,gBAAgB,cAA0C,KAAA,CAAS;;;;;;AAOzE,SAAgB,qBAAiD;CAC7D,OAAO,IAAI,aAAa;AAC5B;;;;;;AAOA,SAAS,oBAAoB,EACzB,SAAS,MACT,YAID;CACC,MAAM,WAAW,mBAAmB,MAAM;CAC1C,MAAM,aAAa,OAAO,KAAK,QAAQ,CAAC,CAAC,SAAS;CAClD,OACI,oBAAC,cAAD;EACI,QAAQ,aAAa,SAAS;EAC9B,eAAc;EACd,UAAU,aAAa,WAAW,mBAAmB,IAAI;EAExD;CACS,CAAA;AAEtB;;;;;;;;AASA,SAAgB,YAAY,EACxB,QAAQ,MACR,cAAc,SACd,QACA,WACA,UACA,GAAG,SACc;CACjB,MAAM,OAAO,IAAI,WAAW;CAC5B,MAAM,CAAC,WAAW,gBAAgB,SAAgC,IAAI;CACtE,MAAM,MAAM,UAAU,OAAO,YAAY,OAAO,GAAG,IAAI;CACvD,MAAM,QAAQ,QAAQ,KAAK,WAAW,GAAG,IAAI,KAAA;CAC7C,MAAM,OACF,qBAAC,OAAD;EACI,GAAI;EACJ,WAAW,GAAGA,2BAAO,MAAM,SAAS;EACpC,qBAAmB;EACnB,sBAAoB;EAJxB,UAAA,CAMK,UAAU,KAAA,IACP,oBAAC,SAAD;GAAO,MAAM,iBAAiB;GAAS,YAAW;GAC7C,UAAA,IAAI,WAAW,KAAK,KAAK;EACvB,CAAA,IACP,MACJ,qBAAC,cAAD;GAAc,QAAQ,UAAU,MAAM;GAAtC,UAAA,CACI,oBAAC,eAAD;IAAe,OAAO;IAClB,UAAA,oBAAC,eAAD;KACI,iBAAiBA,2BAAO;KACxB,aAAa;MACT,qBAAqB;MACrB,sBAAsB;KAC1B;KAEC;IACU,CAAA;GACJ,CAAA,GACf,oBAAC,OAAD;IAAK,KAAK;IAAc,WAAWA,2BAAO;GAAO,CAAA,CACvC;EACb,CAAA,CAAA;;CAET,IAAI,SAAS,QAAQ,SAAS,KAAA,GAC1B,OAAO,oBAAC,qBAAD;EAA6B;EAAS,UAAA;CAA0B,CAAA;CAE3E,OAAO;AACX"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./PanneauRoot.css";
|
|
2
|
+
//#region src/root/PanneauRoot.module.css
|
|
3
|
+
var root = "panneau-root--wA35w";
|
|
4
|
+
var portal = "panneau-portal-keLcJN";
|
|
5
|
+
var PanneauRoot_module_default = {
|
|
6
|
+
root,
|
|
7
|
+
portal
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { PanneauRoot_module_default as default, portal, root };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=PanneauRoot.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanneauRoot.module.js","names":[],"sources":["../../src/root/PanneauRoot.module.css"],"sourcesContent":["/*\n * Design tokens of the default theme, and the base stylesheet of Panneau. Everything is scoped to\n * the root element: nothing here applies outside of it (decision 0005).\n *\n * Defaults are wrapped in :where() so that they have no specificity: a theme, or a project's own\n * class on the root, overrides any token without fighting the cascade.\n */\n\n:where(.root) {\n /* Surfaces */\n --panneau-color-bg: #ffffff;\n --panneau-color-surface: #ffffff;\n --panneau-color-surface-sunken: #f4f4f5;\n --panneau-color-surface-raised: #ffffff;\n --panneau-color-hover: rgb(24 24 27 / 0.06);\n --panneau-color-pressed: rgb(24 24 27 / 0.1);\n --panneau-color-backdrop: rgb(9 9 11 / 0.45);\n\n /* Text */\n --panneau-color-text: #18181b;\n --panneau-color-text-muted: #52525b;\n --panneau-color-link: #1d4ed8;\n\n /* Borders: separators, and the outline of controls (3:1 against the surface) */\n --panneau-color-border: #e4e4e7;\n --panneau-color-border-control: #8b8b94;\n\n /* Accent: primary buttons, checked controls, selection */\n --panneau-color-accent: #18181b;\n --panneau-color-accent-hover: #3f3f46;\n --panneau-color-accent-text: #ffffff;\n --panneau-color-accent-subtle: #f4f4f5;\n --panneau-color-focus: #2563eb;\n\n /* Tones: text on surfaces, subtle backgrounds, borders */\n --panneau-color-danger: #b91c1c;\n --panneau-color-danger-subtle: #fef2f2;\n --panneau-color-danger-border: #fca5a5;\n --panneau-color-danger-solid: #b91c1c;\n --panneau-color-danger-solid-hover: #991b1b;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #15803d;\n --panneau-color-success-subtle: #f0fdf4;\n --panneau-color-success-border: #86efac;\n --panneau-color-warning: #a16207;\n --panneau-color-warning-subtle: #fefce8;\n --panneau-color-warning-border: #fcd34d;\n --panneau-color-info: #1d4ed8;\n --panneau-color-info-subtle: #eff6ff;\n --panneau-color-info-border: #93c5fd;\n\n /* Typography */\n --panneau-font-family:\n system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n --panneau-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n --panneau-font-size-xs: 0.75rem;\n --panneau-font-size-sm: 0.8125rem;\n --panneau-font-size-md: 0.875rem;\n --panneau-font-size-lg: 1rem;\n --panneau-font-size-xl: 1.25rem;\n --panneau-font-size-control: 0.875rem;\n --panneau-line-height: 1.5;\n --panneau-line-height-tight: 1.25;\n --panneau-font-weight-normal: 400;\n --panneau-font-weight-medium: 500;\n --panneau-font-weight-bold: 600;\n\n /* Spacing, on a 4px scale */\n --panneau-space-1: 0.25rem;\n --panneau-space-2: 0.5rem;\n --panneau-space-3: 0.75rem;\n --panneau-space-4: 1rem;\n --panneau-space-5: 1.25rem;\n --panneau-space-6: 1.5rem;\n --panneau-space-8: 2rem;\n --panneau-space-10: 2.5rem;\n\n /* Shapes */\n --panneau-radius-sm: 0.25rem;\n --panneau-radius-md: 0.375rem;\n --panneau-radius-lg: 0.5rem;\n --panneau-radius-full: 9999px;\n --panneau-border-width: 1px;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);\n\n /* Controls */\n --panneau-control-height: 2.25rem;\n --panneau-control-height-sm: 1.875rem;\n --panneau-focus-width: 2px;\n\n /* Motion and layers */\n --panneau-duration: 150ms;\n --panneau-z-overlay: 1000;\n --panneau-z-toast: 1100;\n\n color-scheme: light;\n}\n\n:where(.root[data-color-scheme='dark']) {\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :where(.root[data-color-scheme='auto']) {\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n }\n}\n\n/* Touch screens: larger targets, and 16px text in inputs so that iOS doesn't zoom on focus. */\n@media (pointer: coarse) {\n :where(.root) {\n --panneau-control-height: 2.75rem;\n --panneau-control-height-sm: 2.25rem;\n --panneau-font-size-control: 1rem;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :where(.root) {\n --panneau-duration: 0ms;\n }\n}\n\n/* Base stylesheet, scoped to the root, without specificity: components and projects override it. */\n\n.root {\n /* The class is mostly a hook for the rules below, which use :where(). */\n display: block;\n}\n\n:where(.root) {\n font-family: var(--panneau-font-family);\n font-size: var(--panneau-font-size-md);\n line-height: var(--panneau-line-height);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-bg);\n -webkit-font-smoothing: antialiased;\n -webkit-text-size-adjust: 100%;\n text-size-adjust: 100%;\n}\n\n:where(.root) :where(*, *::before, *::after) {\n box-sizing: border-box;\n}\n\n:where(.root) :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, fieldset, legend) {\n margin: 0;\n padding: 0;\n}\n\n:where(.root) :where(fieldset) {\n border: 0;\n min-width: 0;\n}\n\n:where(.root) :where(button, input, select, textarea) {\n font: inherit;\n color: inherit;\n}\n\n:where(.root) :where(a) {\n color: var(--panneau-color-link);\n}\n\n:where(.root) :where(img, svg, video) {\n max-width: 100%;\n}\n\n:where(.root) :where(:focus-visible) {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n/* Overlays (dialogs, popovers, menus, tooltips) render here, so that they get the tokens. */\n.portal {\n display: contents;\n}\n"],"mappings":""}
|