@bythium/unisson 0.1.1-rc.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -15
- package/dist/CHANGELOG.md +23 -0
- package/dist/badge.d.ts +27 -0
- package/dist/badge.js +1 -0
- package/dist/button.js +1 -1
- package/dist/card.d.ts +29 -0
- package/dist/card.js +1 -0
- package/dist/checkbox.d.ts +39 -0
- package/dist/checkbox.js +1 -0
- package/dist/chunks/chunk-4JVFLK3U.js +416 -0
- package/dist/chunks/chunk-4LYJO5OS.js +411 -0
- package/dist/chunks/chunk-53M4DJQN.js +406 -0
- package/dist/chunks/chunk-5UXAUVTG.js +1 -0
- package/dist/chunks/chunk-6OG5ZBWQ.js +334 -0
- package/dist/chunks/chunk-7YT6MUHG.js +383 -0
- package/dist/chunks/chunk-B2JFDWCV.js +265 -0
- package/dist/chunks/chunk-D52FUFUP.js +1 -0
- package/dist/chunks/{chunk-MYB6FQX2.js → chunk-FATZ4W4Y.js} +2 -2
- package/dist/chunks/chunk-GG2TGBO7.js +388 -0
- package/dist/chunks/chunk-HBQNWILJ.js +447 -0
- package/dist/chunks/chunk-HYLPNRSS.js +346 -0
- package/dist/chunks/chunk-I67ANBTP.js +328 -0
- package/dist/chunks/chunk-IGDZPHRL.js +338 -0
- package/dist/chunks/chunk-J5K4GGOS.js +269 -0
- package/dist/chunks/chunk-KDXXLMWM.js +1 -0
- package/dist/chunks/{chunk-WKXQ2JMZ.js → chunk-NHTQILO5.js} +2 -2
- package/dist/chunks/chunk-ORYY4OPY.js +307 -0
- package/dist/chunks/chunk-QMY5FB4F.js +293 -0
- package/dist/chunks/chunk-SADTI7JS.js +319 -0
- package/dist/chunks/chunk-SEAWGQLP.js +316 -0
- package/dist/chunks/chunk-SUDTJKQT.js +314 -0
- package/dist/chunks/chunk-SVPZPTWA.js +353 -0
- package/dist/chunks/{chunk-MWNIQCR3.js → chunk-U7UKQQ5V.js} +1 -1
- package/dist/chunks/chunk-YAVUNJL2.js +326 -0
- package/dist/chunks/chunk-ZOW53TBP.js +358 -0
- package/dist/confirm-button.js +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/custom-elements.json +3925 -0
- package/dist/define.d.ts +20 -0
- package/dist/define.js +1 -1
- package/dist/dialog.d.ts +29 -0
- package/dist/dialog.js +1 -0
- package/dist/field.d.ts +23 -0
- package/dist/field.js +1 -0
- package/dist/form.d.ts +29 -0
- package/dist/form.js +1 -0
- package/dist/heading.d.ts +21 -0
- package/dist/heading.js +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +1 -1
- package/dist/inline-alert.d.ts +25 -0
- package/dist/inline-alert.js +1 -0
- package/dist/input.d.ts +53 -0
- package/dist/input.js +1 -0
- package/dist/radio-group.d.ts +45 -0
- package/dist/radio-group.js +1 -0
- package/dist/react/badge.d.ts +25 -0
- package/dist/react/badge.js +7 -0
- package/dist/react/card.d.ts +27 -0
- package/dist/react/card.js +7 -0
- package/dist/react/checkbox.d.ts +37 -0
- package/dist/react/checkbox.js +7 -0
- package/dist/react/dialog.d.ts +27 -0
- package/dist/react/dialog.js +7 -0
- package/dist/react/field.d.ts +21 -0
- package/dist/react/field.js +7 -0
- package/dist/react/form.d.ts +27 -0
- package/dist/react/form.js +7 -0
- package/dist/react/heading.d.ts +19 -0
- package/dist/react/heading.js +7 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +20 -0
- package/dist/react/inline-alert.d.ts +23 -0
- package/dist/react/inline-alert.js +7 -0
- package/dist/react/input.d.ts +51 -0
- package/dist/react/input.js +7 -0
- package/dist/react/radio-group.d.ts +43 -0
- package/dist/react/radio-group.js +7 -0
- package/dist/react/select.d.ts +39 -0
- package/dist/react/select.js +7 -0
- package/dist/react/stack.d.ts +25 -0
- package/dist/react/stack.js +7 -0
- package/dist/react/switch.d.ts +37 -0
- package/dist/react/switch.js +7 -0
- package/dist/react/tab-panel.d.ts +23 -0
- package/dist/react/tab-panel.js +7 -0
- package/dist/react/tab.d.ts +23 -0
- package/dist/react/tab.js +7 -0
- package/dist/react/tabs.d.ts +27 -0
- package/dist/react/tabs.js +7 -0
- package/dist/react/text.d.ts +23 -0
- package/dist/react/text.js +7 -0
- package/dist/react/textarea.d.ts +43 -0
- package/dist/react/textarea.js +7 -0
- package/dist/react/toast.d.ts +25 -0
- package/dist/react/toast.js +7 -0
- package/dist/react/toaster.d.ts +21 -0
- package/dist/react/toaster.js +7 -0
- package/dist/select.d.ts +41 -0
- package/dist/select.js +1 -0
- package/dist/stack.d.ts +27 -0
- package/dist/stack.js +1 -0
- package/dist/svelte/OBadge.svelte +14 -0
- package/dist/svelte/OBadge.svelte.d.ts +26 -0
- package/dist/svelte/OCard.svelte +14 -0
- package/dist/svelte/OCard.svelte.d.ts +28 -0
- package/dist/svelte/OCheckbox.svelte +14 -0
- package/dist/svelte/OCheckbox.svelte.d.ts +38 -0
- package/dist/svelte/ODialog.svelte +14 -0
- package/dist/svelte/ODialog.svelte.d.ts +28 -0
- package/dist/svelte/OField.svelte +14 -0
- package/dist/svelte/OField.svelte.d.ts +22 -0
- package/dist/svelte/OForm.svelte +14 -0
- package/dist/svelte/OForm.svelte.d.ts +28 -0
- package/dist/svelte/OHeading.svelte +14 -0
- package/dist/svelte/OHeading.svelte.d.ts +20 -0
- package/dist/svelte/OInlineAlert.svelte +14 -0
- package/dist/svelte/OInlineAlert.svelte.d.ts +24 -0
- package/dist/svelte/OInput.svelte +14 -0
- package/dist/svelte/OInput.svelte.d.ts +52 -0
- package/dist/svelte/ORadioGroup.svelte +14 -0
- package/dist/svelte/ORadioGroup.svelte.d.ts +44 -0
- package/dist/svelte/OSelect.svelte +14 -0
- package/dist/svelte/OSelect.svelte.d.ts +40 -0
- package/dist/svelte/OStack.svelte +14 -0
- package/dist/svelte/OStack.svelte.d.ts +26 -0
- package/dist/svelte/OSwitch.svelte +14 -0
- package/dist/svelte/OSwitch.svelte.d.ts +38 -0
- package/dist/svelte/OTab.svelte +14 -0
- package/dist/svelte/OTab.svelte.d.ts +24 -0
- package/dist/svelte/OTabPanel.svelte +14 -0
- package/dist/svelte/OTabPanel.svelte.d.ts +24 -0
- package/dist/svelte/OTabs.svelte +14 -0
- package/dist/svelte/OTabs.svelte.d.ts +28 -0
- package/dist/svelte/OText.svelte +14 -0
- package/dist/svelte/OText.svelte.d.ts +24 -0
- package/dist/svelte/OTextarea.svelte +14 -0
- package/dist/svelte/OTextarea.svelte.d.ts +44 -0
- package/dist/svelte/OToast.svelte +14 -0
- package/dist/svelte/OToast.svelte.d.ts +26 -0
- package/dist/svelte/OToaster.svelte +14 -0
- package/dist/svelte/OToaster.svelte.d.ts +22 -0
- package/dist/svelte/index.d.ts +20 -0
- package/dist/svelte/index.js +20 -0
- package/dist/switch.d.ts +39 -0
- package/dist/switch.js +1 -0
- package/dist/tab-panel.d.ts +25 -0
- package/dist/tab-panel.js +1 -0
- package/dist/tab.d.ts +25 -0
- package/dist/tab.js +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.js +1 -0
- package/dist/text.d.ts +25 -0
- package/dist/text.js +1 -0
- package/dist/textarea.d.ts +45 -0
- package/dist/textarea.js +1 -0
- package/dist/toast.d.ts +27 -0
- package/dist/toast.js +1 -0
- package/dist/toaster.d.ts +23 -0
- package/dist/toaster.js +1 -0
- package/dist/vue/badge.d.ts +26 -0
- package/dist/vue/badge.js +6 -0
- package/dist/vue/card.d.ts +28 -0
- package/dist/vue/card.js +6 -0
- package/dist/vue/checkbox.d.ts +37 -0
- package/dist/vue/checkbox.js +6 -0
- package/dist/vue/dialog.d.ts +27 -0
- package/dist/vue/dialog.js +6 -0
- package/dist/vue/field.d.ts +22 -0
- package/dist/vue/field.js +6 -0
- package/dist/vue/form.d.ts +27 -0
- package/dist/vue/form.js +6 -0
- package/dist/vue/heading.d.ts +20 -0
- package/dist/vue/heading.js +6 -0
- package/dist/vue/index.d.ts +20 -0
- package/dist/vue/index.js +20 -0
- package/dist/vue/inline-alert.d.ts +23 -0
- package/dist/vue/inline-alert.js +6 -0
- package/dist/vue/input.d.ts +51 -0
- package/dist/vue/input.js +6 -0
- package/dist/vue/radio-group.d.ts +43 -0
- package/dist/vue/radio-group.js +6 -0
- package/dist/vue/select.d.ts +39 -0
- package/dist/vue/select.js +6 -0
- package/dist/vue/stack.d.ts +26 -0
- package/dist/vue/stack.js +6 -0
- package/dist/vue/switch.d.ts +37 -0
- package/dist/vue/switch.js +6 -0
- package/dist/vue/tab-panel.d.ts +24 -0
- package/dist/vue/tab-panel.js +6 -0
- package/dist/vue/tab.d.ts +24 -0
- package/dist/vue/tab.js +6 -0
- package/dist/vue/tabs.d.ts +27 -0
- package/dist/vue/tabs.js +6 -0
- package/dist/vue/text.d.ts +24 -0
- package/dist/vue/text.js +6 -0
- package/dist/vue/textarea.d.ts +43 -0
- package/dist/vue/textarea.js +6 -0
- package/dist/vue/toast.d.ts +25 -0
- package/dist/vue/toast.js +6 -0
- package/dist/vue/toaster.d.ts +22 -0
- package/dist/vue/toaster.js +6 -0
- package/package.json +346 -3
- package/dist/chunks/chunk-BAYUYXVR.js +0 -1
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# @bythium/unisson
|
|
2
2
|
|
|
3
|
-
The Unisson
|
|
4
|
-
`custom-elements.json` manifest. Documentation: https://unisson.bythium.ai
|
|
3
|
+
The Unisson components as native custom elements, with typed Vue 3, React 19 and Svelte 5 wrappers, design tokens
|
|
4
|
+
and a `custom-elements.json` manifest. Documentation: https://unisson.bythium.ai
|
|
5
5
|
|
|
6
|
-
Version 0.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
Version 0.2.0 is prepared and not yet published; `npm install @bythium/unisson` still installs 0.1.0, the seven
|
|
7
|
+
buttons. It holds 27 tags in four groups:
|
|
8
|
+
|
|
9
|
+
| Group | Tags |
|
|
10
|
+
|-------|------|
|
|
11
|
+
| Buttons (7) | `bythium-button`, `bythium-icon-button`, `bythium-toggle-button`, `bythium-button-group`, `bythium-copy-button`, `bythium-split-button`, `bythium-confirm-button` |
|
|
12
|
+
| Text and layout (3) | `bythium-text`, `bythium-heading`, `bythium-stack` |
|
|
13
|
+
| Forms (8) | `bythium-field`, `bythium-input`, `bythium-textarea`, `bythium-select`, `bythium-checkbox`, `bythium-radio-group`, `bythium-switch`, `bythium-form` |
|
|
14
|
+
| Feedback and composition (9) | `bythium-badge`, `bythium-card`, `bythium-inline-alert`, `bythium-tabs`, `bythium-tab`, `bythium-tab-panel`, `bythium-toast`, `bythium-toaster`, `bythium-dialog` |
|
|
15
|
+
|
|
16
|
+
The wrappers are `O<Pascal>` (`OButton`, `OInput`, `OForm`, ...). The other tags of the catalog are coming later.
|
|
10
17
|
|
|
11
18
|
## Install
|
|
12
19
|
|
|
@@ -22,7 +29,7 @@ project uses. The web components need no framework.
|
|
|
22
29
|
## Web components
|
|
23
30
|
|
|
24
31
|
```js
|
|
25
|
-
// Defines the
|
|
32
|
+
// Defines the 27 tags.
|
|
26
33
|
import '@bythium/unisson';
|
|
27
34
|
import '@bythium/unisson/tokens.css';
|
|
28
35
|
```
|
|
@@ -31,7 +38,21 @@ import '@bythium/unisson/tokens.css';
|
|
|
31
38
|
<bythium-button variant="primary">Enregistrer</bythium-button>
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
```html
|
|
42
|
+
<bythium-form label="Notifications">
|
|
43
|
+
<form novalidate>
|
|
44
|
+
<bythium-input label="Courriel" name="courriel" type="email" required></bythium-input>
|
|
45
|
+
<bythium-select label="Canal" name="canal" items="Courriel|Texto"></bythium-select>
|
|
46
|
+
<bythium-checkbox label="Recevoir les alertes" name="alertes" value="oui"></bythium-checkbox>
|
|
47
|
+
<bythium-button type="submit">Enregistrer</bythium-button>
|
|
48
|
+
</form>
|
|
49
|
+
</bythium-form>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`bythium-input`, `bythium-textarea`, `bythium-select`, `bythium-checkbox`, `bythium-radio-group` and
|
|
53
|
+
`bythium-switch` are form-associated custom elements: inside a native `<form>`, they take part in its validation and
|
|
54
|
+
in its `FormData`. `bythium-form` adds a shared error summary and the `bythium-submit` event. One tag only (its
|
|
55
|
+
module and the shared core): `import '@bythium/unisson/button';`
|
|
35
56
|
|
|
36
57
|
The modules are browser modules: a tag class extends `HTMLElement`, so import them where a DOM exists (a browser, or
|
|
37
58
|
a test environment with one). A server render writes the tags as HTML; the browser upgrades them when the module loads.
|
|
@@ -62,6 +83,30 @@ function onBythiumAction(event) {
|
|
|
62
83
|
</template>
|
|
63
84
|
```
|
|
64
85
|
|
|
86
|
+
A form with the form wrappers:
|
|
87
|
+
|
|
88
|
+
```vue
|
|
89
|
+
<script setup>
|
|
90
|
+
import { OForm, OInput, OSelect, OCheckbox, OButton } from '@bythium/unisson/vue';
|
|
91
|
+
import '@bythium/unisson/tokens.css';
|
|
92
|
+
|
|
93
|
+
function onBythiumSubmit(event) {
|
|
94
|
+
console.log(event.detail.formData.get('courriel'));
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<OForm label="Notifications" @bythium-submit="onBythiumSubmit">
|
|
100
|
+
<form novalidate>
|
|
101
|
+
<OInput label="Courriel" name="courriel" type="email" required />
|
|
102
|
+
<OSelect label="Canal" name="canal" items="Courriel|Texto" />
|
|
103
|
+
<OCheckbox label="Recevoir les alertes" name="alertes" value="oui" />
|
|
104
|
+
<OButton type="submit" variant="primary">Enregistrer</OButton>
|
|
105
|
+
</form>
|
|
106
|
+
</OForm>
|
|
107
|
+
</template>
|
|
108
|
+
```
|
|
109
|
+
|
|
65
110
|
- Props are the tag's attributes (`disabled-focusable` or `disabledFocusable`). A `false` boolean writes no attribute.
|
|
66
111
|
- Each event of the tag is an emit of the same name (`@bythium-action`); the handler receives the `CustomEvent`.
|
|
67
112
|
- A named slot of the tag is a Vue slot: `<template #control><button type="submit">Envoyer</button></template>`.
|
|
@@ -122,20 +167,21 @@ export function SaveButton() {
|
|
|
122
167
|
## Entries
|
|
123
168
|
|
|
124
169
|
`<name>` is one of `button`, `icon-button`, `toggle-button`, `button-group`, `copy-button`, `split-button`,
|
|
125
|
-
`confirm-button
|
|
170
|
+
`confirm-button`, `text`, `heading`, `stack`, `field`, `input`, `textarea`, `select`, `checkbox`, `radio-group`,
|
|
171
|
+
`switch`, `form`, `badge`, `card`, `inline-alert`, `tabs`, `tab`, `tab-panel`, `toast`, `toaster`, `dialog`.
|
|
126
172
|
|
|
127
173
|
| Entry | Content |
|
|
128
174
|
|-------|---------|
|
|
129
|
-
| `@bythium/unisson` | Defines the
|
|
130
|
-
| `@bythium/unisson/define` | Defines the
|
|
175
|
+
| `@bythium/unisson` | Defines the 27 tags; exports their classes (`BythiumButton`, ...) |
|
|
176
|
+
| `@bythium/unisson/define` | Defines the 27 tags; exports nothing |
|
|
131
177
|
| `@bythium/unisson/<name>` | Defines one tag |
|
|
132
178
|
| `@bythium/unisson/tokens.css` | The design tokens (`--bythium-*` custom properties, light and dark themes) |
|
|
133
|
-
| `@bythium/unisson/custom-elements.json` | Custom Elements Manifest of the
|
|
134
|
-
| `@bythium/unisson/vue` | The
|
|
179
|
+
| `@bythium/unisson/custom-elements.json` | Custom Elements Manifest of the 27 tags |
|
|
180
|
+
| `@bythium/unisson/vue` | The 27 Vue wrappers (`OButton`, ...) |
|
|
135
181
|
| `@bythium/unisson/vue/<name>` | One Vue wrapper: `import { OButton } from '@bythium/unisson/vue/button'` |
|
|
136
|
-
| `@bythium/unisson/react` | The
|
|
182
|
+
| `@bythium/unisson/react` | The 27 React wrappers |
|
|
137
183
|
| `@bythium/unisson/react/<name>` | One React wrapper: `import { OButton } from '@bythium/unisson/react/button'` |
|
|
138
|
-
| `@bythium/unisson/svelte` | The
|
|
184
|
+
| `@bythium/unisson/svelte` | The 27 Svelte wrappers |
|
|
139
185
|
| `@bythium/unisson/svelte/<name>` | One Svelte component: `import OButton from '@bythium/unisson/svelte/button'` |
|
|
140
186
|
|
|
141
187
|
A wrapper loads only the module of its own tag, in the browser; importing one wrapper from an index keeps the others
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
The changelog of `@bythium/unisson` (see README.md, "Versions").
|
|
4
4
|
|
|
5
|
+
## 0.2.0 (2026-11-25)
|
|
6
|
+
|
|
7
|
+
Prepared release: the package contents and this changelog are ready in the repository, but nothing is published to
|
|
8
|
+
npm yet. Publication is a separate step of `.github/workflows/unisson-release.yml`, run when the tag
|
|
9
|
+
`unisson-v0.2.0` is pushed; until then, `@bythium/unisson` on npm stays at 0.1.0.
|
|
10
|
+
|
|
11
|
+
- 27 tags, in four groups: the seven buttons of 0.1.0; text and layout (`bythium-text`, `bythium-heading`,
|
|
12
|
+
`bythium-stack`); forms (`bythium-field`, `bythium-input`, `bythium-textarea`, `bythium-select`,
|
|
13
|
+
`bythium-checkbox`, `bythium-radio-group`, `bythium-switch`, `bythium-form`); feedback and composition
|
|
14
|
+
(`bythium-badge`, `bythium-card`, `bythium-inline-alert`, `bythium-tabs`, `bythium-tab`, `bythium-tab-panel`,
|
|
15
|
+
`bythium-toast`, `bythium-toaster`, `bythium-dialog`).
|
|
16
|
+
- The form tags work with native forms: `bythium-input`, `bythium-textarea`, `bythium-select`, `bythium-checkbox`,
|
|
17
|
+
`bythium-radio-group` and `bythium-switch` are form-associated custom elements, so they validate and submit inside
|
|
18
|
+
a native `form`; `bythium-field` labels a native control or a field tag, and `bythium-form` adds the shared error
|
|
19
|
+
summary and the `bythium-submit` event. The select, radio group and switch take their options or their label from
|
|
20
|
+
attributes, without a child list.
|
|
21
|
+
- Typed Vue 3, React 19 and Svelte 5 wrappers for the 20 new tags (`OInput`, `OForm`, `OSelect`, `OCheckbox`,
|
|
22
|
+
`ORadioGroup`, `OSwitch`, `OTextarea`, `OField`, `OText`, `OHeading`, `OStack`, `OBadge`, `OCard`, `OInlineAlert`,
|
|
23
|
+
`OTabs`, `OTab`, `OTabPanel`, `OToast`, `OToaster`, `ODialog`), generated from the contracts like the button
|
|
24
|
+
wrappers.
|
|
25
|
+
- The TypeScript declarations, `tokens.css` and `custom-elements.json` cover all 27 tags.
|
|
26
|
+
- No breaking change to the seven buttons of 0.1.0; `available.json` keeps `since: "0.1.0"`.
|
|
27
|
+
|
|
5
28
|
## 0.1.1-rc.0 (prerelease, dist-tag next)
|
|
6
29
|
|
|
7
30
|
No change to the package contents: a prerelease that checks the release workflow publishes through npm trusted
|
package/dist/badge.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated from the contract of bythium-badge. Do not edit.
|
|
2
|
+
export interface BythiumBadgeEventMap extends HTMLElementEventMap {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/** Étiquette statique de statut ou de catégorie : un texte court (ou un nombre) sur un fond teinté par le ton, en rectangle arrondi, en pastille ou en rond. */
|
|
6
|
+
export declare class BythiumBadge extends HTMLElement {
|
|
7
|
+
/** Ton : info (défaut), success, danger, warning, neutral (gris), brand (violet de marque), outline (contour sans fond) ou gradient (dégradé de marque, texte sombre). Le texte porte le sens ; la couleur le souligne. Attribute `tone`. */
|
|
8
|
+
tone: 'info' | 'success' | 'danger' | 'warning' | 'neutral' | 'brand' | 'outline' | 'gradient';
|
|
9
|
+
/** Forme : rounded (défaut, coins arrondis), pill (pastille aux extrémités rondes) ou circle (rond, pour un ou deux caractères comme un numéro). Attribute `shape`. */
|
|
10
|
+
shape: 'rounded' | 'pill' | 'circle';
|
|
11
|
+
/** Taille : sm (défaut, 20 px), md (28 px, pour une puce de filtre ou de catégorie) ou lg (52 px, pour une grande pastille de confirmation : cadre à 50 % du ton, fond à 14 %, pictogramme de 26 px, comme le crochet de la page de remerciement). Attribute `size`. */
|
|
12
|
+
size: 'sm' | 'md' | 'lg';
|
|
13
|
+
/** Ajoute un point décoratif devant le texte, de la couleur du ton. Attribute `dot`. */
|
|
14
|
+
dot: boolean;
|
|
15
|
+
/** Infobulle de l’étiquette, montrée au survol et au focus clavier, masquée par Échap ; elle décrit l’étiquette (aria-describedby) et la rend atteignable au clavier. Vide : aucune infobulle, aucun arrêt de tabulation. Attribute `hint`. */
|
|
16
|
+
hint: string;
|
|
17
|
+
addEventListener<K extends keyof BythiumBadgeEventMap>(type: K, listener: (this: BythiumBadge, event: BythiumBadgeEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
18
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
19
|
+
removeEventListener<K extends keyof BythiumBadgeEventMap>(type: K, listener: (this: BythiumBadge, event: BythiumBadgeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
20
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
'bythium-badge': BythiumBadge;
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/badge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunks/chunk-4JVFLK3U.js";import"./chunks/chunk-FGJHPGJI.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumBadge};
|
package/dist/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunks/chunk-
|
|
1
|
+
import{a}from"./chunks/chunk-NHTQILO5.js";import"./chunks/chunk-5UXAUVTG.js";import"./chunks/chunk-FGJHPGJI.js";import"./chunks/chunk-D52FUFUP.js";import"./chunks/chunk-5VNPX7DT.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumButton};
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Generated from the contract of bythium-card. Do not edit.
|
|
2
|
+
export interface BythiumCardEventMap extends HTMLElementEventMap {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/** Surface sur filet (à plat par défaut, relevée ou en dégradé) : en-tête (texte de label ou slot header), contenu et pied, chacun alimenté par un slot. */
|
|
6
|
+
export declare class BythiumCard extends HTMLElement {
|
|
7
|
+
/** Texte de l’en-tête quand le slot header est vide (texte simple, pas un titre du plan). Vide par défaut. Attribute `label`. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Fond de la carte : default (à plat, comme avant), raised (fond relevé), gradient (dégradé vertical avec ombre portée, clair et sombre) ou page (fond de la page, pour une fenêtre posée sur une carte). Attribute `surface`. */
|
|
10
|
+
surface: 'default' | 'raised' | 'gradient' | 'page';
|
|
11
|
+
/** Marge intérieure : md (défaut, 14 à 16 px) ou lg (36 px sur 32 px, rayon de 20 px, sans filet sous l’en-tête). Attribute `padding`. */
|
|
12
|
+
padding: 'md' | 'lg';
|
|
13
|
+
/** Cadre : none (défaut, carte simple) ou window (fenêtre : barre de titre sur fond de surface avec trois points décoratifs et le titre en chasse fixe, rayon de 16 px, ombre portée, contenu à 16 px, pied masqué s’il est vide). Le titre vient du label ou du slot header. Attribute `frame`. */
|
|
14
|
+
frame: 'none' | 'window';
|
|
15
|
+
/** Halo violet sous la carte (ombre portée colorée des cartes de tête et des fenêtres). Retiré en couleurs forcées ; aucun mouvement. Attribute `glow`. */
|
|
16
|
+
glow: boolean;
|
|
17
|
+
/** Langue des textes intégrés (BCP 47) : texte du contenu quand le slot par défaut est vide. Toute balise en vaut en, le reste vaut fr. Un label écrit par la page l’emporte. Attribute `locale`. */
|
|
18
|
+
locale: string;
|
|
19
|
+
addEventListener<K extends keyof BythiumCardEventMap>(type: K, listener: (this: BythiumCard, event: BythiumCardEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
20
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
21
|
+
removeEventListener<K extends keyof BythiumCardEventMap>(type: K, listener: (this: BythiumCard, event: BythiumCardEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
22
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'bythium-card': BythiumCard;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunks/chunk-4LYJO5OS.js";import"./chunks/chunk-D52FUFUP.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumCard};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Generated from the contract of bythium-checkbox. Do not edit.
|
|
2
|
+
export interface BythiumCheckboxEventMap extends HTMLElementEventMap {
|
|
3
|
+
/** Émis quand l’utilisateur coche ou décoche la case, après la mise à jour de checked. Une écriture de l’attribut n’émet rien. */
|
|
4
|
+
'bythium-change': CustomEvent<{ value: string; checked: boolean }>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Case à cocher native avec libellé, aide, état indéterminé et validation obligatoire, associée aux formulaires. */
|
|
8
|
+
export declare class BythiumCheckbox extends HTMLElement {
|
|
9
|
+
/** Valeur envoyée avec le formulaire quand la case est cochée. Attribute `value`. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Libellé visible à côté de la case, dans le même arbre : il donne le nom accessible. Attribute `label`. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Nom du champ dans le formulaire. Attribute `name`. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Case à cocher obligatoirement : invalide tant qu’elle est décochée (« Cochez cette case. ») ; l’erreur ne s’affiche qu’après une interaction. Attribute `required`. */
|
|
16
|
+
required: boolean;
|
|
17
|
+
/** Refuse le changement ; la valeur n’est pas envoyée. Attribute `disabled`. */
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
/** Aide affichée sous le libellé quand le slot help est vide. Attribute `hint`. */
|
|
20
|
+
hint: string;
|
|
21
|
+
/** État coché, reflété à chaque clic ; celui du premier raccordement revient au reset du formulaire. Attribute `checked`. */
|
|
22
|
+
checked: boolean;
|
|
23
|
+
/** État mixte affiché (ni coché ni décoché) ; retiré dès que l’utilisateur change la case. Attribute `indeterminate`. */
|
|
24
|
+
indeterminate: boolean;
|
|
25
|
+
/** Erreur fournie par l’application (par exemple après une validation serveur) : affichée tout de suite, sans attendre une interaction. Attribute `error`. */
|
|
26
|
+
error: string;
|
|
27
|
+
/** Langue des textes intégrés (BCP 47) : la mention « obligatoire » (« required ») et le message de validation. Toute balise en vaut en, le reste vaut fr. Un libellé écrit par la page l’emporte. Attribute `locale`. */
|
|
28
|
+
locale: string;
|
|
29
|
+
addEventListener<K extends keyof BythiumCheckboxEventMap>(type: K, listener: (this: BythiumCheckbox, event: BythiumCheckboxEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
30
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
31
|
+
removeEventListener<K extends keyof BythiumCheckboxEventMap>(type: K, listener: (this: BythiumCheckbox, event: BythiumCheckboxEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
32
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'bythium-checkbox': BythiumCheckbox;
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunks/chunk-7YT6MUHG.js";import"./chunks/chunk-5UXAUVTG.js";import"./chunks/chunk-D52FUFUP.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumCheckbox};
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import{a as i,b as s,c as l}from"./chunk-FGJHPGJI.js";import{a as t,d as r,e as a}from"./chunk-W3ASGVKH.js";var d={tone:{type:"string",default:"info",enum:["info","success","danger","warning","neutral","brand","outline","gradient"]},shape:{type:"string",default:"rounded",enum:["rounded","pill","circle"]},size:{type:"string",default:"sm",enum:["sm","md","lg"]},dot:{type:"boolean",default:!1},hint:{type:"string",default:""}},c=`/* Styles de base de toute tranche : repris de src/shared/base.styles.css d'Orchestre, aux r\xE8gles de la convention
|
|
2
|
+
(jetons --bythium-*, propri\xE9t\xE9s logiques, pas de !important, mouvement sous no-preference).
|
|
3
|
+
tools/wc.generate.ts les place devant la feuille de chaque tranche : m\xEAme cascade que l'ancien d\xE9p\xF4t. */
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
min-inline-size: 0;
|
|
7
|
+
max-inline-size: 100%;
|
|
8
|
+
color: var(--bythium-text-primary);
|
|
9
|
+
font-family: var(--font-sans);
|
|
10
|
+
font-size: var(--font-size-base);
|
|
11
|
+
line-height: var(--line-height-base);
|
|
12
|
+
font-feature-settings: var(--font-features, normal);
|
|
13
|
+
letter-spacing: -0.006em;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
}
|
|
16
|
+
:host([hidden]) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
/* D\xE9sactiv\xE9 : couleurs att\xE9nu\xE9es qui gardent 4,5:1 (texte) et 3:1 (contour), jamais d'opacit\xE9 sur l'h\xF4te, qui ferait
|
|
20
|
+
\xE9chouer le contraste du libell\xE9 et des textes voisins (axe, WC-R04). Une tranche peut pr\xE9ciser sa propre r\xE8gle. */
|
|
21
|
+
:host([disabled]) {
|
|
22
|
+
color: var(--bythium-text-muted);
|
|
23
|
+
}
|
|
24
|
+
*,
|
|
25
|
+
*::before,
|
|
26
|
+
*::after {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
button,
|
|
30
|
+
input,
|
|
31
|
+
a,
|
|
32
|
+
select,
|
|
33
|
+
textarea {
|
|
34
|
+
font: inherit;
|
|
35
|
+
color: inherit;
|
|
36
|
+
}
|
|
37
|
+
button,
|
|
38
|
+
a,
|
|
39
|
+
input {
|
|
40
|
+
touch-action: manipulation;
|
|
41
|
+
}
|
|
42
|
+
button {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
button:disabled,
|
|
46
|
+
input:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
button:disabled,
|
|
50
|
+
.control:disabled {
|
|
51
|
+
color: var(--bythium-text-muted);
|
|
52
|
+
}
|
|
53
|
+
/* Profil Linear : un bouton se lit par son fond et son libell\xE9, sa bordure reste d\xE9corative ; un champ garde un contour \xE0 3:1. */
|
|
54
|
+
button {
|
|
55
|
+
min-block-size: var(--control-height);
|
|
56
|
+
padding: 4px 10px;
|
|
57
|
+
border: 1px solid var(--bythium-border-subtle);
|
|
58
|
+
border-radius: var(--radius-control);
|
|
59
|
+
background-color: var(--bythium-surface-raised);
|
|
60
|
+
color: var(--bythium-text-primary);
|
|
61
|
+
font-size: var(--font-size-caption);
|
|
62
|
+
font-weight: var(--font-weight-medium);
|
|
63
|
+
}
|
|
64
|
+
.control {
|
|
65
|
+
min-block-size: var(--control-height);
|
|
66
|
+
padding: 4px 9px;
|
|
67
|
+
border: 1px solid var(--bythium-border-strong);
|
|
68
|
+
border-radius: var(--radius-control);
|
|
69
|
+
background-color: var(--bythium-surface-base);
|
|
70
|
+
color: var(--bythium-text-primary);
|
|
71
|
+
font-size: var(--font-size-base);
|
|
72
|
+
}
|
|
73
|
+
.control:hover:not(:disabled):not(:focus-visible) {
|
|
74
|
+
border-color: var(--bythium-text-muted);
|
|
75
|
+
}
|
|
76
|
+
button:hover:not(:disabled) {
|
|
77
|
+
background: color-mix(in oklch, var(--bythium-text-primary) 8%, var(--bythium-surface-raised));
|
|
78
|
+
}
|
|
79
|
+
button:active:not(:disabled) {
|
|
80
|
+
background: color-mix(in oklch, var(--bythium-text-primary) 12%, var(--bythium-surface-raised));
|
|
81
|
+
}
|
|
82
|
+
a {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: var(--space-2);
|
|
86
|
+
min-block-size: var(--target-touch-min);
|
|
87
|
+
color: var(--bythium-link);
|
|
88
|
+
text-decoration: underline;
|
|
89
|
+
text-underline-offset: 3px;
|
|
90
|
+
}
|
|
91
|
+
:where(button, input, a, select, textarea, [tabindex]):focus-visible {
|
|
92
|
+
outline: var(--focus-ring-width) solid var(--bythium-border-focus);
|
|
93
|
+
outline-offset: 1px;
|
|
94
|
+
}
|
|
95
|
+
input {
|
|
96
|
+
min-inline-size: 0;
|
|
97
|
+
max-inline-size: 100%;
|
|
98
|
+
accent-color: var(--bythium-brand-primary);
|
|
99
|
+
}
|
|
100
|
+
::placeholder {
|
|
101
|
+
color: var(--bythium-text-muted);
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
input[type='range'] {
|
|
105
|
+
min-block-size: var(--target-touch-min);
|
|
106
|
+
}
|
|
107
|
+
input[type='checkbox'],
|
|
108
|
+
input[type='radio'] {
|
|
109
|
+
inline-size: 16px;
|
|
110
|
+
block-size: 16px;
|
|
111
|
+
margin: 0;
|
|
112
|
+
}
|
|
113
|
+
label {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: var(--space-2);
|
|
117
|
+
font-size: var(--font-size-caption);
|
|
118
|
+
}
|
|
119
|
+
.field {
|
|
120
|
+
display: grid;
|
|
121
|
+
gap: var(--space-1-5);
|
|
122
|
+
}
|
|
123
|
+
.row {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-wrap: wrap;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: var(--space-2);
|
|
128
|
+
}
|
|
129
|
+
.sr-only {
|
|
130
|
+
position: absolute;
|
|
131
|
+
inline-size: 1px;
|
|
132
|
+
block-size: 1px;
|
|
133
|
+
padding: 0;
|
|
134
|
+
margin: -1px;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
clip-path: inset(50%);
|
|
137
|
+
white-space: nowrap;
|
|
138
|
+
border: 0;
|
|
139
|
+
}
|
|
140
|
+
/* A field inside a table whose column headers name its controls (bythium-slot-table labels="hidden") keeps its label
|
|
141
|
+
for assistive technologies only: the custom property inherits across the shadow boundaries down to the field. */
|
|
142
|
+
@container style(--bythium-field-labels: hidden) {
|
|
143
|
+
label[part=label][for],
|
|
144
|
+
legend[part=label] {
|
|
145
|
+
position: absolute;
|
|
146
|
+
inline-size: 1px;
|
|
147
|
+
block-size: 1px;
|
|
148
|
+
padding: 0;
|
|
149
|
+
margin: -1px;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
clip-path: inset(50%);
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
border: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
.muted {
|
|
157
|
+
color: var(--bythium-text-muted);
|
|
158
|
+
}
|
|
159
|
+
.error {
|
|
160
|
+
color: var(--bythium-status-danger);
|
|
161
|
+
font-size: var(--font-size-base);
|
|
162
|
+
}
|
|
163
|
+
.primary {
|
|
164
|
+
border-color: var(--bythium-brand-primary);
|
|
165
|
+
background: var(--bythium-brand-primary);
|
|
166
|
+
color: var(--bythium-on-brand-primary);
|
|
167
|
+
box-shadow: inset 0 1px 0 0 color-mix(in oklch, var(--bythium-on-brand-primary) 16%, transparent);
|
|
168
|
+
}
|
|
169
|
+
.primary:hover:not(:disabled) {
|
|
170
|
+
background: var(--bythium-brand-primary-hover);
|
|
171
|
+
color: var(--bythium-on-brand-primary);
|
|
172
|
+
}
|
|
173
|
+
[aria-current],
|
|
174
|
+
[aria-selected='true'],
|
|
175
|
+
[aria-pressed='true'] {
|
|
176
|
+
border-color: var(--bythium-border-subtle);
|
|
177
|
+
background: var(--bythium-state-selected, var(--bythium-surface-raised));
|
|
178
|
+
}
|
|
179
|
+
slot {
|
|
180
|
+
max-inline-size: 100%;
|
|
181
|
+
}
|
|
182
|
+
/* Cible tactile de 44 px sans changer la taille visuelle (WC-R05, WC-D03) : classe \xAB target \xBB sur le contr\xF4le.
|
|
183
|
+
Le pseudo-\xE9l\xE9ment d\xE9borde du contr\xF4le de fa\xE7on sym\xE9trique, donc identique en ltr et en rtl. */
|
|
184
|
+
.target {
|
|
185
|
+
position: relative;
|
|
186
|
+
isolation: isolate;
|
|
187
|
+
}
|
|
188
|
+
/* Sous le contenu du contr\xF4le (z-index -1 dans son propre contexte d'empilement) : il ne masque jamais un enfant. */
|
|
189
|
+
.target::after {
|
|
190
|
+
content: '';
|
|
191
|
+
position: absolute;
|
|
192
|
+
z-index: -1;
|
|
193
|
+
inset-block: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
194
|
+
inset-inline: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
195
|
+
}
|
|
196
|
+
/* Rang\xE9es denses (H-05, WCAG 2.2 AA 2.5.8) : quand des zones de 44 px se chevaucheraient (points de pagination,
|
|
197
|
+
\xE9toiles, \xD7 d'\xE9tiquettes, lignes de cases, onglets serr\xE9s), la classe \xAB target-dense \xBB donne une zone d'au moins
|
|
198
|
+
24 px ; au pointeur grossier, elle revient \xE0 44 px (WC-D03). \xC0 poser \xE0 la place de \xAB target \xBB, sur le contr\xF4le. */
|
|
199
|
+
.target-dense {
|
|
200
|
+
position: relative;
|
|
201
|
+
isolation: isolate;
|
|
202
|
+
}
|
|
203
|
+
.target-dense::after {
|
|
204
|
+
content: '';
|
|
205
|
+
position: absolute;
|
|
206
|
+
z-index: -1;
|
|
207
|
+
inset-block: min(0px, calc((100% - 24px) / 2));
|
|
208
|
+
inset-inline: min(0px, calc((100% - 24px) / 2));
|
|
209
|
+
}
|
|
210
|
+
@media (pointer: coarse) {
|
|
211
|
+
.target-dense::after {
|
|
212
|
+
inset-block: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
213
|
+
inset-inline: min(0px, calc((100% - var(--target-touch-min)) / 2));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/* Transition pos\xE9e \xE0 l'arriv\xE9e du survol seulement : une bascule de th\xE8me ne s'anime pas, l'audit de contraste mesure l'\xE9tat final. */
|
|
217
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
218
|
+
button:hover:not(:disabled),
|
|
219
|
+
.control:hover:not(:disabled) {
|
|
220
|
+
transition:
|
|
221
|
+
background-color var(--duration-fast) var(--ease-standard),
|
|
222
|
+
border-color var(--duration-fast) var(--ease-standard);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
@media (prefers-contrast: more) {
|
|
226
|
+
button,
|
|
227
|
+
.control {
|
|
228
|
+
border-color: currentColor;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
button,
|
|
233
|
+
input,
|
|
234
|
+
a {
|
|
235
|
+
border: 1px solid ButtonText;
|
|
236
|
+
}
|
|
237
|
+
:focus-visible {
|
|
238
|
+
outline-color: Highlight;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/* Densit\xE9 confortable sur les appareils tactiles ; focus explicite, jamais supprim\xE9. */
|
|
242
|
+
@media (pointer: coarse) {
|
|
243
|
+
button,
|
|
244
|
+
.control,
|
|
245
|
+
select {
|
|
246
|
+
min-block-size: var(--target-touch-min);
|
|
247
|
+
}
|
|
248
|
+
input[type='checkbox'],
|
|
249
|
+
input[type='radio'] {
|
|
250
|
+
inline-size: 20px;
|
|
251
|
+
block-size: 20px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/* Hint of a button-like control (core/hint.ts): a compact tooltip in the top layer, centred under the control and
|
|
255
|
+
flipped above it when the window is short of room, so a toolbar or a scrolling list never clips it. */
|
|
256
|
+
[part=base] {
|
|
257
|
+
anchor-name: --bythium-hint;
|
|
258
|
+
}
|
|
259
|
+
[part=hint] {
|
|
260
|
+
position: fixed;
|
|
261
|
+
inset: auto;
|
|
262
|
+
margin: 0;
|
|
263
|
+
inline-size: max-content;
|
|
264
|
+
max-inline-size: min(280px, 80vw);
|
|
265
|
+
padding-block: 4px;
|
|
266
|
+
padding-inline: 8px;
|
|
267
|
+
overflow: visible;
|
|
268
|
+
border: 1px solid var(--bythium-border-subtle);
|
|
269
|
+
border-radius: var(--radius-control);
|
|
270
|
+
background: var(--bythium-surface-overlay);
|
|
271
|
+
color: var(--bythium-text-primary);
|
|
272
|
+
box-shadow: var(--shadow-overlay);
|
|
273
|
+
font-size: 12px;
|
|
274
|
+
font-weight: 400;
|
|
275
|
+
line-height: 1.4;
|
|
276
|
+
text-align: start;
|
|
277
|
+
white-space: normal;
|
|
278
|
+
overflow-wrap: anywhere;
|
|
279
|
+
}
|
|
280
|
+
/* Hover bridge: the pointer crosses the gap to the hint without closing it (WCAG 1.4.13). */
|
|
281
|
+
[part=hint]::before {
|
|
282
|
+
content: "";
|
|
283
|
+
position: absolute;
|
|
284
|
+
inset-inline: 0;
|
|
285
|
+
inset-block: -7px -7px;
|
|
286
|
+
}
|
|
287
|
+
@supports (position-area: block-end) and (position-try-fallbacks: flip-block) {
|
|
288
|
+
[part=hint] {
|
|
289
|
+
position-anchor: --bythium-hint;
|
|
290
|
+
position-area: block-end;
|
|
291
|
+
margin-block-start: 6px;
|
|
292
|
+
position-try-fallbacks: flip-block;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/* Without anchor positioning the hint would float at the top of the window: it stays hidden, the name still speaks. */
|
|
296
|
+
@supports not ((position-area: block-end) and (position-try-fallbacks: flip-block)) {
|
|
297
|
+
[part=hint] {
|
|
298
|
+
display: none;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
@media (forced-colors: active) {
|
|
302
|
+
[part=hint] {
|
|
303
|
+
border-color: CanvasText;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
[part=base] {
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: 4px;
|
|
310
|
+
block-size: 20px;
|
|
311
|
+
padding-block: 0;
|
|
312
|
+
padding-inline: 6px;
|
|
313
|
+
max-inline-size: 100%;
|
|
314
|
+
border-radius: var(--radius-sm);
|
|
315
|
+
background: var(--bythium-surface-raised);
|
|
316
|
+
color: var(--bythium-text-secondary);
|
|
317
|
+
font-size: 12px;
|
|
318
|
+
font-weight: 500;
|
|
319
|
+
line-height: 1;
|
|
320
|
+
white-space: nowrap;
|
|
321
|
+
}
|
|
322
|
+
:host(:not([tone])) [part=base],:host([tone=info]) [part=base] {
|
|
323
|
+
--badge-tone: var(--bythium-status-info);
|
|
324
|
+
}
|
|
325
|
+
:host([tone=success]) [part=base] {
|
|
326
|
+
--badge-tone: var(--bythium-status-success);
|
|
327
|
+
}
|
|
328
|
+
:host([tone=danger]) [part=base] {
|
|
329
|
+
--badge-tone: var(--bythium-status-danger);
|
|
330
|
+
}
|
|
331
|
+
:host([tone=warning]) [part=base] {
|
|
332
|
+
--badge-tone: var(--bythium-status-warning);
|
|
333
|
+
}
|
|
334
|
+
:host([tone=brand]) [part=base] {
|
|
335
|
+
--badge-tone: var(--bythium-brand-primary-text);
|
|
336
|
+
}
|
|
337
|
+
:host(:not([tone])) [part=base],:host([tone=info]) [part=base],:host([tone=success]) [part=base],:host([tone=danger]) [part=base],:host([tone=warning]) [part=base],:host([tone=brand]) [part=base] {
|
|
338
|
+
color: var(--badge-tone);
|
|
339
|
+
background: color-mix(in oklch,var(--badge-tone) 12%,var(--bythium-surface-base));
|
|
340
|
+
}
|
|
341
|
+
:host([tone=outline]) [part=base],:host([shape=circle]) [part=base] {
|
|
342
|
+
box-sizing: border-box;
|
|
343
|
+
}
|
|
344
|
+
:host([tone=outline]) [part=base] {
|
|
345
|
+
border: 1px solid var(--bythium-border-strong);
|
|
346
|
+
background: transparent;
|
|
347
|
+
color: var(--bythium-text-primary);
|
|
348
|
+
}
|
|
349
|
+
/* Brand gradient with dark text: at least 6.5:1 on both ends, in both themes (the gradient does not change with the theme). */
|
|
350
|
+
:host([tone=gradient]) [part=base] {
|
|
351
|
+
background: linear-gradient(100deg,var(--bythium-brand-cyan),var(--bythium-brand-violet));
|
|
352
|
+
color: oklch(0.14 0.02 275);
|
|
353
|
+
font-weight: 650;
|
|
354
|
+
}
|
|
355
|
+
:host([shape=pill]) [part=base] {
|
|
356
|
+
border-radius: var(--radius-full);
|
|
357
|
+
padding-inline: 9px;
|
|
358
|
+
}
|
|
359
|
+
:host([shape=circle]) [part=base] {
|
|
360
|
+
inline-size: 20px;
|
|
361
|
+
justify-content: center;
|
|
362
|
+
padding-inline: 0;
|
|
363
|
+
border-radius: var(--radius-full);
|
|
364
|
+
font-variant-numeric: tabular-nums;
|
|
365
|
+
}
|
|
366
|
+
:host([size=md]) [part=base] {
|
|
367
|
+
block-size: 28px;
|
|
368
|
+
padding-inline: 12px;
|
|
369
|
+
font-size: 13px;
|
|
370
|
+
}
|
|
371
|
+
:host([size=md][shape=circle]) [part=base] {
|
|
372
|
+
inline-size: 28px;
|
|
373
|
+
padding-inline: 0;
|
|
374
|
+
}
|
|
375
|
+
:host([dot]) [part=base]::before {
|
|
376
|
+
content: "";
|
|
377
|
+
flex: none;
|
|
378
|
+
inline-size: 6px;
|
|
379
|
+
block-size: 6px;
|
|
380
|
+
margin-inline-end: 1px;
|
|
381
|
+
border-radius: 50%;
|
|
382
|
+
background: currentcolor;
|
|
383
|
+
}
|
|
384
|
+
/* Large size: the thanks page's check badge (merci.html .badge-ok: 52 px, a 1 px frame at 50 % of the tone, a fill at 14 %,
|
|
385
|
+
a 26 px glyph). A tone without --badge-tone (neutral, outline, gradient) frames with its own text colour. */
|
|
386
|
+
:host([size=lg]) [part=base] {
|
|
387
|
+
box-sizing: border-box;
|
|
388
|
+
block-size: 52px;
|
|
389
|
+
padding-inline: 20px;
|
|
390
|
+
border: 1px solid color-mix(in oklch,var(--badge-tone,currentcolor) 50%,transparent);
|
|
391
|
+
font-size: 22px;
|
|
392
|
+
}
|
|
393
|
+
:host([size=lg]:is(:not([tone]),[tone=info],[tone=success],[tone=danger],[tone=warning],[tone=brand])) [part=base] {
|
|
394
|
+
background: color-mix(in oklch,var(--badge-tone) 14%,transparent);
|
|
395
|
+
}
|
|
396
|
+
:host([size=lg][shape=circle]) [part=base] {
|
|
397
|
+
inline-size: 52px;
|
|
398
|
+
padding-inline: 0;
|
|
399
|
+
}
|
|
400
|
+
:host([size=lg]) ::slotted(*) {
|
|
401
|
+
inline-size: 26px;
|
|
402
|
+
block-size: 26px;
|
|
403
|
+
}
|
|
404
|
+
@media (forced-colors: active) {
|
|
405
|
+
[part=base] {
|
|
406
|
+
border: 1px solid CanvasText;
|
|
407
|
+
}
|
|
408
|
+
:host([tone=gradient]) [part=base] {
|
|
409
|
+
background: Canvas;
|
|
410
|
+
color: CanvasText;
|
|
411
|
+
}
|
|
412
|
+
:host([dot]) [part=base]::before {
|
|
413
|
+
background: CanvasText;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
`;function p(n){let e=i(n.hint);return[t("span",{part:"base",tabindex:e?"0":null,"aria-describedby":s(n.hint)},t("slot")),...e?[e]:[]]}var o=class extends r{static props=d;static css=c;#n;constructor(){super(),this.#n=l(this,this.root)}disconnected(){super.disconnected(),this.#n.close()}view(){return p(this.props)}};a("bythium-badge",o);export{o as a};
|