@bythium/unisson 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +28 -0
  3. package/README.md +145 -2
  4. package/dist/CHANGELOG.md +17 -0
  5. package/dist/button-group.d.ts +29 -0
  6. package/dist/button-group.js +1 -0
  7. package/dist/button.d.ts +37 -0
  8. package/dist/button.js +1 -0
  9. package/dist/chunks/chunk-4GXKKP4T.js +460 -0
  10. package/dist/chunks/chunk-5TUKFRTD.js +376 -0
  11. package/dist/chunks/chunk-5VNPX7DT.js +1 -0
  12. package/dist/chunks/chunk-6TMCYM5S.js +436 -0
  13. package/dist/chunks/chunk-BAYUYXVR.js +1 -0
  14. package/dist/chunks/chunk-FGJHPGJI.js +1 -0
  15. package/dist/chunks/chunk-JOXL2SMV.js +373 -0
  16. package/dist/chunks/chunk-MWNIQCR3.js +298 -0
  17. package/dist/chunks/chunk-MYB6FQX2.js +394 -0
  18. package/dist/chunks/chunk-W3ASGVKH.js +1 -0
  19. package/dist/chunks/chunk-WKXQ2JMZ.js +557 -0
  20. package/dist/confirm-button.d.ts +37 -0
  21. package/dist/confirm-button.js +1 -0
  22. package/dist/copy-button.d.ts +25 -0
  23. package/dist/copy-button.js +1 -0
  24. package/dist/custom-elements.json +1480 -0
  25. package/dist/define.d.ts +8 -0
  26. package/dist/define.js +1 -0
  27. package/dist/icon-button.d.ts +33 -0
  28. package/dist/icon-button.js +1 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.js +1 -0
  31. package/dist/react/attributes.d.ts +10 -0
  32. package/dist/react/attributes.js +25 -0
  33. package/dist/react/button-group.d.ts +27 -0
  34. package/dist/react/button-group.js +7 -0
  35. package/dist/react/button.d.ts +35 -0
  36. package/dist/react/button.js +7 -0
  37. package/dist/react/confirm-button.d.ts +35 -0
  38. package/dist/react/confirm-button.js +7 -0
  39. package/dist/react/copy-button.d.ts +23 -0
  40. package/dist/react/copy-button.js +7 -0
  41. package/dist/react/icon-button.d.ts +31 -0
  42. package/dist/react/icon-button.js +7 -0
  43. package/dist/react/index.d.ts +8 -0
  44. package/dist/react/index.js +9 -0
  45. package/dist/react/runtime.js +11 -0
  46. package/dist/react/split-button.d.ts +31 -0
  47. package/dist/react/split-button.js +7 -0
  48. package/dist/react/toggle-button.d.ts +27 -0
  49. package/dist/react/toggle-button.js +7 -0
  50. package/dist/split-button.d.ts +33 -0
  51. package/dist/split-button.js +1 -0
  52. package/dist/svelte/OButton.svelte +14 -0
  53. package/dist/svelte/OButton.svelte.d.ts +36 -0
  54. package/dist/svelte/OButtonGroup.svelte +14 -0
  55. package/dist/svelte/OButtonGroup.svelte.d.ts +28 -0
  56. package/dist/svelte/OConfirmButton.svelte +14 -0
  57. package/dist/svelte/OConfirmButton.svelte.d.ts +36 -0
  58. package/dist/svelte/OCopyButton.svelte +14 -0
  59. package/dist/svelte/OCopyButton.svelte.d.ts +24 -0
  60. package/dist/svelte/OIconButton.svelte +14 -0
  61. package/dist/svelte/OIconButton.svelte.d.ts +32 -0
  62. package/dist/svelte/OSplitButton.svelte +14 -0
  63. package/dist/svelte/OSplitButton.svelte.d.ts +32 -0
  64. package/dist/svelte/OToggleButton.svelte +14 -0
  65. package/dist/svelte/OToggleButton.svelte.d.ts +28 -0
  66. package/dist/svelte/attributes.d.ts +10 -0
  67. package/dist/svelte/attributes.js +25 -0
  68. package/dist/svelte/index.d.ts +8 -0
  69. package/dist/svelte/index.js +8 -0
  70. package/dist/toggle-button.d.ts +29 -0
  71. package/dist/toggle-button.js +1 -0
  72. package/dist/tokens.css +200 -0
  73. package/dist/vue/attributes.d.ts +10 -0
  74. package/dist/vue/attributes.js +25 -0
  75. package/dist/vue/button-group.d.ts +27 -0
  76. package/dist/vue/button-group.js +6 -0
  77. package/dist/vue/button.d.ts +35 -0
  78. package/dist/vue/button.js +6 -0
  79. package/dist/vue/confirm-button.d.ts +35 -0
  80. package/dist/vue/confirm-button.js +6 -0
  81. package/dist/vue/copy-button.d.ts +23 -0
  82. package/dist/vue/copy-button.js +6 -0
  83. package/dist/vue/icon-button.d.ts +31 -0
  84. package/dist/vue/icon-button.js +6 -0
  85. package/dist/vue/index.d.ts +8 -0
  86. package/dist/vue/index.js +8 -0
  87. package/dist/vue/runtime.js +31 -0
  88. package/dist/vue/split-button.d.ts +31 -0
  89. package/dist/vue/split-button.js +6 -0
  90. package/dist/vue/toggle-button.d.ts +27 -0
  91. package/dist/vue/toggle-button.js +6 -0
  92. package/package.json +199 -4
