@panneau/ui 5.0.0-alpha.6 → 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 +24 -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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- 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.js +170 -44
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/tokens.js.map +1 -1
- package/dist/number-input/NumberInput.js +232 -60
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/tokens.js.map +1 -1
- package/dist/pill-trigger/PillTrigger.js +76 -20
- package/dist/pill-trigger/PillTrigger.js.map +1 -1
- package/dist/pill-trigger/tokens.js.map +1 -1
- 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.js +211 -61
- package/dist/radio-group/RadioGroup.js.map +1 -1
- 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/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.js +222 -44
- package/dist/slider/Slider.js.map +1 -1
- 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.js +277 -121
- package/dist/tags-input/TagsInput.js.map +1 -1
- 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 +1 -0
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +2 -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
package/README.md
CHANGED
|
@@ -290,7 +290,7 @@ The theme model is described in [decision 0024](../../docs/decisions/0024-theme-
|
|
|
290
290
|
|
|
291
291
|
## Primitives
|
|
292
292
|
|
|
293
|
-
`Heading`, `Text`, `Prose`, `Stack`, `Inline`, `Grid`, `Container`, `Divider`, `Button`, `IconButton`, `TextInput`, `TextArea`, `NumberInput`, `Slider`, `TagsInput`, `Select` (single or multiple), `ComboBox`, `Checkbox`, `Switch`, `RadioGroup`, `SegmentedControl`, `DatePicker`, `TimeInput`, `Fieldset`, `Dialog`, `Popover`, `Menu`, `PillTrigger`, `Tabs`, `Tooltip`, toasts (`useToast()`), `Alert`, `Badge`, `Spinner`, `Card`, `Disclosure` and `Icon`.
|
|
293
|
+
`Heading`, `Text`, `Prose`, `Stack`, `Inline`, `Grid`, `Container`, `Divider`, `Button`, `IconButton`, `TextInput`, `TextArea`, `NumberInput`, `Slider`, `TagsInput`, `Select` (single or multiple), `ComboBox`, `Checkbox`, `Switch`, `RadioGroup`, `SegmentedControl`, `DatePicker`, `TimeInput`, `Fieldset`, `Dialog`, `Popover`, `Menu`, `PillTrigger`, `Tabs`, `Tooltip`, toasts (`useToast()`), `Alert`, `Badge`, `Spinner`, `Skeleton`, `LoadingRegion`, `Card`, `Disclosure` and `Icon`.
|
|
294
294
|
|
|
295
295
|
- Every component accepts `className`, and `xxxClassName` props for its inner elements (`labelClassName`, `inputClassName`…).
|
|
296
296
|
- Labelled controls take `label`, `description` and `errors` (a list of messages: any message makes the control invalid and describes it).
|
|
@@ -349,6 +349,29 @@ Picking one item among a few rich ones, such as an account (an avatar, a name, a
|
|
|
349
349
|
/>
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
+
### Loading
|
|
353
|
+
|
|
354
|
+
Content that loads shows a skeleton of its shape, never a spinner in its place ([decision 0034](../../docs/decisions/0034-skeletons-while-content-loads.md)). Spinners are for operations in progress (`Button` `isPending`) and lookups inside a control (`ComboBox` `isLoading`).
|
|
355
|
+
|
|
356
|
+
- `Skeleton` is a block of the shape to come: a line of text (`lines` for several, the last one shorter), a `rect` with a `width`, a `height` or an `aspectRatio`, or a `circle`. It is `aria-hidden`, pulses unless the user prefers reduced motion, and reads the `skeleton` component tokens (`color`, `radius`, `duration`).
|
|
357
|
+
- `LoadingRegion` goes around the skeleton, in place of the content: it has `aria-busy="true"`, and a status message says once that the content loads (`label`, "Loading…" by default).
|
|
358
|
+
|
|
359
|
+
```tsx
|
|
360
|
+
function ArticleCard({ article }: { article: Article | undefined }) {
|
|
361
|
+
if (article === undefined) {
|
|
362
|
+
return (
|
|
363
|
+
<LoadingRegion label="Loading the article…">
|
|
364
|
+
<Skeleton shape="rect" aspectRatio="16 / 9" />
|
|
365
|
+
<Skeleton lines={3} />
|
|
366
|
+
</LoadingRegion>
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
return <ArticleView article={article} />;
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
A skeleton never replaces content already shown: while it is fetched again, it stays, dimmed, with `aria-busy`, as in lists.
|
|
374
|
+
|
|
352
375
|
## Icons
|
|
353
376
|
|
|
354
377
|
Components take icons as components: any Lucide icon (`icon={Pencil}`), or a component with the same props.
|
package/dist/alert/Alert.js
CHANGED
|
@@ -5,6 +5,7 @@ import { usePanneauIntl } from "../intl/usePanneauIntl.js";
|
|
|
5
5
|
import { toneClass } from "../theme/toneClass.js";
|
|
6
6
|
import { IconButton } from "../icon-button/IconButton.js";
|
|
7
7
|
import Alert_module_default from "./Alert.module.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from "lucide-react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
//#region src/alert/Alert.tsx
|
|
@@ -16,48 +17,115 @@ var TONE_ICONS = {
|
|
|
16
17
|
info: Info
|
|
17
18
|
};
|
|
18
19
|
/** A message inside the page: an error summary, a warning, a confirmation. */
|
|
19
|
-
function Alert(
|
|
20
|
+
function Alert(t0) {
|
|
21
|
+
const $ = c(31);
|
|
22
|
+
const { tone: t1, appearance: t2, variant, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName } = t0;
|
|
23
|
+
const tone = t1 === void 0 ? "neutral" : t1;
|
|
24
|
+
const appearance = t2 === void 0 ? "subtle" : t2;
|
|
20
25
|
const intl = usePanneauIntl();
|
|
21
26
|
const shown = icon === void 0 ? TONE_ICONS[tone] ?? Info : icon;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
}
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[0] !== appearance || $[1] !== className || $[2] !== tone || $[3] !== variant) {
|
|
29
|
+
t3 = cx("panneau-alert", Alert_module_default.alert, toneClass(tone), Alert_module_default[appearance], variant !== void 0 && `panneau-alert-variant-${variant}`, className);
|
|
30
|
+
$[0] = appearance;
|
|
31
|
+
$[1] = className;
|
|
32
|
+
$[2] = tone;
|
|
33
|
+
$[3] = variant;
|
|
34
|
+
$[4] = t3;
|
|
35
|
+
} else t3 = $[4];
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[5] !== shown) {
|
|
38
|
+
t4 = shown !== null ? /* @__PURE__ */ jsx(Icon, {
|
|
39
|
+
icon: shown,
|
|
40
|
+
size: "lg",
|
|
41
|
+
className: Alert_module_default.icon
|
|
42
|
+
}) : null;
|
|
43
|
+
$[5] = shown;
|
|
44
|
+
$[6] = t4;
|
|
45
|
+
} else t4 = $[6];
|
|
46
|
+
let t5;
|
|
47
|
+
if ($[7] !== title || $[8] !== titleClassName) {
|
|
48
|
+
t5 = title !== void 0 && title !== null ? /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: cx(Alert_module_default.title, titleClassName),
|
|
50
|
+
children: title
|
|
51
|
+
}) : null;
|
|
52
|
+
$[7] = title;
|
|
53
|
+
$[8] = titleClassName;
|
|
54
|
+
$[9] = t5;
|
|
55
|
+
} else t5 = $[9];
|
|
56
|
+
let t6;
|
|
57
|
+
if ($[10] !== bodyClassName || $[11] !== children) {
|
|
58
|
+
t6 = children !== void 0 && children !== null ? /* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: cx(Alert_module_default.body, bodyClassName),
|
|
60
|
+
children
|
|
61
|
+
}) : null;
|
|
62
|
+
$[10] = bodyClassName;
|
|
63
|
+
$[11] = children;
|
|
64
|
+
$[12] = t6;
|
|
65
|
+
} else t6 = $[12];
|
|
66
|
+
let t7;
|
|
67
|
+
if ($[13] !== actions) {
|
|
68
|
+
t7 = actions !== void 0 && actions !== null ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: Alert_module_default.actions,
|
|
70
|
+
children: actions
|
|
71
|
+
}) : null;
|
|
72
|
+
$[13] = actions;
|
|
73
|
+
$[14] = t7;
|
|
74
|
+
} else t7 = $[14];
|
|
75
|
+
let t8;
|
|
76
|
+
if ($[15] !== t5 || $[16] !== t6 || $[17] !== t7) {
|
|
77
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: Alert_module_default.content,
|
|
79
|
+
children: [
|
|
80
|
+
t5,
|
|
81
|
+
t6,
|
|
82
|
+
t7
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
$[15] = t5;
|
|
86
|
+
$[16] = t6;
|
|
87
|
+
$[17] = t7;
|
|
88
|
+
$[18] = t8;
|
|
89
|
+
} else t8 = $[18];
|
|
90
|
+
let t9;
|
|
91
|
+
if ($[19] !== intl || $[20] !== onDismiss) {
|
|
92
|
+
t9 = onDismiss !== void 0 ? /* @__PURE__ */ jsx(IconButton, {
|
|
93
|
+
icon: X,
|
|
94
|
+
size: "sm",
|
|
95
|
+
label: intl.formatMessage(messages.close),
|
|
96
|
+
showTooltip: false,
|
|
97
|
+
onPress: onDismiss,
|
|
98
|
+
className: Alert_module_default.dismiss
|
|
99
|
+
}) : null;
|
|
100
|
+
$[19] = intl;
|
|
101
|
+
$[20] = onDismiss;
|
|
102
|
+
$[21] = t9;
|
|
103
|
+
} else t9 = $[21];
|
|
104
|
+
let t10;
|
|
105
|
+
if ($[22] !== id || $[23] !== ref || $[24] !== role || $[25] !== t3 || $[26] !== t4 || $[27] !== t8 || $[28] !== t9 || $[29] !== tabIndex) {
|
|
106
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
ref,
|
|
108
|
+
id,
|
|
109
|
+
role,
|
|
110
|
+
tabIndex,
|
|
111
|
+
className: t3,
|
|
112
|
+
children: [
|
|
113
|
+
t4,
|
|
114
|
+
t8,
|
|
115
|
+
t9
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
$[22] = id;
|
|
119
|
+
$[23] = ref;
|
|
120
|
+
$[24] = role;
|
|
121
|
+
$[25] = t3;
|
|
122
|
+
$[26] = t4;
|
|
123
|
+
$[27] = t8;
|
|
124
|
+
$[28] = t9;
|
|
125
|
+
$[29] = tabIndex;
|
|
126
|
+
$[30] = t10;
|
|
127
|
+
} else t10 = $[30];
|
|
128
|
+
return t10;
|
|
61
129
|
}
|
|
62
130
|
//#endregion
|
|
63
131
|
export { Alert };
|
package/dist/alert/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","names":["styles"],"sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react';\nimport type { ReactNode, Ref } from 'react';\n\nimport { IconButton } from '../icon-button/IconButton';\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Alert.module.css';\n\n/** @deprecated Use `Tone`. */\nexport type AlertTone = Tone;\n\n/** How an alert uses its tone. */\nexport type AlertAppearance = 'subtle' | 'outline' | 'solid';\n\n/**\n * Named variants of `Alert`, registered by a theme (`components.alert.variants`). Declare them\n * here so that `variant=\"banner\"` type-checks.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface AlertVariants {}\n\nconst TONE_ICONS: Partial<Record<Tone, IconComponent>> = {\n neutral: Info,\n success: CircleCheck,\n danger: CircleAlert,\n warning: TriangleAlert,\n info: Info,\n};\n\nexport interface AlertProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `subtle`. */\n appearance?: AlertAppearance;\n /** A named variant of the theme. */\n variant?: keyof AlertVariants & string;\n title?: ReactNode;\n children?: ReactNode;\n /** Replaces the icon of the tone (an info icon for tones added by a theme). `null` hides it. */\n icon?: IconComponent | null;\n /** Buttons under the message. */\n actions?: ReactNode;\n /** Shows a close button. */\n onDismiss?: () => void;\n /**\n * `alert` announces the message as soon as it appears, for errors that need attention.\n * `status` announces it politely. Without a role, it is only read in place.\n */\n role?: 'alert' | 'status';\n id?: string;\n /** Makes the alert focusable, to move focus to it (an error summary). */\n tabIndex?: number;\n ref?: Ref<HTMLDivElement>;\n className?: string;\n titleClassName?: string;\n bodyClassName?: string;\n}\n\n/** A message inside the page: an error summary, a warning, a confirmation. */\nexport function Alert({\n tone = 'neutral',\n appearance = 'subtle',\n variant,\n title,\n children,\n icon,\n actions,\n onDismiss,\n role,\n id,\n tabIndex,\n ref,\n className,\n titleClassName,\n bodyClassName,\n}: AlertProps) {\n const intl = usePanneauIntl();\n const shown = icon === undefined ? (TONE_ICONS[tone] ?? Info) : icon;\n return (\n <div\n ref={ref}\n id={id}\n role={role}\n tabIndex={tabIndex}\n className={cx(\n 'panneau-alert',\n styles.alert,\n toneClass(tone),\n styles[appearance],\n variant !== undefined && `panneau-alert-variant-${variant}`,\n className,\n )}\n >\n {shown !== null ? <Icon icon={shown} size=\"lg\" className={styles.icon} /> : null}\n <div className={styles.content}>\n {title !== undefined && title !== null ? (\n <div className={cx(styles.title, titleClassName)}>{title}</div>\n ) : null}\n {children !== undefined && children !== null ? (\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n ) : null}\n {actions !== undefined && actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </div>\n {onDismiss !== undefined ? (\n <IconButton\n icon={X}\n size=\"sm\"\n label={intl.formatMessage(messages.close)}\n showTooltip={false}\n onPress={onDismiss}\n className={styles.dismiss}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Alert.js","names":["CircleAlert","CircleCheck","Info","TriangleAlert","X","ReactNode","Ref","IconButton","Icon","IconComponent","messages","usePanneauIntl","toneClass","Tone","cx","styles","AlertTone","AlertAppearance","AlertVariants","TONE_ICONS","Partial","Record","neutral","success","danger","warning","info","AlertProps","tone","appearance","variant","title","children","icon","actions","onDismiss","role","id","tabIndex","ref","HTMLDivElement","className","titleClassName","bodyClassName","Alert","t0","$","_c","t1","t2","undefined","intl","shown","t3","alert","t4","t5","t6","body","t7","t8","content","t9","formatMessage","close","dismiss","t10","_c","styles"],"sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react';\nimport type { ReactNode, Ref } from 'react';\n\nimport { IconButton } from '../icon-button/IconButton';\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Alert.module.css';\n\n/** @deprecated Use `Tone`. */\nexport type AlertTone = Tone;\n\n/** How an alert uses its tone. */\nexport type AlertAppearance = 'subtle' | 'outline' | 'solid';\n\n/**\n * Named variants of `Alert`, registered by a theme (`components.alert.variants`). Declare them\n * here so that `variant=\"banner\"` type-checks.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface AlertVariants {}\n\nconst TONE_ICONS: Partial<Record<Tone, IconComponent>> = {\n neutral: Info,\n success: CircleCheck,\n danger: CircleAlert,\n warning: TriangleAlert,\n info: Info,\n};\n\nexport interface AlertProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `subtle`. */\n appearance?: AlertAppearance;\n /** A named variant of the theme. */\n variant?: keyof AlertVariants & string;\n title?: ReactNode;\n children?: ReactNode;\n /** Replaces the icon of the tone (an info icon for tones added by a theme). `null` hides it. */\n icon?: IconComponent | null;\n /** Buttons under the message. */\n actions?: ReactNode;\n /** Shows a close button. */\n onDismiss?: () => void;\n /**\n * `alert` announces the message as soon as it appears, for errors that need attention.\n * `status` announces it politely. Without a role, it is only read in place.\n */\n role?: 'alert' | 'status';\n id?: string;\n /** Makes the alert focusable, to move focus to it (an error summary). */\n tabIndex?: number;\n ref?: Ref<HTMLDivElement>;\n className?: string;\n titleClassName?: string;\n bodyClassName?: string;\n}\n\n/** A message inside the page: an error summary, a warning, a confirmation. */\nexport function Alert({\n tone = 'neutral',\n appearance = 'subtle',\n variant,\n title,\n children,\n icon,\n actions,\n onDismiss,\n role,\n id,\n tabIndex,\n ref,\n className,\n titleClassName,\n bodyClassName,\n}: AlertProps) {\n const intl = usePanneauIntl();\n const shown = icon === undefined ? (TONE_ICONS[tone] ?? Info) : icon;\n return (\n <div\n ref={ref}\n id={id}\n role={role}\n tabIndex={tabIndex}\n className={cx(\n 'panneau-alert',\n styles.alert,\n toneClass(tone),\n styles[appearance],\n variant !== undefined && `panneau-alert-variant-${variant}`,\n className,\n )}\n >\n {shown !== null ? <Icon icon={shown} size=\"lg\" className={styles.icon} /> : null}\n <div className={styles.content}>\n {title !== undefined && title !== null ? (\n <div className={cx(styles.title, titleClassName)}>{title}</div>\n ) : null}\n {children !== undefined && children !== null ? (\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n ) : null}\n {actions !== undefined && actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </div>\n {onDismiss !== undefined ? (\n <IconButton\n icon={X}\n size=\"sm\"\n label={intl.formatMessage(messages.close)}\n showTooltip={false}\n onPress={onDismiss}\n className={styles.dismiss}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAMmB,aAAmD;CACrDG,SAASpB;CACTqB,SAAStB;CACTuB,QAAQxB;CACRyB,SAAStB;CACTuB,MAAMxB;AACV;;AAgCA,SAAO0C,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAe,MAAA,EAAAnB,MAAAoB,IAAAnB,YAAAoB,IAAAnB,SAAAC,OAAAC,UAAAC,MAAAC,SAAAC,WAAAC,MAAAC,IAAAC,UAAAC,KAAAE,WAAAC,gBAAAC,kBAAAE;CAClB,MAAAjB,OAAAoB,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAAnB,aAAAoB,OAAAC,KAAAA,IAAA,WAAAD;CAeA,MAAAE,OAAaxC,eAAe;CAC5B,MAAAyC,QAAcnB,SAASiB,KAAAA,IAAa/B,WAAWS,SAAX1B,OAAtB+B;CAAuD,IAAAoB;CAAA,IAAAP,EAAA,OAAAjB,cAAAiB,EAAA,OAAAL,aAAAK,EAAA,OAAAlB,QAAAkB,EAAA,OAAAhB,SAAA;EAOlDuB,KAAAvC,GACP,iBACAC,qBAAMuC,OACN1C,UAAUgB,IAAI,GACdb,qBAAOc,aACPC,YAAYoB,KAAAA,KAAZ,yBAAkDpB,WAClDW,SACJ;EAACK,EAAA,KAAAjB;EAAAiB,EAAA,KAAAL;EAAAK,EAAA,KAAAlB;EAAAkB,EAAA,KAAAhB;EAAAgB,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAM,OAAA;EAEAG,KAAAH,UAAU,OAAO,oBAAC,MAAD;GAAYA,MAAAA;GAAY,MAAA;GAAgB,WAAArC,qBAAMkB;EAAK,CAAA,IAApE;EAA+Ea,EAAA,KAAAM;EAAAN,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,OAAAf,SAAAe,EAAA,OAAAJ,gBAAA;EAE3Ec,KAAAzB,UAAUmB,KAAAA,KAAanB,UAAU,OAC9B,oBAAA,OAAA;GAAgB,WAAAjB,GAAGC,qBAAMgB,OAAQW,cAAc;GAAIX,UAAAA;EAAY,CAAA,IADlE;EAEOe,EAAA,KAAAf;EAAAe,EAAA,KAAAJ;EAAAI,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAH,iBAAAG,EAAA,QAAAd,UAAA;EACPyB,KAAAzB,aAAakB,KAAAA,KAAalB,aAAa,OACpC,oBAAA,OAAA;GAAgB,WAAAlB,GAAGC,qBAAM2C,MAAOf,aAAa;GAAIX;EAAe,CAAA,IADnE;EAEOc,EAAA,MAAAH;EAAAG,EAAA,MAAAd;EAAAc,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,QAAAZ,SAAA;EACPyB,KAAAzB,YAAYgB,KAAAA,KAAahB,YAAY,OAClC,oBAAA,OAAA;GAAgB,WAAAnB,qBAAMmB;GAAWA,UAAAA;EAAc,CAAA,IADlD;EAEOY,EAAA,MAAAZ;EAAAY,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,QAAAU,MAAAV,EAAA,QAAAW,MAAAX,EAAA,QAAAa,IAAA;EATZC,KAAA,qBAAA,OAAA;GAAgB,WAAA7C,qBAAM8C;GAAtB,UAAA;IACKL;IAGAC;IAGAE;GAGC;;EAAAb,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAa;EAAAb,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAK,QAAAL,EAAA,QAAAX,WAAA;EACL2B,KAAA3B,cAAce,KAAAA,IACX,oBAAC,YAAD;GACU9C,MAAAA;GACD,MAAA;GACE,OAAA+C,KAAIY,cAAerD,SAAQsD,KAAM;GAC3B,aAAA;GACJ7B,SAAAA;GACE,WAAApB,qBAAMkD;EAAQ,CAAA,IAPhC;EASOnB,EAAA,MAAAK;EAAAL,EAAA,MAAAX;EAAAW,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,IAAAoB;CAAA,IAAApB,EAAA,QAAAT,MAAAS,EAAA,QAAAP,OAAAO,EAAA,QAAAV,QAAAU,EAAA,QAAAO,MAAAP,EAAA,QAAAS,MAAAT,EAAA,QAAAc,MAAAd,EAAA,QAAAgB,MAAAhB,EAAA,QAAAR,UAAA;EAnCZ4B,MAAA,qBAAA,OAAA;GACS3B;GACDF;GACED;GACIE;GACC,WAAAe;GALf,UAAA;IAcKE;IACDK;IAWCE;GAUC;;EAAAhB,EAAA,MAAAT;EAAAS,EAAA,MAAAP;EAAAO,EAAA,MAAAV;EAAAU,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;EAAAhB,EAAA,MAAAR;EAAAQ,EAAA,MAAAoB;CAAA,OAAAA,MAAApB,EAAA;CAAA,OApCNoB;AAoCM"}
|
package/dist/alert/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/alert/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Alert. */\nexport const alertTokens = defineComponentTokens('alert', {\n /** Space between the icon, the content and the dismiss button. */\n gap: 'var(--panneau-space-3)',\n /** Vertical padding. */\n 'padding-y': 'var(--panneau-space-3)',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-4)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Font weight of the title. */\n 'title-font-weight': 'var(--panneau-font-weight-bold)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","alertTokens","gap","radius"],"sources":["../../src/alert/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Alert. */\nexport const alertTokens = defineComponentTokens('alert', {\n /** Space between the icon, the content and the dismiss button. */\n gap: 'var(--panneau-space-3)',\n /** Vertical padding. */\n 'padding-y': 'var(--panneau-space-3)',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-4)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Font weight of the title. */\n 'title-font-weight': 'var(--panneau-font-weight-bold)',\n});\n"],"mappings":";;;AAGA,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtDE,KAAK;;CAEL,aAAa;;CAEb,aAAa;;CAEb,gBAAgB;;CAEhBC,QAAQ;;CAER,qBAAqB;AACzB,CAAC"}
|
package/dist/badge/Badge.js
CHANGED
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import { toneClass } from "../theme/toneClass.js";
|
|
3
3
|
import Badge_module_default from "./Badge.module.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/badge/Badge.tsx
|
|
6
7
|
/** A short status or a count. */
|
|
7
|
-
function Badge(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
function Badge(t0) {
|
|
9
|
+
const $ = c(11);
|
|
10
|
+
const { tone: t1, appearance: t2, variant, children, label, className } = t0;
|
|
11
|
+
const tone = t1 === void 0 ? "neutral" : t1;
|
|
12
|
+
const appearance = t2 === void 0 ? "subtle" : t2;
|
|
13
|
+
let t3;
|
|
14
|
+
if ($[0] !== appearance || $[1] !== className || $[2] !== tone || $[3] !== variant) {
|
|
15
|
+
t3 = cx("panneau-badge", Badge_module_default.badge, toneClass(tone), Badge_module_default[appearance], variant !== void 0 && `panneau-badge-variant-${variant}`, className);
|
|
16
|
+
$[0] = appearance;
|
|
17
|
+
$[1] = className;
|
|
18
|
+
$[2] = tone;
|
|
19
|
+
$[3] = variant;
|
|
20
|
+
$[4] = t3;
|
|
21
|
+
} else t3 = $[4];
|
|
22
|
+
let t4;
|
|
23
|
+
if ($[5] !== children || $[6] !== label) {
|
|
24
|
+
t4 = label !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
11
25
|
"aria-hidden": "true",
|
|
12
26
|
children
|
|
13
27
|
}), /* @__PURE__ */ jsx("span", {
|
|
14
28
|
className: Badge_module_default.visuallyHidden,
|
|
15
29
|
children: label
|
|
16
|
-
})] }) : children
|
|
17
|
-
|
|
30
|
+
})] }) : children;
|
|
31
|
+
$[5] = children;
|
|
32
|
+
$[6] = label;
|
|
33
|
+
$[7] = t4;
|
|
34
|
+
} else t4 = $[7];
|
|
35
|
+
let t5;
|
|
36
|
+
if ($[8] !== t3 || $[9] !== t4) {
|
|
37
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: t3,
|
|
39
|
+
children: t4
|
|
40
|
+
});
|
|
41
|
+
$[8] = t3;
|
|
42
|
+
$[9] = t4;
|
|
43
|
+
$[10] = t5;
|
|
44
|
+
} else t5 = $[10];
|
|
45
|
+
return t5;
|
|
18
46
|
}
|
|
19
47
|
//#endregion
|
|
20
48
|
export { Badge };
|
package/dist/badge/Badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","names":["styles","_Fragment"],"sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Badge.module.css';\n\n/** @deprecated Use `Tone`. */\nexport type BadgeTone = Tone;\n\n/** How a badge uses its tone. */\nexport type BadgeAppearance = 'subtle' | 'solid' | 'outline';\n\n/**\n * Named variants of `Badge`, registered by a theme (`components.badge.variants`). Declare them\n * here so that `variant=\"tag\"` type-checks.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface BadgeVariants {}\n\nexport interface BadgeProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `subtle`. */\n appearance?: BadgeAppearance;\n /** A named variant of the theme. */\n variant?: keyof BadgeVariants & string;\n children?: ReactNode;\n /**\n * Accessible text, when the visible content isn't enough on its own (a count of errors: \"2\n * errors\"). The visible content is then hidden from assistive technologies.\n */\n label?: string;\n className?: string;\n}\n\n/** A short status or a count. */\nexport function Badge({\n tone = 'neutral',\n appearance = 'subtle',\n variant,\n children,\n label,\n className,\n}: BadgeProps) {\n return (\n <span\n className={cx(\n 'panneau-badge',\n styles.badge,\n toneClass(tone),\n styles[appearance],\n variant !== undefined && `panneau-badge-variant-${variant}`,\n className,\n )}\n >\n {label !== undefined ? (\n <>\n <span aria-hidden=\"true\">{children}</span>\n <span className={styles.visuallyHidden}>{label}</span>\n </>\n ) : (\n children\n )}\n </span>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.js","names":["ReactNode","toneClass","Tone","cx","styles","BadgeTone","BadgeAppearance","BadgeVariants","BadgeProps","tone","appearance","variant","children","label","className","Badge","t0","$","_c","t1","t2","undefined","t3","badge","t4","visuallyHidden","t5","_c","styles","_Fragment"],"sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Badge.module.css';\n\n/** @deprecated Use `Tone`. */\nexport type BadgeTone = Tone;\n\n/** How a badge uses its tone. */\nexport type BadgeAppearance = 'subtle' | 'solid' | 'outline';\n\n/**\n * Named variants of `Badge`, registered by a theme (`components.badge.variants`). Declare them\n * here so that `variant=\"tag\"` type-checks.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface BadgeVariants {}\n\nexport interface BadgeProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `subtle`. */\n appearance?: BadgeAppearance;\n /** A named variant of the theme. */\n variant?: keyof BadgeVariants & string;\n children?: ReactNode;\n /**\n * Accessible text, when the visible content isn't enough on its own (a count of errors: \"2\n * errors\"). The visible content is then hidden from assistive technologies.\n */\n label?: string;\n className?: string;\n}\n\n/** A short status or a count. */\nexport function Badge({\n tone = 'neutral',\n appearance = 'subtle',\n variant,\n children,\n label,\n className,\n}: BadgeProps) {\n return (\n <span\n className={cx(\n 'panneau-badge',\n styles.badge,\n toneClass(tone),\n styles[appearance],\n variant !== undefined && `panneau-badge-variant-${variant}`,\n className,\n )}\n >\n {label !== undefined ? (\n <>\n <span aria-hidden=\"true\">{children}</span>\n <span className={styles.visuallyHidden}>{label}</span>\n </>\n ) : (\n children\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;AAqCA,SAAOe,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAe,MAAA,EAAAT,MAAAU,IAAAT,YAAAU,IAAAT,SAAAC,UAAAC,OAAAC,cAAAE;CAClB,MAAAP,OAAAU,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAAT,aAAAU,OAAAC,KAAAA,IAAA,WAAAD;CAAqB,IAAAE;CAAA,IAAAL,EAAA,OAAAP,cAAAO,EAAA,OAAAH,aAAAG,EAAA,OAAAR,QAAAQ,EAAA,OAAAN,SAAA;EAQFW,KAAAnB,GACP,iBACAC,qBAAMmB,OACNtB,UAAUQ,IAAI,GACdL,qBAAOM,aACPC,YAAYU,KAAAA,KAAZ,yBAAkDV,WAClDG,SACJ;EAACG,EAAA,KAAAP;EAAAO,EAAA,KAAAH;EAAAG,EAAA,KAAAR;EAAAQ,EAAA,KAAAN;EAAAM,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAL,YAAAK,EAAA,OAAAJ,OAAA;EAEAW,KAAAX,UAAUQ,KAAAA,IAAV,qBAAAQ,UAAA,EAAA,UAAA,CAEO,oBAAA,QAAA;GAAkB,eAAA;GAAQjB;EAAgB,CAAA,GAC1C,oBAAA,QAAA;GAAiB,WAAAR,qBAAMqB;GAAkBZ,UAAAA;EAAa,CAAA,CAAA,EAAA,CAAA,IAH7DD;EAOAK,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAK,MAAAL,EAAA,OAAAO,IAAA;EAjBLE,KAAA,oBAAA,QAAA;GACe,WAAAJ;GASVE,UAAAA;EAQE,CAAA;EAAAP,EAAA,KAAAK;EAAAL,EAAA,KAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAlBPS;AAkBO"}
|
package/dist/badge/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/badge/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Badge. */\nexport const badgeTokens = defineComponentTokens('badge', {\n /** Space between an icon and the text. */\n gap: 'var(--panneau-space-1)',\n /** Height, and minimum width. */\n height: '1.25rem',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-2)',\n /** Font size. */\n 'font-size': 'var(--panneau-font-size-xs)',\n /** Font weight. */\n 'font-weight': 'var(--panneau-font-weight-medium)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius: a pill by default. */\n radius: 'var(--panneau-radius-full)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","badgeTokens","gap","height","radius"],"sources":["../../src/badge/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Badge. */\nexport const badgeTokens = defineComponentTokens('badge', {\n /** Space between an icon and the text. */\n gap: 'var(--panneau-space-1)',\n /** Height, and minimum width. */\n height: '1.25rem',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-2)',\n /** Font size. */\n 'font-size': 'var(--panneau-font-size-xs)',\n /** Font weight. */\n 'font-weight': 'var(--panneau-font-weight-medium)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius: a pill by default. */\n radius: 'var(--panneau-radius-full)',\n});\n"],"mappings":";;;AAGA,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtDE,KAAK;;CAELC,QAAQ;;CAER,aAAa;;CAEb,aAAa;;CAEb,eAAe;;CAEf,gBAAgB;;CAEhBC,QAAQ;AACZ,CAAC"}
|
package/dist/button/Button.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Icon } from "../icon/Icon.js";
|
|
|
3
3
|
import { Spinner } from "../spinner/Spinner.js";
|
|
4
4
|
import { toneClass } from "../theme/toneClass.js";
|
|
5
5
|
import Button_module_default from "./Button.module.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { Button } from "react-aria-components";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/button/Button.tsx
|
|
@@ -31,32 +32,125 @@ function isAlias(variant) {
|
|
|
31
32
|
* A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses
|
|
32
33
|
* while assistive technologies announce the pending state.
|
|
33
34
|
*/
|
|
34
|
-
function Button$1(
|
|
35
|
+
function Button$1(t0) {
|
|
36
|
+
const $ = c(39);
|
|
37
|
+
let appearance;
|
|
38
|
+
let children;
|
|
39
|
+
let className;
|
|
40
|
+
let icon;
|
|
41
|
+
let iconEnd;
|
|
42
|
+
let props;
|
|
43
|
+
let t1;
|
|
44
|
+
let t2;
|
|
45
|
+
let t3;
|
|
46
|
+
let tone;
|
|
47
|
+
let variant;
|
|
48
|
+
if ($[0] !== t0) {
|
|
49
|
+
({tone, appearance, variant, size: t1, icon, iconEnd, fullWidth: t2, isPending: t3, children, className, ...props} = t0);
|
|
50
|
+
$[0] = t0;
|
|
51
|
+
$[1] = appearance;
|
|
52
|
+
$[2] = children;
|
|
53
|
+
$[3] = className;
|
|
54
|
+
$[4] = icon;
|
|
55
|
+
$[5] = iconEnd;
|
|
56
|
+
$[6] = props;
|
|
57
|
+
$[7] = t1;
|
|
58
|
+
$[8] = t2;
|
|
59
|
+
$[9] = t3;
|
|
60
|
+
$[10] = tone;
|
|
61
|
+
$[11] = variant;
|
|
62
|
+
} else {
|
|
63
|
+
appearance = $[1];
|
|
64
|
+
children = $[2];
|
|
65
|
+
className = $[3];
|
|
66
|
+
icon = $[4];
|
|
67
|
+
iconEnd = $[5];
|
|
68
|
+
props = $[6];
|
|
69
|
+
t1 = $[7];
|
|
70
|
+
t2 = $[8];
|
|
71
|
+
t3 = $[9];
|
|
72
|
+
tone = $[10];
|
|
73
|
+
variant = $[11];
|
|
74
|
+
}
|
|
75
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
76
|
+
const fullWidth = t2 === void 0 ? false : t2;
|
|
77
|
+
const isPending = t3 === void 0 ? false : t3;
|
|
35
78
|
const alias = variant !== void 0 && isAlias(variant) ? ALIASES[variant] : void 0;
|
|
36
79
|
const resolvedTone = tone ?? alias?.tone ?? "neutral";
|
|
37
80
|
const resolvedAppearance = appearance ?? alias?.appearance ?? (resolvedTone === "neutral" ? "outline" : "solid");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
isPending,
|
|
41
|
-
|
|
42
|
-
|
|
81
|
+
let t4;
|
|
82
|
+
if ($[12] !== alias || $[13] !== className || $[14] !== fullWidth || $[15] !== isPending || $[16] !== resolvedAppearance || $[17] !== resolvedTone || $[18] !== size || $[19] !== variant) {
|
|
83
|
+
t4 = cx("panneau-button", Button_module_default.button, toneClass(resolvedTone), Button_module_default[resolvedAppearance], variant !== void 0 && alias === void 0 && `panneau-button-variant-${variant}`, size === "sm" && Button_module_default.sm, fullWidth && Button_module_default.fullWidth, isPending && Button_module_default.pending, className);
|
|
84
|
+
$[12] = alias;
|
|
85
|
+
$[13] = className;
|
|
86
|
+
$[14] = fullWidth;
|
|
87
|
+
$[15] = isPending;
|
|
88
|
+
$[16] = resolvedAppearance;
|
|
89
|
+
$[17] = resolvedTone;
|
|
90
|
+
$[18] = size;
|
|
91
|
+
$[19] = variant;
|
|
92
|
+
$[20] = t4;
|
|
93
|
+
} else t4 = $[20];
|
|
94
|
+
let t5;
|
|
95
|
+
if ($[21] !== icon || $[22] !== size) {
|
|
96
|
+
t5 = icon !== void 0 ? /* @__PURE__ */ jsx(Icon, {
|
|
97
|
+
icon,
|
|
98
|
+
size: size === "sm" ? "sm" : "md"
|
|
99
|
+
}) : null;
|
|
100
|
+
$[21] = icon;
|
|
101
|
+
$[22] = size;
|
|
102
|
+
$[23] = t5;
|
|
103
|
+
} else t5 = $[23];
|
|
104
|
+
let t6;
|
|
105
|
+
if ($[24] !== iconEnd || $[25] !== size) {
|
|
106
|
+
t6 = iconEnd !== void 0 ? /* @__PURE__ */ jsx(Icon, {
|
|
107
|
+
icon: iconEnd,
|
|
108
|
+
size: size === "sm" ? "sm" : "md"
|
|
109
|
+
}) : null;
|
|
110
|
+
$[24] = iconEnd;
|
|
111
|
+
$[25] = size;
|
|
112
|
+
$[26] = t6;
|
|
113
|
+
} else t6 = $[26];
|
|
114
|
+
let t7;
|
|
115
|
+
if ($[27] !== children || $[28] !== t5 || $[29] !== t6) {
|
|
116
|
+
t7 = /* @__PURE__ */ jsxs("span", {
|
|
43
117
|
className: Button_module_default.content,
|
|
44
118
|
children: [
|
|
45
|
-
|
|
46
|
-
icon,
|
|
47
|
-
size: size === "sm" ? "sm" : "md"
|
|
48
|
-
}) : null,
|
|
119
|
+
t5,
|
|
49
120
|
children,
|
|
50
|
-
|
|
51
|
-
icon: iconEnd,
|
|
52
|
-
size: size === "sm" ? "sm" : "md"
|
|
53
|
-
}) : null
|
|
121
|
+
t6
|
|
54
122
|
]
|
|
55
|
-
})
|
|
123
|
+
});
|
|
124
|
+
$[27] = children;
|
|
125
|
+
$[28] = t5;
|
|
126
|
+
$[29] = t6;
|
|
127
|
+
$[30] = t7;
|
|
128
|
+
} else t7 = $[30];
|
|
129
|
+
let t8;
|
|
130
|
+
if ($[31] !== isPending) {
|
|
131
|
+
t8 = isPending ? /* @__PURE__ */ jsx("span", {
|
|
56
132
|
className: Button_module_default.spinner,
|
|
57
133
|
children: /* @__PURE__ */ jsx(Spinner, { size: "sm" })
|
|
58
|
-
}) : null
|
|
59
|
-
|
|
134
|
+
}) : null;
|
|
135
|
+
$[31] = isPending;
|
|
136
|
+
$[32] = t8;
|
|
137
|
+
} else t8 = $[32];
|
|
138
|
+
let t9;
|
|
139
|
+
if ($[33] !== isPending || $[34] !== props || $[35] !== t4 || $[36] !== t7 || $[37] !== t8) {
|
|
140
|
+
t9 = /* @__PURE__ */ jsxs(Button, {
|
|
141
|
+
...props,
|
|
142
|
+
isPending,
|
|
143
|
+
className: t4,
|
|
144
|
+
children: [t7, t8]
|
|
145
|
+
});
|
|
146
|
+
$[33] = isPending;
|
|
147
|
+
$[34] = props;
|
|
148
|
+
$[35] = t4;
|
|
149
|
+
$[36] = t7;
|
|
150
|
+
$[37] = t8;
|
|
151
|
+
$[38] = t9;
|
|
152
|
+
} else t9 = $[38];
|
|
153
|
+
return t9;
|
|
60
154
|
}
|
|
61
155
|
//#endregion
|
|
62
156
|
export { Button$1 as Button, Button_module_default as buttonStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["Button","AriaButton","styles"],"sources":["../../src/button/Button.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Button as AriaButton, type ButtonProps as AriaButtonProps } from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { Spinner } from '../spinner/Spinner';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Button.module.css';\n\n/** How a button uses its tone, like Bootstrap's `.btn-*` and `.btn-outline-*`. */\nexport type ButtonAppearance = 'solid' | 'outline' | 'subtle' | 'ghost';\n\n/**\n * Named variants of `Button`, registered by a theme (`components.button.variants`). Declare them\n * here so that `variant=\"pill\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface ButtonVariants {\n * pill: true;\n * }\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface ButtonVariants {}\n\n/**\n * The variants of the first alpha, kept as aliases of a tone and an appearance: `primary` is\n * accent solid, `secondary` neutral outline, `ghost` neutral ghost, `danger` danger solid.\n *\n * @deprecated Use `tone` and `appearance`.\n */\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nconst ALIASES: Record<ButtonVariant, { tone: Tone; appearance: ButtonAppearance }> = {\n primary: { tone: 'accent', appearance: 'solid' },\n secondary: { tone: 'neutral', appearance: 'outline' },\n ghost: { tone: 'neutral', appearance: 'ghost' },\n danger: { tone: 'danger', appearance: 'solid' },\n};\n\nfunction isAlias(variant: string): variant is ButtonVariant {\n return Object.hasOwn(ALIASES, variant);\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'className' | 'style' | 'children'> {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `outline` for the neutral tone, and `solid` for the others. */\n appearance?: ButtonAppearance;\n /** A named variant of the theme, or one of the deprecated aliases (`primary`…). */\n variant?: ButtonVariant | (keyof ButtonVariants & string);\n size?: 'sm' | 'md';\n /** Icon before the label. */\n icon?: IconComponent;\n /** Icon after the label. */\n iconEnd?: IconComponent;\n /** Takes the full width of its container. */\n fullWidth?: boolean;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/**\n * A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses\n * while assistive technologies announce the pending state.\n */\nexport function Button({\n tone,\n appearance,\n variant,\n size = 'md',\n icon,\n iconEnd,\n fullWidth = false,\n isPending = false,\n children,\n className,\n ...props\n}: ButtonProps) {\n const alias = variant !== undefined && isAlias(variant) ? ALIASES[variant] : undefined;\n const resolvedTone = tone ?? alias?.tone ?? 'neutral';\n const resolvedAppearance =\n appearance ?? alias?.appearance ?? (resolvedTone === 'neutral' ? 'outline' : 'solid');\n return (\n <AriaButton\n {...props}\n isPending={isPending}\n className={cx(\n 'panneau-button',\n styles.button,\n toneClass(resolvedTone),\n styles[resolvedAppearance],\n variant !== undefined && alias === undefined && `panneau-button-variant-${variant}`,\n size === 'sm' && styles.sm,\n fullWidth && styles.fullWidth,\n isPending && styles.pending,\n className,\n )}\n >\n <span className={styles.content}>\n {icon !== undefined ? (\n <Icon icon={icon} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n {children}\n {iconEnd !== undefined ? (\n <Icon icon={iconEnd} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n </span>\n {isPending ? (\n <span className={styles.spinner}>\n <Spinner size=\"sm\" />\n </span>\n ) : null}\n </AriaButton>\n );\n}\n\nexport { styles as buttonStyles };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","names":["CSSProperties","ReactNode","Button","AriaButton","ButtonProps","AriaButtonProps","Icon","IconComponent","Spinner","toneClass","Tone","cx","styles","ButtonAppearance","ButtonVariants","ButtonVariant","ALIASES","Record","tone","appearance","primary","secondary","ghost","danger","isAlias","variant","Object","hasOwn","Omit","size","icon","iconEnd","fullWidth","children","className","style","t0","$","_c","props","t1","t2","t3","isPending","undefined","alias","resolvedTone","resolvedAppearance","t4","button","sm","pending","t5","t6","t7","content","t8","spinner","t9","buttonStyles","Button","_c","styles","AriaButton"],"sources":["../../src/button/Button.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Button as AriaButton, type ButtonProps as AriaButtonProps } from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { Spinner } from '../spinner/Spinner';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Button.module.css';\n\n/** How a button uses its tone, like Bootstrap's `.btn-*` and `.btn-outline-*`. */\nexport type ButtonAppearance = 'solid' | 'outline' | 'subtle' | 'ghost';\n\n/**\n * Named variants of `Button`, registered by a theme (`components.button.variants`). Declare them\n * here so that `variant=\"pill\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface ButtonVariants {\n * pill: true;\n * }\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface ButtonVariants {}\n\n/**\n * The variants of the first alpha, kept as aliases of a tone and an appearance: `primary` is\n * accent solid, `secondary` neutral outline, `ghost` neutral ghost, `danger` danger solid.\n *\n * @deprecated Use `tone` and `appearance`.\n */\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nconst ALIASES: Record<ButtonVariant, { tone: Tone; appearance: ButtonAppearance }> = {\n primary: { tone: 'accent', appearance: 'solid' },\n secondary: { tone: 'neutral', appearance: 'outline' },\n ghost: { tone: 'neutral', appearance: 'ghost' },\n danger: { tone: 'danger', appearance: 'solid' },\n};\n\nfunction isAlias(variant: string): variant is ButtonVariant {\n return Object.hasOwn(ALIASES, variant);\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'className' | 'style' | 'children'> {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `outline` for the neutral tone, and `solid` for the others. */\n appearance?: ButtonAppearance;\n /** A named variant of the theme, or one of the deprecated aliases (`primary`…). */\n variant?: ButtonVariant | (keyof ButtonVariants & string);\n size?: 'sm' | 'md';\n /** Icon before the label. */\n icon?: IconComponent;\n /** Icon after the label. */\n iconEnd?: IconComponent;\n /** Takes the full width of its container. */\n fullWidth?: boolean;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/**\n * A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses\n * while assistive technologies announce the pending state.\n */\nexport function Button({\n tone,\n appearance,\n variant,\n size = 'md',\n icon,\n iconEnd,\n fullWidth = false,\n isPending = false,\n children,\n className,\n ...props\n}: ButtonProps) {\n const alias = variant !== undefined && isAlias(variant) ? ALIASES[variant] : undefined;\n const resolvedTone = tone ?? alias?.tone ?? 'neutral';\n const resolvedAppearance =\n appearance ?? alias?.appearance ?? (resolvedTone === 'neutral' ? 'outline' : 'solid');\n return (\n <AriaButton\n {...props}\n isPending={isPending}\n className={cx(\n 'panneau-button',\n styles.button,\n toneClass(resolvedTone),\n styles[resolvedAppearance],\n variant !== undefined && alias === undefined && `panneau-button-variant-${variant}`,\n size === 'sm' && styles.sm,\n fullWidth && styles.fullWidth,\n isPending && styles.pending,\n className,\n )}\n >\n <span className={styles.content}>\n {icon !== undefined ? (\n <Icon icon={icon} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n {children}\n {iconEnd !== undefined ? (\n <Icon icon={iconEnd} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n </span>\n {isPending ? (\n <span className={styles.spinner}>\n <Spinner size=\"sm\" />\n </span>\n ) : null}\n </AriaButton>\n );\n}\n\nexport { styles as buttonStyles };\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/button/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Button. */\nexport const buttonTokens = defineComponentTokens('button', {\n /** Space between the icon and the label. */\n gap: 'var(--panneau-space-2)',\n /** Horizontal padding. */\n 'padding-x': 'calc(var(--panneau-control-padding-x) + var(--panneau-space-1))',\n /** Font size of the label. */\n 'font-size': 'var(--panneau-font-size-md)',\n /** Font weight of the label. */\n 'font-weight': 'var(--panneau-font-weight-medium)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Horizontal padding of the small size. */\n 'padding-x-sm': 'var(--panneau-control-padding-x)',\n /** Font size of the small size. */\n 'font-size-sm': 'var(--panneau-font-size-sm)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","buttonTokens","gap","radius"],"sources":["../../src/button/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Button. */\nexport const buttonTokens = defineComponentTokens('button', {\n /** Space between the icon and the label. */\n gap: 'var(--panneau-space-2)',\n /** Horizontal padding. */\n 'padding-x': 'calc(var(--panneau-control-padding-x) + var(--panneau-space-1))',\n /** Font size of the label. */\n 'font-size': 'var(--panneau-font-size-md)',\n /** Font weight of the label. */\n 'font-weight': 'var(--panneau-font-weight-medium)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Horizontal padding of the small size. */\n 'padding-x-sm': 'var(--panneau-control-padding-x)',\n /** Font size of the small size. */\n 'font-size-sm': 'var(--panneau-font-size-sm)',\n});\n"],"mappings":";;;AAGA,IAAaC,eAAeD,sBAAsB,UAAU;;CAExDE,KAAK;;CAEL,aAAa;;CAEb,aAAa;;CAEb,eAAe;;CAEf,gBAAgB;;CAEhBC,QAAQ;;CAER,gBAAgB;;CAEhB,gBAAgB;AACpB,CAAC"}
|