@@ -0,0 +1,8 @@
1
+ import './button.js';
2
+ import './icon-button.js';
3
+ import './toggle-button.js';
4
+ import './button-group.js';
5
+ import './copy-button.js';
6
+ import './split-button.js';
7
+ import './confirm-button.js';
8
+ export {};
package/dist/define.js ADDED
@@ -0,0 +1 @@
1
+ import"./chunks/chunk-MYB6FQX2.js";import"./chunks/chunk-WKXQ2JMZ.js";import"./chunks/chunk-4GXKKP4T.js";import"./chunks/chunk-JOXL2SMV.js";import"./chunks/chunk-FGJHPGJI.js";import"./chunks/chunk-5TUKFRTD.js";import"./chunks/chunk-MWNIQCR3.js";import"./chunks/chunk-BAYUYXVR.js";import"./chunks/chunk-6TMCYM5S.js";import"./chunks/chunk-5VNPX7DT.js";import"./chunks/chunk-W3ASGVKH.js";
@@ -0,0 +1,33 @@
1
+ // Generated from the contract of bythium-icon-button. Do not edit.
2
+ export interface BythiumIconButtonEventMap extends HTMLElementEventMap {
3
+ /** Émis au clic ou au clavier sur un bouton actif. Rien n’est émis désactivé ou en chargement. */
4
+ 'bythium-action': CustomEvent<{ source: "activation" }>;
5
+ }
6
+
7
+ /** Bouton carré à icône, nommé par label, avec variantes, tailles, chargement, désactivation et état de divulgation facultatif ; infobulle facultative. */
8
+ export declare class BythiumIconButton extends HTMLElement {
9
+ /** Nom accessible du bouton (aria-label) : l’icône n’a pas de texte visible. Attribute `label`. */
10
+ label: string;
11
+ /** Apparence : primary (défaut), secondary, ghost ou danger. Attribute `variant`. */
12
+ variant: 'primary' | 'secondary' | 'ghost' | 'danger';
13
+ /** Côté visuel : 24, 28 ou 36 px. La cible tactile garde 44 px. Attribute `size`. */
14
+ size: 'sm' | 'md' | 'lg';
15
+ /** Action en cours : l’anneau remplace l’icône, le bouton est occupé (aria-busy) et refuse l’activation. Attribute `loading`. */
16
+ loading: boolean;
17
+ /** Refuse l’activation et sort de l’ordre de tabulation. Attribute `disabled`. */
18
+ disabled: boolean;
19
+ /** Divulgation : none (défaut) n’annonce rien ; false annonce replié (aria-expanded=false) ; toute autre valeur, attribut vide compris, annonce déplié. La propriété accepte aussi true et false. Attribute `expanded`. */
20
+ expanded: string;
21
+ /** Infobulle du bouton, montrée au survol et au focus clavier, masquée par Échap ; elle décrit le bouton (aria-describedby). Vide : aucune infobulle. Attribute `hint`. */
22
+ hint: string;
23
+ addEventListener<K extends keyof BythiumIconButtonEventMap>(type: K, listener: (this: BythiumIconButton, event: BythiumIconButtonEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
24
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
25
+ removeEventListener<K extends keyof BythiumIconButtonEventMap>(type: K, listener: (this: BythiumIconButton, event: BythiumIconButtonEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
26
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
27
+ }
28
+
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'bythium-icon-button': BythiumIconButton;
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ import{a}from"./chunks/chunk-4GXKKP4T.js";import"./chunks/chunk-FGJHPGJI.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumIconButton};
@@ -0,0 +1,7 @@
1
+ export { BythiumButton, type BythiumButtonEventMap } from './button.js';
2
+ export { BythiumIconButton, type BythiumIconButtonEventMap } from './icon-button.js';
3
+ export { BythiumToggleButton, type BythiumToggleButtonEventMap } from './toggle-button.js';
4
+ export { BythiumButtonGroup, type BythiumButtonGroupEventMap } from './button-group.js';
5
+ export { BythiumCopyButton, type BythiumCopyButtonEventMap } from './copy-button.js';
6
+ export { BythiumSplitButton, type BythiumSplitButtonEventMap } from './split-button.js';
7
+ export { BythiumConfirmButton, type BythiumConfirmButtonEventMap } from './confirm-button.js';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunks/chunk-MYB6FQX2.js";import{a as t}from"./chunks/chunk-WKXQ2JMZ.js";import{a as o}from"./chunks/chunk-4GXKKP4T.js";import{a as r}from"./chunks/chunk-JOXL2SMV.js";import"./chunks/chunk-FGJHPGJI.js";import{a as m}from"./chunks/chunk-5TUKFRTD.js";import{a as u}from"./chunks/chunk-MWNIQCR3.js";import"./chunks/chunk-BAYUYXVR.js";import{a as B}from"./chunks/chunk-6TMCYM5S.js";import"./chunks/chunk-5VNPX7DT.js";import"./chunks/chunk-W3ASGVKH.js";export{t as BythiumButton,m as BythiumButtonGroup,p as BythiumConfirmButton,u as BythiumCopyButton,o as BythiumIconButton,B as BythiumSplitButton,r as BythiumToggleButton};
@@ -0,0 +1,10 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ export interface WrapperSpec {
3
+ readonly tag: string;
4
+ /** Prop name to [attribute name, attribute type]. */
5
+ readonly attributes: Readonly<Record<string, readonly [string, 'string' | 'boolean' | 'number']>>;
6
+ /** Listener prop to DOM event name. */
7
+ readonly events: Readonly<Record<string, string>>;
8
+ }
9
+ export declare function attributeValue(type: 'string' | 'boolean' | 'number', value: unknown): string | number | true | null | undefined;
10
+ export declare function elementAttributes(spec: WrapperSpec, props: Readonly<Record<string, unknown>>): Record<string, unknown>;
@@ -0,0 +1,25 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ /** One prop value as its attribute value: undefined leaves the attribute out. */
3
+ export function attributeValue(type, value) {
4
+ if (value === undefined || value === null) return undefined;
5
+ if (type === 'boolean') return value === false ? null : true;
6
+ if (type === 'number') return Number(value);
7
+ return String(value);
8
+ }
9
+
10
+ /** The props of a wrapper as the attributes and listeners of its tag. */
11
+ export function elementAttributes(spec, props) {
12
+ const out = {};
13
+ for (const key of Object.keys(props)) {
14
+ const value = props[key];
15
+ const attribute = Object.hasOwn(spec.attributes, key) ? spec.attributes[key] : undefined;
16
+ const event = Object.hasOwn(spec.events, key) ? spec.events[key] : undefined;
17
+ if (attribute) {
18
+ const written = attributeValue(attribute[1], value);
19
+ if (written !== undefined) out[attribute[0]] = written;
20
+ } else if (event) {
21
+ if (typeof value === 'function') out[`on${event}`] = value;
22
+ } else out[key] = value;
23
+ }
24
+ return out;
25
+ }
@@ -0,0 +1,27 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumButtonGroup, BythiumButtonGroupEventMap } from '../button-group.js';
4
+
5
+ export interface OButtonGroupOwnProps {
6
+ /** Nom accessible du groupe (aria-label). À renseigner. Attribute `label`. */
7
+ label?: string;
8
+ /** Liste JSON [{"value","label","disabled"?}]. Absente, vide ou invalide : le slot par défaut est rendu. value vaut label s’il manque ; une entrée sans libellé est ignorée. Attribute `items`. */
9
+ items?: string;
10
+ /** Sens d’accolement : côte à côte (horizontal) ou empilé (vertical). Attribute `orientation`. */
11
+ orientation?: 'horizontal' | 'vertical';
12
+ /** Hauteur visuelle : 24, 30 ou 36 px (44 px au pointeur grossier). Attribute `size`. */
13
+ size?: 'sm' | 'md' | 'lg';
14
+ /** Désactive tout le groupe ; des boutons slottés deviennent inertes. Attribute `disabled`. */
15
+ disabled?: boolean;
16
+ /** Émis au clic ou au clavier sur un bouton actif : value (ou le libellé), libellé et rang. Rien n'est émis pour un bouton ou un groupe désactivé. Event `bythium-action`. */
17
+ onBythiumAction?: (event: BythiumButtonGroupEventMap['bythium-action']) => void;
18
+ }
19
+
20
+ export interface OButtonGroupProps extends OButtonGroupOwnProps, Omit<HTMLAttributes<BythiumButtonGroup>, keyof OButtonGroupOwnProps | 'children'> {
21
+ ref?: Ref<BythiumButtonGroup>;
22
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
23
+ children?: ReactNode;
24
+ }
25
+
26
+ /** Boutons accolés sous un seul contour : groupe nommé d'actions voisines, décrites en JSON ou slottées, sans état sélectionné. Renders `<bythium-button-group>`. */
27
+ export declare function OButtonGroup(props: OButtonGroupProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../button-group.js');
6
+
7
+ export const OButtonGroup = wrapper('OButtonGroup', {"tag":"bythium-button-group","attributes":{"label":["label","string"],"items":["items","string"],"orientation":["orientation","string"],"size":["size","string"],"disabled":["disabled","boolean"]},"events":{"onBythiumAction":"bythium-action"}});
@@ -0,0 +1,35 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumButton, BythiumButtonEventMap } from '../button.js';
4
+
5
+ export interface OButtonOwnProps {
6
+ /** Nom accessible de la variante icône, qui n’a pas de texte visible. Attribute `label`. */
7
+ label?: string;
8
+ /** Apparence : primary (défaut), secondary, ghost, danger, ou icon (carré, nommé par label). Attribute `variant`. */
9
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'icon';
10
+ /** Hauteur visuelle : 24, 30 ou 36 px. La cible tactile garde 44 px. Attribute `size`. */
11
+ size?: 'sm' | 'md' | 'lg';
12
+ /** Action en cours : le bouton est occupé (aria-busy) et refuse l’activation. Attribute `loading`. */
13
+ loading?: boolean;
14
+ /** Refuse l’activation et sort de l’ordre de tabulation. Attribute `disabled`. */
15
+ disabled?: boolean;
16
+ /** Désactivé mais focalisable (aria-disabled) : reste dans l’ordre de tabulation, annoncé désactivé, refuse l’activation (ni bythium-action ni envoi). Pour un bouton qui doit garder le focus après une décision. Attribute `disabled-focusable`. */
17
+ disabledFocusable?: boolean;
18
+ /** Rôle dans un formulaire : button (défaut, aucun effet), submit (envoie le formulaire qui contient la balise) ou reset (le réinitialise). Attribute `type`. */
19
+ type?: 'button' | 'submit' | 'reset';
20
+ /** Langue du libellé de repli (BCP 47), écrit seulement quand la fente par défaut est vide : « Exécuter » en français, « Run » en anglais. Toute balise en vaut en, le reste vaut fr. Un libellé écrit par la page l’emporte. Attribute `locale`. */
21
+ locale?: string;
22
+ /** Infobulle du bouton, montrée au survol et au focus clavier, masquée par Échap ; elle décrit le bouton (aria-describedby). Vide : aucune infobulle. Sans effet sur un bouton natif du slot control. Attribute `hint`. */
23
+ hint?: string;
24
+ /** Émis au clic ou au clavier sur un bouton actif. Rien n’est émis désactivé ou en chargement. Event `bythium-action`. */
25
+ onBythiumAction?: (event: BythiumButtonEventMap['bythium-action']) => void;
26
+ }
27
+
28
+ export interface OButtonProps extends OButtonOwnProps, Omit<HTMLAttributes<BythiumButton>, keyof OButtonOwnProps | 'children'> {
29
+ ref?: Ref<BythiumButton>;
30
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
31
+ children?: ReactNode;
32
+ }
33
+
34
+ /** Bouton natif avec variantes, tailles, chargement, désactivation (focalisable ou non) et rôle de formulaire (submit, reset). Renders `<bythium-button>`. */
35
+ export declare function OButton(props: OButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../button.js');
6
+
7
+ export const OButton = wrapper('OButton', {"tag":"bythium-button","attributes":{"label":["label","string"],"variant":["variant","string"],"size":["size","string"],"loading":["loading","boolean"],"disabled":["disabled","boolean"],"disabledFocusable":["disabled-focusable","boolean"],"type":["type","string"],"locale":["locale","string"],"hint":["hint","string"]},"events":{"onBythiumAction":"bythium-action"}});
@@ -0,0 +1,35 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumConfirmButton, BythiumConfirmButtonEventMap } from '../confirm-button.js';
4
+
5
+ export interface OConfirmButtonOwnProps {
6
+ /** Libellé du déclencheur, repris dans le titre du dialogue : il donne le nom accessible. Valeur par défaut : « Supprimer » (ou « Delete » selon locale). Attribute `label`. */
7
+ label?: string;
8
+ /** Refuse l’ouverture et ferme un dialogue ouvert ; aucune confirmation possible. Attribute `disabled`. */
9
+ disabled?: boolean;
10
+ /** Confirmation par saisie du texte exact (typed) ou par maintien du bouton ou de la touche Espace (hold). Attribute `mode`. */
11
+ mode?: 'typed' | 'hold';
12
+ /** Texte à saisir à l’identique (casse comprise) en mode typed ; vide : confirmation impossible. Attribute `confirmation-text`. */
13
+ confirmationText?: string;
14
+ /** Durée du maintien en millisecondes en mode hold ; 500 au moins (une valeur plus courte vaut 500). Attribute `hold-duration`. */
15
+ holdDuration?: number;
16
+ /** Texte d’explication du dialogue, relié par aria-describedby. Valeur par défaut : « Cette action nécessite une confirmation explicite. » (ou « This action needs an explicit confirmation. » selon locale). Attribute `description`. */
17
+ description?: string;
18
+ /** Niveau du titre du dialogue (h1 à h6), fixé par la page (WC-N03). Attribute `heading-level`. */
19
+ headingLevel?: number;
20
+ /** Langue des textes intégrés (BCP 47) : titre, consigne de saisie ou de maintien, boutons, progression, et libellé ou explication par défaut. Toute balise en vaut en, le reste vaut fr. Un texte que la page écrit, quand l’attribut existe, l’emporte. Attribute `locale`. */
21
+ locale?: string;
22
+ /** Émis quand la confirmation aboutit (texte exact puis Confirmer, ou maintien complet). La balise n’exécute jamais l’action : la page s’en charge. Event `bythium-confirm`. */
23
+ onBythiumConfirm?: (event: BythiumConfirmButtonEventMap['bythium-confirm']) => void;
24
+ /** Émis quand l’utilisateur ferme le dialogue sans confirmer (Annuler, Échap). Event `bythium-cancel`. */
25
+ onBythiumCancel?: (event: BythiumConfirmButtonEventMap['bythium-cancel']) => void;
26
+ }
27
+
28
+ export interface OConfirmButtonProps extends OConfirmButtonOwnProps, Omit<HTMLAttributes<BythiumConfirmButton>, keyof OConfirmButtonOwnProps | 'children'> {
29
+ ref?: Ref<BythiumConfirmButton>;
30
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
31
+ children?: ReactNode;
32
+ }
33
+
34
+ /** Action destructive à double confirmation (texte exact ou maintien au clavier et au pointeur), annulable, focus rendu au déclencheur. Renders `<bythium-confirm-button>`. */
35
+ export declare function OConfirmButton(props: OConfirmButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../confirm-button.js');
6
+
7
+ export const OConfirmButton = wrapper('OConfirmButton', {"tag":"bythium-confirm-button","attributes":{"label":["label","string"],"disabled":["disabled","boolean"],"mode":["mode","string"],"confirmationText":["confirmation-text","string"],"holdDuration":["hold-duration","number"],"description":["description","string"],"headingLevel":["heading-level","number"],"locale":["locale","string"]},"events":{"onBythiumConfirm":"bythium-confirm","onBythiumCancel":"bythium-cancel"}});
@@ -0,0 +1,23 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumCopyButton, BythiumCopyButtonEventMap } from '../copy-button.js';
4
+
5
+ export interface OCopyButtonOwnProps {
6
+ /** Langue du texte par défaut et du message de copie (BCP 47) : toute balise en vaut en, le reste vaut fr. Attribute `locale`. */
7
+ locale?: string;
8
+ /** Texte copié dans le presse-papiers ; vide par défaut. Attribute `value`. */
9
+ value?: string;
10
+ /** Refuse la copie et sort de l’ordre de tabulation. Attribute `disabled`. */
11
+ disabled?: boolean;
12
+ /** Émis après chaque tentative de copie : success vaut false quand le presse-papiers est indisponible ou refusé. Event `bythium-copy`. */
13
+ onBythiumCopy?: (event: BythiumCopyButtonEventMap['bythium-copy']) => void;
14
+ }
15
+
16
+ export interface OCopyButtonProps extends OCopyButtonOwnProps, Omit<HTMLAttributes<BythiumCopyButton>, keyof OCopyButtonOwnProps | 'children'> {
17
+ ref?: Ref<BythiumCopyButton>;
18
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
19
+ children?: ReactNode;
20
+ }
21
+
22
+ /** Bouton qui copie une valeur dans le presse-papiers et confirme le résultat pendant deux secondes, annoncé par une région d’état. Renders `<bythium-copy-button>`. */
23
+ export declare function OCopyButton(props: OCopyButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../copy-button.js');
6
+
7
+ export const OCopyButton = wrapper('OCopyButton', {"tag":"bythium-copy-button","attributes":{"locale":["locale","string"],"value":["value","string"],"disabled":["disabled","boolean"]},"events":{"onBythiumCopy":"bythium-copy"}});
@@ -0,0 +1,31 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumIconButton, BythiumIconButtonEventMap } from '../icon-button.js';
4
+
5
+ export interface OIconButtonOwnProps {
6
+ /** Nom accessible du bouton (aria-label) : l’icône n’a pas de texte visible. Attribute `label`. */
7
+ label?: string;
8
+ /** Apparence : primary (défaut), secondary, ghost ou danger. Attribute `variant`. */
9
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
10
+ /** Côté visuel : 24, 28 ou 36 px. La cible tactile garde 44 px. Attribute `size`. */
11
+ size?: 'sm' | 'md' | 'lg';
12
+ /** Action en cours : l’anneau remplace l’icône, le bouton est occupé (aria-busy) et refuse l’activation. Attribute `loading`. */
13
+ loading?: boolean;
14
+ /** Refuse l’activation et sort de l’ordre de tabulation. Attribute `disabled`. */
15
+ disabled?: boolean;
16
+ /** Divulgation : none (défaut) n’annonce rien ; false annonce replié (aria-expanded=false) ; toute autre valeur, attribut vide compris, annonce déplié. La propriété accepte aussi true et false. Attribute `expanded`. */
17
+ expanded?: string;
18
+ /** Infobulle du bouton, montrée au survol et au focus clavier, masquée par Échap ; elle décrit le bouton (aria-describedby). Vide : aucune infobulle. Attribute `hint`. */
19
+ hint?: string;
20
+ /** Émis au clic ou au clavier sur un bouton actif. Rien n’est émis désactivé ou en chargement. Event `bythium-action`. */
21
+ onBythiumAction?: (event: BythiumIconButtonEventMap['bythium-action']) => void;
22
+ }
23
+
24
+ export interface OIconButtonProps extends OIconButtonOwnProps, Omit<HTMLAttributes<BythiumIconButton>, keyof OIconButtonOwnProps | 'children'> {
25
+ ref?: Ref<BythiumIconButton>;
26
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
27
+ children?: ReactNode;
28
+ }
29
+
30
+ /** Bouton carré à icône, nommé par label, avec variantes, tailles, chargement, désactivation et état de divulgation facultatif ; infobulle facultative. Renders `<bythium-icon-button>`. */
31
+ export declare function OIconButton(props: OIconButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../icon-button.js');
6
+
7
+ export const OIconButton = wrapper('OIconButton', {"tag":"bythium-icon-button","attributes":{"label":["label","string"],"variant":["variant","string"],"size":["size","string"],"loading":["loading","boolean"],"disabled":["disabled","boolean"],"expanded":["expanded","string"],"hint":["hint","string"]},"events":{"onBythiumAction":"bythium-action"}});
@@ -0,0 +1,8 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ export { OButton, type OButtonProps, type OButtonOwnProps } from './button.js';
3
+ export { OIconButton, type OIconButtonProps, type OIconButtonOwnProps } from './icon-button.js';
4
+ export { OToggleButton, type OToggleButtonProps, type OToggleButtonOwnProps } from './toggle-button.js';
5
+ export { OButtonGroup, type OButtonGroupProps, type OButtonGroupOwnProps } from './button-group.js';
6
+ export { OCopyButton, type OCopyButtonProps, type OCopyButtonOwnProps } from './copy-button.js';
7
+ export { OSplitButton, type OSplitButtonProps, type OSplitButtonOwnProps } from './split-button.js';
8
+ export { OConfirmButton, type OConfirmButtonProps, type OConfirmButtonOwnProps } from './confirm-button.js';
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ export { OButton } from './button.js';
4
+ export { OIconButton } from './icon-button.js';
5
+ export { OToggleButton } from './toggle-button.js';
6
+ export { OButtonGroup } from './button-group.js';
7
+ export { OCopyButton } from './copy-button.js';
8
+ export { OSplitButton } from './split-button.js';
9
+ export { OConfirmButton } from './confirm-button.js';
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { createElement } from 'react';
4
+ import { elementAttributes } from './attributes.js';
5
+
6
+ /** A function component that renders the spec's tag with its props as attributes and its listeners as events. */
7
+ export function wrapper(name, spec) {
8
+ const Wrapper = (props) => createElement(spec.tag, elementAttributes(spec, props));
9
+ Wrapper.displayName = name;
10
+ return Wrapper;
11
+ }
@@ -0,0 +1,31 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumSplitButton, BythiumSplitButtonEventMap } from '../split-button.js';
4
+
5
+ export interface OSplitButtonOwnProps {
6
+ /** Libellé visible de l’action principale ; il nomme aussi le chevron. Défaut générique « Action » : le libellé réel vient de la page. Attribute `label`. */
7
+ label?: string;
8
+ /** Apparence : primary (aplat de marque, défaut) ou secondary (fond relevé). Toute autre valeur vaut primary. Attribute `variant`. */
9
+ variant?: 'primary' | 'secondary';
10
+ /** Liste JSON des variantes : [{"value","label","disabled"?}]. Vide (défaut) ou invalide : bouton simple, sans chevron. value vaut label s’il manque ; une entrée sans libellé est ignorée. Attribute `items`. */
11
+ items?: string;
12
+ /** Menu ouvert ; réfléchi. Sans effet quand la balise est désactivée ou sans variante. Attribute `open`. */
13
+ open?: boolean;
14
+ /** Désactive les deux boutons et empêche l’ouverture du menu. Attribute `disabled`. */
15
+ disabled?: boolean;
16
+ /** Nom du menu et début du nom du chevron (« Autres actions : Action »). Attribute `menu-label`. */
17
+ menuLabel?: string;
18
+ /** Émis au clic ou au clavier sur l’action principale active. Rien n’est émis quand la balise est désactivée. Event `bythium-action`. */
19
+ onBythiumAction?: (event: BythiumSplitButtonEventMap['bythium-action']) => void;
20
+ /** Émis au choix d’une variante active du menu (clic, Entrée ou Espace) ; le menu se ferme et le focus revient au chevron. index : rang dans items, à partir de 0. Event `bythium-select`. */
21
+ onBythiumSelect?: (event: BythiumSplitButtonEventMap['bythium-select']) => void;
22
+ }
23
+
24
+ export interface OSplitButtonProps extends OSplitButtonOwnProps, Omit<HTMLAttributes<BythiumSplitButton>, keyof OSplitButtonOwnProps | 'children'> {
25
+ ref?: Ref<BythiumSplitButton>;
26
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
27
+ children?: ReactNode;
28
+ }
29
+
30
+ /** Bouton fractionné : action principale et chevron accolé qui ouvre un menu de variantes de la même action, en superposition. Renders `<bythium-split-button>`. */
31
+ export declare function OSplitButton(props: OSplitButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../split-button.js');
6
+
7
+ export const OSplitButton = wrapper('OSplitButton', {"tag":"bythium-split-button","attributes":{"label":["label","string"],"variant":["variant","string"],"items":["items","string"],"open":["open","boolean"],"disabled":["disabled","boolean"],"menuLabel":["menu-label","string"]},"events":{"onBythiumAction":"bythium-action","onBythiumSelect":"bythium-select"}});
@@ -0,0 +1,27 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from 'react';
3
+ import type { BythiumToggleButton, BythiumToggleButtonEventMap } from '../toggle-button.js';
4
+
5
+ export interface OToggleButtonOwnProps {
6
+ /** État enfoncé, reflété par aria-pressed sur le bouton interne ; une écriture par la page n’émet rien. Attribute `pressed`. */
7
+ pressed?: boolean;
8
+ /** Refuse l’activation et sort de l’ordre de tabulation ; le texte reste lisible (atténué), sans opacité globale. Attribute `disabled`. */
9
+ disabled?: boolean;
10
+ /** Désactivé mais focalisable (aria-disabled) : reste dans l’ordre de tabulation, annoncé désactivé, refuse l’activation (rien n’est émis) ; l’infobulle peut dire pourquoi. Attribute `disabled-focusable`. */
11
+ disabledFocusable?: boolean;
12
+ /** Nom accessible (aria-label) quand le texte visible est une abréviation ou une icône (FR, EN, un pictogramme) ; vide : le texte du slot nomme le bouton. Attribute `label`. */
13
+ label?: string;
14
+ /** Infobulle du bouton, montrée au survol et au focus clavier, masquée par Échap ; elle décrit le bouton (aria-describedby). Vide : aucune infobulle. Attribute `hint`. */
15
+ hint?: string;
16
+ /** Émis après chaque activation par l’utilisateur (clic, Entrée, Espace), avec le nouvel état. Rien n’est émis désactivé. Event `bythium-toggle`. */
17
+ onBythiumToggle?: (event: BythiumToggleButtonEventMap['bythium-toggle']) => void;
18
+ }
19
+
20
+ export interface OToggleButtonProps extends OToggleButtonOwnProps, Omit<HTMLAttributes<BythiumToggleButton>, keyof OToggleButtonOwnProps | 'children'> {
21
+ ref?: Ref<BythiumToggleButton>;
22
+ /** Default slot; a child with `slot="<name>"` fills a named slot. */
23
+ children?: ReactNode;
24
+ }
25
+
26
+ /** Bouton bascule natif à deux états (aria-pressed) : chaque activation inverse pressed et émet bythium-toggle ; nom et infobulle facultatifs. Renders `<bythium-toggle-button>`. */
27
+ export declare function OToggleButton(props: OToggleButtonProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
3
+ import { wrapper } from './runtime.js';
4
+
5
+ if (typeof customElements !== 'undefined') import('../toggle-button.js');
6
+
7
+ export const OToggleButton = wrapper('OToggleButton', {"tag":"bythium-toggle-button","attributes":{"pressed":["pressed","boolean"],"disabled":["disabled","boolean"],"disabledFocusable":["disabled-focusable","boolean"],"label":["label","string"],"hint":["hint","string"]},"events":{"onBythiumToggle":"bythium-toggle"}});
@@ -0,0 +1,33 @@
1
+ // Generated from the contract of bythium-split-button. Do not edit.
2
+ export interface BythiumSplitButtonEventMap extends HTMLElementEventMap {
3
+ /** Émis au clic ou au clavier sur l’action principale active. Rien n’est émis quand la balise est désactivée. */
4
+ 'bythium-action': CustomEvent<{ source: "main" }>;
5
+ /** Émis au choix d’une variante active du menu (clic, Entrée ou Espace) ; le menu se ferme et le focus revient au chevron. index : rang dans items, à partir de 0. */
6
+ 'bythium-select': CustomEvent<{ value: string; label: string; index: number }>;
7
+ }
8
+
9
+ /** Bouton fractionné : action principale et chevron accolé qui ouvre un menu de variantes de la même action, en superposition. */
10
+ export declare class BythiumSplitButton extends HTMLElement {
11
+ /** Libellé visible de l’action principale ; il nomme aussi le chevron. Défaut générique « Action » : le libellé réel vient de la page. Attribute `label`. */
12
+ label: string;
13
+ /** Apparence : primary (aplat de marque, défaut) ou secondary (fond relevé). Toute autre valeur vaut primary. Attribute `variant`. */
14
+ variant: 'primary' | 'secondary';
15
+ /** Liste JSON des variantes : [{"value","label","disabled"?}]. Vide (défaut) ou invalide : bouton simple, sans chevron. value vaut label s’il manque ; une entrée sans libellé est ignorée. Attribute `items`. */
16
+ items: string;
17
+ /** Menu ouvert ; réfléchi. Sans effet quand la balise est désactivée ou sans variante. Attribute `open`. */
18
+ open: boolean;
19
+ /** Désactive les deux boutons et empêche l’ouverture du menu. Attribute `disabled`. */
20
+ disabled: boolean;
21
+ /** Nom du menu et début du nom du chevron (« Autres actions : Action »). Attribute `menu-label`. */
22
+ menuLabel: string;
23
+ addEventListener<K extends keyof BythiumSplitButtonEventMap>(type: K, listener: (this: BythiumSplitButton, event: BythiumSplitButtonEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
24
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
25
+ removeEventListener<K extends keyof BythiumSplitButtonEventMap>(type: K, listener: (this: BythiumSplitButton, event: BythiumSplitButtonEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
26
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
27
+ }
28
+
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'bythium-split-button': BythiumSplitButton;
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ import{a}from"./chunks/chunk-6TMCYM5S.js";import"./chunks/chunk-5VNPX7DT.js";import"./chunks/chunk-W3ASGVKH.js";export{a as BythiumSplitButton};
@@ -0,0 +1,14 @@
1
+ <!-- Generated from the contract of bythium-button (packages/unisson/available.json). Do not edit. -->
2
+ <script module>
3
+ if (typeof customElements !== 'undefined') import('../button.js');
4
+ </script>
5
+
6
+ <script>
7
+ import { elementAttributes } from './attributes.js';
8
+
9
+ const spec = {"tag":"bythium-button","attributes":{"label":["label","string"],"variant":["variant","string"],"size":["size","string"],"loading":["loading","boolean"],"disabled":["disabled","boolean"],"disabledFocusable":["disabled-focusable","boolean"],"type":["type","string"],"locale":["locale","string"],"hint":["hint","string"]},"events":{}};
10
+ // Every prop the parent passes, without Svelte's own keys ($$slots, $$scope, children).
11
+ $: attributes = elementAttributes(spec, Object.fromEntries(Object.entries($$props).filter(([key]) => !key.startsWith('$$') && key !== 'children')));
12
+ </script>
13
+
14
+ <bythium-button {...attributes}><slot /><slot name="control" /></bythium-button>
@@ -0,0 +1,36 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { Component, Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import type { BythiumButton, BythiumButtonEventMap } from '../button.js';
5
+
6
+ export interface OButtonOwnProps {
7
+ /** Nom accessible de la variante icône, qui n’a pas de texte visible. Attribute `label`. */
8
+ label?: string;
9
+ /** Apparence : primary (défaut), secondary, ghost, danger, ou icon (carré, nommé par label). Attribute `variant`. */
10
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'icon';
11
+ /** Hauteur visuelle : 24, 30 ou 36 px. La cible tactile garde 44 px. Attribute `size`. */
12
+ size?: 'sm' | 'md' | 'lg';
13
+ /** Action en cours : le bouton est occupé (aria-busy) et refuse l’activation. Attribute `loading`. */
14
+ loading?: boolean;
15
+ /** Refuse l’activation et sort de l’ordre de tabulation. Attribute `disabled`. */
16
+ disabled?: boolean;
17
+ /** Désactivé mais focalisable (aria-disabled) : reste dans l’ordre de tabulation, annoncé désactivé, refuse l’activation (ni bythium-action ni envoi). Pour un bouton qui doit garder le focus après une décision. Attribute `disabled-focusable`. */
18
+ disabledFocusable?: boolean;
19
+ /** Rôle dans un formulaire : button (défaut, aucun effet), submit (envoie le formulaire qui contient la balise) ou reset (le réinitialise). Attribute `type`. */
20
+ type?: 'button' | 'submit' | 'reset';
21
+ /** Langue du libellé de repli (BCP 47), écrit seulement quand la fente par défaut est vide : « Exécuter » en français, « Run » en anglais. Toute balise en vaut en, le reste vaut fr. Un libellé écrit par la page l’emporte. Attribute `locale`. */
22
+ locale?: string;
23
+ /** Infobulle du bouton, montrée au survol et au focus clavier, masquée par Échap ; elle décrit le bouton (aria-describedby). Vide : aucune infobulle. Sans effet sur un bouton natif du slot control. Attribute `hint`. */
24
+ hint?: string;
25
+ /** Émis au clic ou au clavier sur un bouton actif. Rien n’est émis désactivé ou en chargement. Event `bythium-action`. */
26
+ 'onbythium-action'?: (event: BythiumButtonEventMap['bythium-action']) => void;
27
+ }
28
+
29
+ export interface OButtonProps extends OButtonOwnProps, Omit<HTMLAttributes<BythiumButton>, keyof OButtonOwnProps | 'children'> {
30
+ /** Default slot; an element with `slot="<name>"` fills a named slot. */
31
+ children?: Snippet;
32
+ }
33
+
34
+ /** Bouton natif avec variantes, tailles, chargement, désactivation (focalisable ou non) et rôle de formulaire (submit, reset). Renders `<bythium-button>`. */
35
+ declare const OButton: Component<OButtonProps>;
36
+ export default OButton;
@@ -0,0 +1,14 @@
1
+ <!-- Generated from the contract of bythium-button-group (packages/unisson/available.json). Do not edit. -->
2
+ <script module>
3
+ if (typeof customElements !== 'undefined') import('../button-group.js');
4
+ </script>
5
+
6
+ <script>
7
+ import { elementAttributes } from './attributes.js';
8
+
9
+ const spec = {"tag":"bythium-button-group","attributes":{"label":["label","string"],"items":["items","string"],"orientation":["orientation","string"],"size":["size","string"],"disabled":["disabled","boolean"]},"events":{}};
10
+ // Every prop the parent passes, without Svelte's own keys ($$slots, $$scope, children).
11
+ $: attributes = elementAttributes(spec, Object.fromEntries(Object.entries($$props).filter(([key]) => !key.startsWith('$$') && key !== 'children')));
12
+ </script>
13
+
14
+ <bythium-button-group {...attributes}><slot /></bythium-button-group>
@@ -0,0 +1,28 @@
1
+ // Generated from the contracts of the available tags (packages/unisson/available.json). Do not edit.
2
+ import type { Component, Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import type { BythiumButtonGroup, BythiumButtonGroupEventMap } from '../button-group.js';
5
+
6
+ export interface OButtonGroupOwnProps {
7
+ /** Nom accessible du groupe (aria-label). À renseigner. Attribute `label`. */
8
+ label?: string;
9
+ /** Liste JSON [{"value","label","disabled"?}]. Absente, vide ou invalide : le slot par défaut est rendu. value vaut label s’il manque ; une entrée sans libellé est ignorée. Attribute `items`. */
10
+ items?: string;
11
+ /** Sens d’accolement : côte à côte (horizontal) ou empilé (vertical). Attribute `orientation`. */
12
+ orientation?: 'horizontal' | 'vertical';
13
+ /** Hauteur visuelle : 24, 30 ou 36 px (44 px au pointeur grossier). Attribute `size`. */
14
+ size?: 'sm' | 'md' | 'lg';
15
+ /** Désactive tout le groupe ; des boutons slottés deviennent inertes. Attribute `disabled`. */
16
+ disabled?: boolean;
17
+ /** Émis au clic ou au clavier sur un bouton actif : value (ou le libellé), libellé et rang. Rien n'est émis pour un bouton ou un groupe désactivé. Event `bythium-action`. */
18
+ 'onbythium-action'?: (event: BythiumButtonGroupEventMap['bythium-action']) => void;
19
+ }
20
+
21
+ export interface OButtonGroupProps extends OButtonGroupOwnProps, Omit<HTMLAttributes<BythiumButtonGroup>, keyof OButtonGroupOwnProps | 'children'> {
22
+ /** Default slot; an element with `slot="<name>"` fills a named slot. */
23
+ children?: Snippet;
24
+ }
25
+
26
+ /** Boutons accolés sous un seul contour : groupe nommé d'actions voisines, décrites en JSON ou slottées, sans état sélectionné. Renders `<bythium-button-group>`. */
27
+ declare const OButtonGroup: Component<OButtonGroupProps>;
28
+ export default OButtonGroup;
@@ -0,0 +1,14 @@
1
+ <!-- Generated from the contract of bythium-confirm-button (packages/unisson/available.json). Do not edit. -->
2
+ <script module>
3
+ if (typeof customElements !== 'undefined') import('../confirm-button.js');
4
+ </script>
5
+
6
+ <script>
7
+ import { elementAttributes } from './attributes.js';
8
+
9
+ const spec = {"tag":"bythium-confirm-button","attributes":{"label":["label","string"],"disabled":["disabled","boolean"],"mode":["mode","string"],"confirmationText":["confirmation-text","string"],"holdDuration":["hold-duration","number"],"description":["description","string"],"headingLevel":["heading-level","number"],"locale":["locale","string"]},"events":{}};
10
+ // Every prop the parent passes, without Svelte's own keys ($$slots, $$scope, children).
11
+ $: attributes = elementAttributes(spec, Object.fromEntries(Object.entries($$props).filter(([key]) => !key.startsWith('$$') && key !== 'children')));
12
+ </script>
13
+
14
+ <bythium-confirm-button {...attributes}><slot /></bythium-confirm-button>