@sharadox/graphical-user-interface-web-library 0.2.0-layout.15 → 0.2.0-navigation.28

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 (124) hide show
  1. package/README.md +12 -0
  2. package/distribution/code-boxes/index.d.ts +11 -0
  3. package/distribution/code-boxes/index.d.ts.map +1 -0
  4. package/distribution/code-boxes/index.js +64 -0
  5. package/distribution/code-boxes/index.js.map +1 -0
  6. package/distribution/code-boxes/index.module.css +1 -0
  7. package/distribution/code-boxes/index.module.scss +28 -0
  8. package/distribution/code-boxes/type.d.ts +17 -0
  9. package/distribution/code-boxes/type.d.ts.map +1 -0
  10. package/distribution/code-boxes/type.js +2 -0
  11. package/distribution/code-boxes/type.js.map +1 -0
  12. package/distribution/combobox/index.d.ts +18 -0
  13. package/distribution/combobox/index.d.ts.map +1 -0
  14. package/distribution/combobox/index.js +105 -0
  15. package/distribution/combobox/index.js.map +1 -0
  16. package/distribution/combobox/index.module.css +1 -0
  17. package/distribution/combobox/index.module.scss +25 -0
  18. package/distribution/combobox/type.d.ts +8 -0
  19. package/distribution/combobox/type.d.ts.map +1 -0
  20. package/distribution/combobox/type.js +2 -0
  21. package/distribution/combobox/type.js.map +1 -0
  22. package/distribution/copy-button/index.d.ts +10 -0
  23. package/distribution/copy-button/index.d.ts.map +1 -0
  24. package/distribution/copy-button/index.js +26 -0
  25. package/distribution/copy-button/index.js.map +1 -0
  26. package/distribution/copy-button/type.d.ts +11 -0
  27. package/distribution/copy-button/type.d.ts.map +1 -0
  28. package/distribution/copy-button/type.js +2 -0
  29. package/distribution/copy-button/type.js.map +1 -0
  30. package/distribution/dialog/index.d.ts +12 -0
  31. package/distribution/dialog/index.d.ts.map +1 -0
  32. package/distribution/dialog/index.js +56 -0
  33. package/distribution/dialog/index.js.map +1 -0
  34. package/distribution/dialog/index.module.css +1 -0
  35. package/distribution/dialog/index.module.scss +59 -0
  36. package/distribution/dialog/type.d.ts +11 -0
  37. package/distribution/dialog/type.d.ts.map +1 -0
  38. package/distribution/dialog/type.js +2 -0
  39. package/distribution/dialog/type.js.map +1 -0
  40. package/distribution/field/index.d.ts +1 -1
  41. package/distribution/field/index.d.ts.map +1 -1
  42. package/distribution/field/index.js +2 -2
  43. package/distribution/field/index.js.map +1 -1
  44. package/distribution/listbox/index.d.ts +11 -0
  45. package/distribution/listbox/index.d.ts.map +1 -0
  46. package/distribution/listbox/index.js +21 -0
  47. package/distribution/listbox/index.js.map +1 -0
  48. package/distribution/listbox/index.module.css +1 -0
  49. package/distribution/listbox/index.module.scss +38 -0
  50. package/distribution/listbox/type.d.ts +22 -0
  51. package/distribution/listbox/type.d.ts.map +1 -0
  52. package/distribution/listbox/type.js +2 -0
  53. package/distribution/listbox/type.js.map +1 -0
  54. package/distribution/navigation/index.d.ts +13 -0
  55. package/distribution/navigation/index.d.ts.map +1 -0
  56. package/distribution/navigation/index.js +27 -0
  57. package/distribution/navigation/index.js.map +1 -0
  58. package/distribution/navigation/index.module.css +1 -0
  59. package/distribution/navigation/index.module.scss +64 -0
  60. package/distribution/navigation/type.d.ts +24 -0
  61. package/distribution/navigation/type.d.ts.map +1 -0
  62. package/distribution/navigation/type.js +2 -0
  63. package/distribution/navigation/type.js.map +1 -0
  64. package/distribution/notification/index.d.ts +19 -0
  65. package/distribution/notification/index.d.ts.map +1 -0
  66. package/distribution/notification/index.js +48 -0
  67. package/distribution/notification/index.js.map +1 -0
  68. package/distribution/notification/index.module.css +1 -0
  69. package/distribution/notification/index.module.scss +35 -0
  70. package/distribution/notification/type.d.ts +23 -0
  71. package/distribution/notification/type.d.ts.map +1 -0
  72. package/distribution/notification/type.js +2 -0
  73. package/distribution/notification/type.js.map +1 -0
  74. package/distribution/number-field/index.d.ts +10 -0
  75. package/distribution/number-field/index.d.ts.map +1 -0
  76. package/distribution/number-field/index.js +46 -0
  77. package/distribution/number-field/index.js.map +1 -0
  78. package/distribution/number-field/index.module.css +1 -0
  79. package/distribution/number-field/index.module.scss +29 -0
  80. package/distribution/number-field/type.d.ts +29 -0
  81. package/distribution/number-field/type.d.ts.map +1 -0
  82. package/distribution/number-field/type.js +2 -0
  83. package/distribution/number-field/type.js.map +1 -0
  84. package/distribution/select/index.d.ts +13 -0
  85. package/distribution/select/index.d.ts.map +1 -0
  86. package/distribution/select/index.js +102 -0
  87. package/distribution/select/index.js.map +1 -0
  88. package/distribution/select/index.module.css +1 -0
  89. package/distribution/select/index.module.scss +42 -0
  90. package/distribution/select/type.d.ts +25 -0
  91. package/distribution/select/type.d.ts.map +1 -0
  92. package/distribution/select/type.js +2 -0
  93. package/distribution/select/type.js.map +1 -0
  94. package/distribution/skeleton/index.d.ts +11 -0
  95. package/distribution/skeleton/index.d.ts.map +1 -0
  96. package/distribution/skeleton/index.js +20 -0
  97. package/distribution/skeleton/index.js.map +1 -0
  98. package/distribution/skeleton/index.module.css +1 -0
  99. package/distribution/skeleton/index.module.scss +96 -0
  100. package/distribution/skeleton/type.d.ts +16 -0
  101. package/distribution/skeleton/type.d.ts.map +1 -0
  102. package/distribution/skeleton/type.js +2 -0
  103. package/distribution/skeleton/type.js.map +1 -0
  104. package/distribution/skeleton-value/index.d.ts +10 -0
  105. package/distribution/skeleton-value/index.d.ts.map +1 -0
  106. package/distribution/skeleton-value/index.js +15 -0
  107. package/distribution/skeleton-value/index.js.map +1 -0
  108. package/distribution/skeleton-value/index.module.css +1 -0
  109. package/distribution/skeleton-value/index.module.scss +35 -0
  110. package/distribution/skeleton-value/type.d.ts +9 -0
  111. package/distribution/skeleton-value/type.d.ts.map +1 -0
  112. package/distribution/skeleton-value/type.js +2 -0
  113. package/distribution/skeleton-value/type.js.map +1 -0
  114. package/distribution/tip/index.d.ts +10 -0
  115. package/distribution/tip/index.d.ts.map +1 -0
  116. package/distribution/tip/index.js +22 -0
  117. package/distribution/tip/index.js.map +1 -0
  118. package/distribution/tip/index.module.css +1 -0
  119. package/distribution/tip/index.module.scss +24 -0
  120. package/distribution/tip/type.d.ts +7 -0
  121. package/distribution/tip/type.d.ts.map +1 -0
  122. package/distribution/tip/type.js +2 -0
  123. package/distribution/tip/type.js.map +1 -0
  124. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAG/G;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,+BA6BhG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAG/G;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAkChG"}
@@ -5,7 +5,7 @@ import styles from "./index.module.css";
5
5
  /**
6
6
  * A form control with its label above it and its hint and error under it, all linked for assistive technology: the
7
7
  * label names the control, the hint and error describe it, and an error marks it invalid. The control is drawn by
8
- * `children`, which receives the attributes to spread on it.
8
+ * `children`, which receives the attributes to spread on it. The label's id is the control's plus `-label`.
9
9
  *
10
10
  * @example
11
11
  * <Field label="Email" hint="We never share it." error={error}>{(control) => <input {...control} type="email" />}</Field>
@@ -21,6 +21,6 @@ export function Field({ label, hideLabel, hint, error, id, className, children }
21
21
  ...(describedBy && { "aria-describedby": describedBy }),
22
22
  ...(error !== undefined && { "aria-invalid": true }),
23
23
  };
24
- return (_jsxs(Box, { direction: "top-to-bottom", align: "stretch", textAlign: "start", gap: 8, className: className, children: [_jsx("label", { htmlFor: controlId, className: styles.label, ...(hideLabel && { "data-hidden": "" }), children: label }), children(control), hint !== undefined && (_jsx(Box, { as: "p", id: hintId, color: "middleground", justify: "start", textAlign: "start", className: styles.message, children: hint })), error !== undefined && (_jsx(Box, { as: "p", id: errorId, color: "error", justify: "start", textAlign: "start", className: styles.message, children: error }))] }));
24
+ return (_jsxs(Box, { direction: "top-to-bottom", align: "stretch", textAlign: "start", gap: 8, className: className, children: [_jsx("label", { id: `${controlId}-label`, htmlFor: controlId, className: styles.label, ...(hideLabel && { "data-hidden": "" }), children: label }), children(control), hint !== undefined && (_jsx(Box, { as: "p", id: hintId, color: "middleground", justify: "start", textAlign: "start", className: styles.message, children: hint })), error !== undefined && (_jsx(Box, { as: "p", id: errorId, color: "error", justify: "start", textAlign: "start", className: styles.message, children: error }))] }));
25
25
  }
26
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/field/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAmB;IAC/F,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC;IACrB,MAAM,SAAS,GAAG,EAAE,IAAI,IAAI,CAAC;IAC7B,MAAM,MAAM,GAAG,GAAG,SAAS,OAAO,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,SAAS,QAAQ,CAAC;IACrC,MAAM,WAAW,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7G,MAAM,OAAO,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,CAAC,OAAO,YACrG,IAAI,GACD,CACP,EACA,KAAK,KAAK,SAAS,IAAI,CACtB,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAC,SAAS,EAAE,MAAM,CAAC,OAAO,YAC/F,KAAK,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ListboxProperties } from "@sharadox/graphical-user-interface-web-library/listbox/type";
2
+ /**
3
+ * The list a select or a combobox opens, under its field: an outlined glass panel of options, the chosen one with a
4
+ * check, the keyboard's one lit (`aria-activedescendant` points at it, and it scrolls into view). The pointer moves
5
+ * the light; a click chooses. Focus stays on the field.
6
+ *
7
+ * @example
8
+ * <Listbox id={listId} labelledBy={labelId} options={options} chosen={value} active={active} onActive={setActive} onChoose={choose} />
9
+ */
10
+ export declare function Listbox({ id, labelledBy, options, chosen, active, onActive, onChoose, empty }: ListboxProperties): import("react").JSX.Element;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/listbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,+BAuChH"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ import { Icon } from "@sharadox/icon-web-library/icon";
4
+ import { Box } from "@sharadox/graphical-user-interface-web-library/box";
5
+ import styles from "./index.module.css";
6
+ /**
7
+ * The list a select or a combobox opens, under its field: an outlined glass panel of options, the chosen one with a
8
+ * check, the keyboard's one lit (`aria-activedescendant` points at it, and it scrolls into view). The pointer moves
9
+ * the light; a click chooses. Focus stays on the field.
10
+ *
11
+ * @example
12
+ * <Listbox id={listId} labelledBy={labelId} options={options} chosen={value} active={active} onActive={setActive} onChoose={choose} />
13
+ */
14
+ export function Listbox({ id, labelledBy, options, chosen, active, onActive, onChoose, empty }) {
15
+ const list = useRef(null);
16
+ useEffect(() => {
17
+ list.current?.querySelector("[data-active]")?.scrollIntoView?.({ block: "nearest" });
18
+ }, [active]);
19
+ return (_jsxs(Box, { as: "ul", ref: list, id: id, role: "listbox", "aria-labelledby": labelledBy, tabIndex: -1, variant: "outlined", color: "foreground", direction: "top-to-bottom", align: "stretch", padding: 4, className: styles.list, children: [options.length === 0 && empty !== undefined && _jsx("li", { className: styles.empty, children: empty }), options.map((option, index) => (_jsxs("li", { id: `${id}-${index}`, role: "option", "aria-selected": option.value === chosen, ...(index === active && { "data-active": "" }), className: styles.option, onPointerMove: () => onActive(index), onPointerDown: (event) => event.preventDefault(), onClick: () => onChoose(index), children: [option.label, option.value === chosen && _jsx(Icon, { name: "check" })] }, option.value)))] }));
20
+ }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/listbox/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAqB;IAC/G,MAAM,IA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IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,KAX5C,MAAM,CAAC,KAAK,CAYd,CACN,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .list{position:absolute;z-index:20;inset-block-start:calc(100% + var(--scale-4));inset-inline:0;max-block-size:280px;margin:0;overflow-y:auto;list-style:none;background:rgb(var(--background-color-rgb)/85%);scrollbar-width:thin;scrollbar-color:var(--foreground-border-color) rgba(0,0,0,0);overscroll-behavior:contain}:where(.option){display:flex;justify-content:space-between;align-items:center;gap:var(--scale-8);min-block-size:var(--current-minimum-size);padding-inline:var(--current-section-padding);border-radius:var(--corner-radius);cursor:pointer;text-align:start;transition:background-color var(--quick-duration) var(--easing)}:where(.option[data-active]){background:var(--current-transparent-hover-color)}:where(.empty){padding:var(--scale-8);color:var(--middleground-color);text-align:start}
@@ -0,0 +1,38 @@
1
+ // Under its field, above everything after it; a nearly opaque background behind the glass so options read.
2
+ .list {
3
+ position: absolute;
4
+ z-index: 20;
5
+ inset-block-start: calc(100% + var(--scale-4));
6
+ inset-inline: 0;
7
+ max-block-size: 280px;
8
+ margin: 0;
9
+ overflow-y: auto;
10
+ list-style: none;
11
+ background: rgb(var(--background-color-rgb) / 85%);
12
+ scrollbar-width: thin;
13
+ scrollbar-color: var(--foreground-border-color) transparent;
14
+ overscroll-behavior: contain;
15
+ }
16
+
17
+ :where(.option) {
18
+ display: flex;
19
+ justify-content: space-between;
20
+ align-items: center;
21
+ gap: var(--scale-8);
22
+ min-block-size: var(--current-minimum-size);
23
+ padding-inline: var(--current-section-padding);
24
+ border-radius: var(--corner-radius);
25
+ cursor: pointer;
26
+ text-align: start;
27
+ transition: background-color var(--quick-duration) var(--easing);
28
+ }
29
+
30
+ :where(.option[data-active]) {
31
+ background: var(--current-transparent-hover-color);
32
+ }
33
+
34
+ :where(.empty) {
35
+ padding: var(--scale-8);
36
+ color: var(--middleground-color);
37
+ text-align: start;
38
+ }
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ /** One option of a list: what it stores and the words it shows. */
3
+ export interface ListboxOption {
4
+ value: string;
5
+ label: string;
6
+ }
7
+ export interface ListboxProperties {
8
+ /** The list's id; each option's is the list's plus `-<index>`, for `aria-activedescendant`. */
9
+ id: string;
10
+ /** The id of what names the list (its field's label). */
11
+ labelledBy: string;
12
+ options: readonly ListboxOption[];
13
+ /** The chosen option's value, marked selected with a check. */
14
+ chosen: string;
15
+ /** The index of the option the keyboard is on. */
16
+ active: number;
17
+ onActive: (index: number) => void;
18
+ onChoose: (index: number) => void;
19
+ /** Shown when there is no option (nothing matches what was typed). */
20
+ empty?: ReactNode;
21
+ }
22
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/listbox/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sEAAsE;IACtE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/listbox/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { NavigationProperties } from "@sharadox/graphical-user-interface-web-library/navigation/type";
2
+ /**
3
+ * The site's bar, sticky at the top: the brand at its start, the links, and the actions at its end. Below `collapse`
4
+ * pixels wide the links and actions move into a phone menu, opened by a button: it covers the page under the bar,
5
+ * scrolls when it doesn't fit (a phone held sideways), keeps the page behind still, and closes on Escape, on anything
6
+ * tapped in it, and when the screen widens (`@sharadox/menu-web-library`). Links are transparent buttons; the current
7
+ * page's is foreground and marked `aria-current`.
8
+ *
9
+ * @example
10
+ * <Navigation brand={<Button href="/en" variant="inline">Name</Button>} label="Main" links={links} actions={<StyleSwitch … />} menuLabel="Open the menu" closeLabel="Close the menu" />
11
+ */
12
+ export declare function Navigation(properties: NavigationProperties): import("react").JSX.Element;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/navigation/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAC;AAG3G;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,oBAAoB,+BA0E1D"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { classNames } from "@sharadox/web-library/class-name";
5
+ import { useMenu } from "@sharadox/menu-web-library/use-menu";
6
+ import { Box } from "@sharadox/graphical-user-interface-web-library/box";
7
+ import { Button } from "@sharadox/graphical-user-interface-web-library/button";
8
+ import { Wrapper } from "@sharadox/graphical-user-interface-web-library/wrapper";
9
+ import styles from "./index.module.css";
10
+ /**
11
+ * The site's bar, sticky at the top: the brand at its start, the links, and the actions at its end. Below `collapse`
12
+ * pixels wide the links and actions move into a phone menu, opened by a button: it covers the page under the bar,
13
+ * scrolls when it doesn't fit (a phone held sideways), keeps the page behind still, and closes on Escape, on anything
14
+ * tapped in it, and when the screen widens (`@sharadox/menu-web-library`). Links are transparent buttons; the current
15
+ * page's is foreground and marked `aria-current`.
16
+ *
17
+ * @example
18
+ * <Navigation brand={<Button href="/en" variant="inline">Name</Button>} label="Main" links={links} actions={<StyleSwitch … />} menuLabel="Open the menu" closeLabel="Close the menu" />
19
+ */
20
+ export function Navigation(properties) {
21
+ const { brand, label, links, actions, menuLabel, closeLabel, collapse = 960, className } = properties;
22
+ const id = useId();
23
+ const menu = useMenu({ wide: `(min-width: ${collapse}px)`, id });
24
+ const list = (direction) => links.map((link) => (_jsx(Button, { href: link.href, variant: "transparent", color: link.current ? "foreground" : "middleground", size: direction === "top-to-bottom" ? "large" : undefined, "aria-current": link.current ? "page" : undefined, className: direction === "top-to-bottom" ? styles.menuLink : undefined, children: link.label }, link.href)));
25
+ return (_jsxs(_Fragment, { children: [_jsxs(Wrapper, { as: "header", justify: "space-between", gap: 16, "data-collapse": collapse, className: classNames(styles.bar, className), ...menu.closer, children: [_jsx(Box, { justify: "start", className: styles.brand, children: brand }), _jsx(Box, { as: "nav", "aria-label": label, gap: 4, wrap: "wrap", className: styles.wide, children: list("left-to-right") }), actions !== undefined && (_jsx(Box, { gap: 8, wrap: "wrap", justify: "end", className: styles.wide, children: actions })), _jsx(Button, { ...menu.toggle, square: true, variant: "transparent", color: "foreground", icon: menu.open ? "close" : "menu", "aria-label": menu.open ? closeLabel : menuLabel, className: styles.toggle })] }), menu.open && (_jsxs(Box, { as: "nav", id: id, "aria-label": label, "data-lenis-prevent": "", direction: "top-to-bottom", align: "stretch", justify: "start", gap: 24, className: styles.menu, ...menu.closer, children: [_jsx(Box, { direction: "top-to-bottom", align: "stretch", gap: 4, children: list("top-to-bottom") }), actions !== undefined && (_jsx(Box, { "data-menu-actions": "", direction: "top-to-bottom", align: "start", gap: 12, children: actions }))] }))] }));
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @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,SAAS,EAAC,eAAe,EACzB,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,OAAO,EACf,GAAG,EAAE,EAAE,EACP,SAAS,EAAE,MAAM,CAAC,IAAI,KAClB,IAAI,CAAC,MAAM,aAEf,KAAC,GAAG,IAAC,SAAS,EAAC,eAAe,EAAC,KAAK,EAAC,SAAS,EAAC,GAAG,EAAE,CAAC,YAClD,IAAI,CAAC,eAAe,CAAC,GAClB,EACL,OAAO,KAAK,SAAS,IAAI,CACxB,KAAC,GAAG,yBAAmB,EAAE,EAAC,SAAS,EAAC,eAAe,EAAC,KAAK,EAAC,OAAO,EAAC,GAAG,EAAE,EAAE,YACtE,OAAO,GACJ,CACP,IACG,CACP,IACA,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ .bar{position:sticky;z-index:50;inset-block-start:0;min-block-size:var(--bar-height, 64px);padding-block:var(--scale-8);border-block-end:var(--line-thickness) var(--line-style) var(--foreground-border-color);background:rgb(var(--background-color-rgb)/80%);-webkit-backdrop-filter:blur(var(--glass-blur));backdrop-filter:blur(var(--glass-blur))}:where(.brand){flex:none}.menu{position:fixed;z-index:49;inset:var(--bar-height, 64px) 0 0;overflow-y:auto;padding:var(--scale-16) var(--wrapper-padding) var(--scale-32);background:var(--background-color);overscroll-behavior:contain;animation:open var(--duration) var(--easing)}.menuLink{justify-content:start}.toggle{display:none}@media(max-width: 639.98px){.bar[data-collapse="640"] .wide{display:none}.bar[data-collapse="640"] .toggle{display:inline-flex}}@media(max-width: 959.98px){.bar[data-collapse="960"] .wide{display:none}.bar[data-collapse="960"] .toggle{display:inline-flex}}@media(max-width: 1279.98px){.bar[data-collapse="1280"] .wide{display:none}.bar[data-collapse="1280"] .toggle{display:inline-flex}}@keyframes open{from{opacity:0;transform:translateY(calc(-1 * var(--scale-8)))}}@media(prefers-reduced-motion: reduce){.menu{animation:none}}
@@ -0,0 +1,64 @@
1
+ // The bar: sticky, see-through over the page (glass), a line under it. Plain classes, to beat the box's own values.
2
+ .bar {
3
+ position: sticky;
4
+ z-index: 50;
5
+ inset-block-start: 0;
6
+ min-block-size: var(--bar-height, 64px);
7
+ padding-block: var(--scale-8);
8
+ border-block-end: var(--line-thickness) var(--line-style) var(--foreground-border-color);
9
+ background: rgb(var(--background-color-rgb) / 80%);
10
+ -webkit-backdrop-filter: blur(var(--glass-blur));
11
+ backdrop-filter: blur(var(--glass-blur));
12
+ }
13
+
14
+ :where(.brand) {
15
+ flex: none;
16
+ }
17
+
18
+ // The phone menu: under the bar, over the whole page, scrolling when it doesn't fit.
19
+ .menu {
20
+ position: fixed;
21
+ z-index: 49;
22
+ inset: var(--bar-height, 64px) 0 0;
23
+ overflow-y: auto;
24
+ padding: var(--scale-16) var(--wrapper-padding) var(--scale-32);
25
+ background: var(--background-color);
26
+ overscroll-behavior: contain;
27
+ animation: open var(--duration) var(--easing);
28
+ }
29
+
30
+ .menuLink {
31
+ justify-content: start;
32
+ }
33
+
34
+ // Wide: links and actions in the bar, no menu button. Narrow: only the brand and the menu button.
35
+ .toggle {
36
+ display: none;
37
+ }
38
+
39
+ @each $width in 640, 960, 1280 {
40
+ @media (max-width: #{$width - 0.02}px) {
41
+ .bar[data-collapse="#{$width}"] {
42
+ .wide {
43
+ display: none;
44
+ }
45
+
46
+ .toggle {
47
+ display: inline-flex;
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ @keyframes open {
54
+ from {
55
+ opacity: 0;
56
+ transform: translateY(calc(-1 * var(--scale-8)));
57
+ }
58
+ }
59
+
60
+ @media (prefers-reduced-motion: reduce) {
61
+ .menu {
62
+ animation: none;
63
+ }
64
+ }
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ /** A link of the main navigation. */
3
+ export interface NavigationLink {
4
+ href: string;
5
+ label: ReactNode;
6
+ /** The page being shown: marked for assistive technology and drawn in foreground. */
7
+ current?: boolean;
8
+ }
9
+ export interface NavigationProperties {
10
+ /** The name or logo, at the bar's start (a link home). */
11
+ brand: ReactNode;
12
+ /** The navigation's name for assistive technology ("Main"). */
13
+ label: string;
14
+ links: readonly NavigationLink[];
15
+ /** What sits at the bar's end (style switches, a profile picture, a call to action); in the menu on phones. */
16
+ actions?: ReactNode;
17
+ /** The menu button's names, closed and open ("Open the menu", "Close the menu"). */
18
+ menuLabel: string;
19
+ closeLabel: string;
20
+ /** The width below which the links and actions move into the menu: 640, 960 (the default) or 1280. */
21
+ collapse?: 640 | 960 | 1280;
22
+ className?: string;
23
+ }
24
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/navigation/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,KAAK,EAAE,SAAS,CAAC;IACjB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC,+GAA+G;IAC/G,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/navigation/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import type { NotificationContextValue, NotificationProviderProperties } from "@sharadox/graphical-user-interface-web-library/notification/type";
2
+ /**
3
+ * The notifications shown after each action, from anywhere under `NotificationProvider`.
4
+ *
5
+ * @example
6
+ * const { notify } = useNotification();
7
+ * notify("Saved.");
8
+ */
9
+ export declare function useNotification(): NotificationContextValue;
10
+ /**
11
+ * Shows a notification after every action, at the top right just below the site's bar: it goes after a few
12
+ * seconds, or when closed. Each is an outlined glass card in its tone's color (success, information, warn, error).
13
+ * At most four at once, newest last.
14
+ *
15
+ * @example
16
+ * <NotificationProvider label="Notifications" dismissLabel="Dismiss">{children}</NotificationProvider>
17
+ */
18
+ export declare function NotificationProvider({ label, dismissLabel, duration, children, }: NotificationProviderProperties): import("react").JSX.Element;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/notification/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kEAAkE,CAAC;AAM1E;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,wBAAwB,CAE1D;AAgDD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,YAAY,EACZ,QAAe,EACf,QAAQ,GACT,EAAE,8BAA8B,+BA2BhC"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
4
+ import { Icon } from "@sharadox/icon-web-library/icon";
5
+ import { Box } from "@sharadox/graphical-user-interface-web-library/box";
6
+ import { Button } from "@sharadox/graphical-user-interface-web-library/button";
7
+ import styles from "./index.module.css";
8
+ const NotificationContext = createContext({ notify: () => { } });
9
+ const ICONS = { success: "check", information: "bell", warn: "warning", error: "warning" };
10
+ /**
11
+ * The notifications shown after each action, from anywhere under `NotificationProvider`.
12
+ *
13
+ * @example
14
+ * const { notify } = useNotification();
15
+ * notify("Saved.");
16
+ */
17
+ export function useNotification() {
18
+ return useContext(NotificationContext);
19
+ }
20
+ /** One notification: hides itself after `duration` (not while the pointer is on it), or with its close button. */
21
+ function NotificationItem({ notification, duration, dismissLabel, onDismiss, }) {
22
+ const [paused, setPaused] = useState(false);
23
+ useEffect(() => {
24
+ if (paused)
25
+ return;
26
+ const timer = setTimeout(() => onDismiss(notification.id), notification.tone === "error" ? duration * 2 : duration);
27
+ return () => clearTimeout(timer);
28
+ }, [paused, notification, duration, onDismiss]);
29
+ return (_jsxs(Box, { role: notification.tone === "error" ? "alert" : "status", variant: "outlined", color: notification.tone, gap: 8, justify: "start", textAlign: "start", padding: 8, className: styles.notification, onMouseEnter: () => setPaused(true), onMouseLeave: () => setPaused(false), children: [_jsx(Icon, { name: ICONS[notification.tone] }), _jsx("p", { className: styles.message, children: notification.message }), _jsx(Button, { square: true, variant: "transparent", color: "middleground", size: "small", icon: "close", "aria-label": dismissLabel, onClick: () => onDismiss(notification.id) })] }));
30
+ }
31
+ /**
32
+ * Shows a notification after every action, at the top right just below the site's bar: it goes after a few
33
+ * seconds, or when closed. Each is an outlined glass card in its tone's color (success, information, warn, error).
34
+ * At most four at once, newest last.
35
+ *
36
+ * @example
37
+ * <NotificationProvider label="Notifications" dismissLabel="Dismiss">{children}</NotificationProvider>
38
+ */
39
+ export function NotificationProvider({ label, dismissLabel, duration = 5000, children, }) {
40
+ const [notifications, setNotifications] = useState([]);
41
+ const next = useRef(0);
42
+ const dismiss = useCallback((id) => setNotifications((all) => all.filter((item) => item.id !== id)), []);
43
+ const value = useMemo(() => ({
44
+ notify: (message, tone = "success") => setNotifications((all) => [...all, { id: ++next.current, message, tone }].slice(-4)),
45
+ }), []);
46
+ return (_jsxs(NotificationContext.Provider, { value: value, children: [children, _jsx("section", { className: styles.region, "aria-label": label, children: notifications.map((item) => (_jsx(NotificationItem, { notification: item, duration: duration, dismissLabel: dismissLabel, onDismiss: dismiss }, item.id))) })] }));
47
+ }
48
+ //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C,CAAC,EAAU,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE,CACpC,gBAAgB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACvF,CAAC,EACF,EAAE,CACH,CAAC;IACF,OAAO,CACL,MAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,aACvC,QAAQ,EACT,kBAAS,SAAS,EAAE,MAAM,CAAC,MAAM,gBAAc,KAAK,YACjD,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,KAAC,gBAAgB,IAEf,YAAY,EAAE,IAAI,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,OAAO,IAJb,IAAI,CAAC,EAAE,CAKZ,CACH,CAAC,GACM,IACmB,CAChC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ :where(.region){position:fixed;z-index:40;inset-block-start:calc(var(--bar-height, 64px) + var(--scale-8));inset-inline-end:var(--scale-16);display:flex;flex-direction:column;align-items:end;gap:var(--scale-8);inline-size:min(360px,100vw - 2*var(--scale-16));pointer-events:none}.notification{inline-size:100%;background:rgb(var(--background-color-rgb)/85%);pointer-events:auto;animation:enter var(--duration) var(--easing)}:where(.message){flex:1;margin:0;color:var(--foreground-color);font-size:var(--scale-14)}@keyframes enter{from{opacity:0;transform:translateY(calc(-1 * var(--scale-8)))}}
@@ -0,0 +1,35 @@
1
+ // At the top right, just below the site's bar (`--bar-height`, 64 by default), above the page.
2
+ :where(.region) {
3
+ position: fixed;
4
+ z-index: 40;
5
+ inset-block-start: calc(var(--bar-height, 64px) + var(--scale-8));
6
+ inset-inline-end: var(--scale-16);
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: end;
10
+ gap: var(--scale-8);
11
+ inline-size: min(360px, calc(100vw - 2 * var(--scale-16)));
12
+ pointer-events: none;
13
+ }
14
+
15
+ // A nearly opaque background behind the glass, so the message reads over anything.
16
+ .notification {
17
+ inline-size: 100%;
18
+ background: rgb(var(--background-color-rgb) / 85%);
19
+ pointer-events: auto;
20
+ animation: enter var(--duration) var(--easing);
21
+ }
22
+
23
+ :where(.message) {
24
+ flex: 1;
25
+ margin: 0;
26
+ color: var(--foreground-color);
27
+ font-size: var(--scale-14);
28
+ }
29
+
30
+ @keyframes enter {
31
+ from {
32
+ opacity: 0;
33
+ transform: translateY(calc(-1 * var(--scale-8)));
34
+ }
35
+ }
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * A notification after an action, in the interface's color of its tone: `success`, `information` and `warn` are
4
+ * polite, `error` is an alert.
5
+ */
6
+ export interface Notification {
7
+ id: number;
8
+ message: string;
9
+ tone: "success" | "information" | "warn" | "error";
10
+ }
11
+ export interface NotificationContextValue {
12
+ /** Shows a notification for a few seconds (`error`s stay twice as long). */
13
+ notify(message: string, tone?: Notification["tone"]): void;
14
+ }
15
+ export interface NotificationProviderProperties {
16
+ /** The region's name and the close buttons' ("Notifications", "Dismiss"). */
17
+ label: string;
18
+ dismissLabel: string;
19
+ /** How long a notification stays, in milliseconds (5 seconds by default). */
20
+ duration?: number;
21
+ children: ReactNode;
22
+ }
23
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/notification/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;CACpD;AAED,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,8BAA8B;IAC7C,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/notification/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { NumberFieldProperties } from "@sharadox/graphical-user-interface-web-library/number-field/type";
2
+ /**
3
+ * A number field: a number input between a minus and a plus button, each its own section. The buttons add or take
4
+ * away `step` and stop at `min` and `max`; typing sets any number, brought within the limits on leaving the field.
5
+ *
6
+ * @example
7
+ * <NumberField label="Guests" name="guests" defaultValue={2} min={1} max={12} decreaseLabel="Fewer" increaseLabel="More" />
8
+ */
9
+ export declare function NumberField(properties: NumberFieldProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/number-field/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AAM9G;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,qBAAqB,+BAuF5D"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Box } from "@sharadox/graphical-user-interface-web-library/box";
5
+ import { Button } from "@sharadox/graphical-user-interface-web-library/button";
6
+ import { Field } from "@sharadox/graphical-user-interface-web-library/field";
7
+ import styles from "./index.module.css";
8
+ /** How many decimals a step has, so 0.1 + 0.2 shows 0.3. */
9
+ const decimals = (step) => (String(step).split(".")[1] ?? "").length;
10
+ /**
11
+ * A number field: a number input between a minus and a plus button, each its own section. The buttons add or take
12
+ * away `step` and stop at `min` and `max`; typing sets any number, brought within the limits on leaving the field.
13
+ *
14
+ * @example
15
+ * <NumberField label="Guests" name="guests" defaultValue={2} min={1} max={12} decreaseLabel="Fewer" increaseLabel="More" />
16
+ */
17
+ export function NumberField(properties) {
18
+ const { label, hideLabel, hint, error, value, defaultValue, onChange, min, max, step = 1, name, disabled, decreaseLabel, increaseLabel, state, id, className, color, variant = "outlined", ...look } = properties;
19
+ const [own, setOwn] = useState(defaultValue === undefined ? "" : String(defaultValue));
20
+ const text = value === undefined ? own : String(value);
21
+ const number = text === "" ? undefined : Number(text);
22
+ const within = (candidate) => Number(Math.min(max ?? Infinity, Math.max(min ?? -Infinity, candidate)).toFixed(decimals(step)));
23
+ const set = (next) => {
24
+ if (value === undefined)
25
+ setOwn(String(next));
26
+ onChange?.(next);
27
+ };
28
+ // From empty, plus starts one step above the minimum (or zero) and minus at it.
29
+ const by = (direction) => set(within(number === undefined ? (min ?? 0) + Math.max(0, direction) * step : number + direction * step));
30
+ const button = (direction) => (_jsx(Button
31
+ // On a filled field the buttons are filled too, so their icons take the color's text color.
32
+ , {
33
+ // On a filled field the buttons are filled too, so their icons take the color's text color.
34
+ variant: variant === "filled" ? "filled" : "transparent", color: color ?? (error === undefined ? "middleground" : "error"), square: true, icon: direction === 1 ? "plus" : "minus", "aria-label": direction === 1 ? increaseLabel : decreaseLabel, disabled: disabled ||
35
+ (number !== undefined && (direction === 1 ? number >= (max ?? Infinity) : number <= (min ?? -Infinity))), onClick: () => by(direction), className: styles.button }));
36
+ return (_jsx(Field, { label: label, hideLabel: hideLabel, hint: hint, error: error, id: id, className: className, children: (control) => (_jsx(Box, { field: true, variant: variant, color: color ?? (error === undefined ? "middleground" : "error"), state: state ?? (disabled ? "disabled" : "enabled"), prefix: button(-1), suffix: button(1), ...look, children: _jsx("input", { ...control, type: "number", inputMode: "decimal", name: name, min: min, max: max, step: step, value: text, disabled: disabled, onChange: (event) => {
37
+ const typed = event.target.value;
38
+ if (value === undefined)
39
+ setOwn(typed);
40
+ onChange?.(typed === "" ? undefined : Number(typed));
41
+ }, onBlur: () => {
42
+ if (number !== undefined && within(number) !== number)
43
+ set(within(number));
44
+ }, className: styles.input }) })) }));
45
+ }
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/number-field/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,uDAAuD,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,UAAiC;IAC3D,MAAM,EACJ,KAAK,EACL,SAAS,EAC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AAE,KAAK,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,EAChE,KAAK,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EACnD,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAClB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,KACb,IAAI,YAER,mBACM,OAAO,EACX,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;oBACjC,IAAI,KAAK,KAAK,SAAS;wBAAE,MAAM,CAAC,KAAK,CAAC,CAAC;oBACvC,QAAQ,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvD,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;oBACX,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,MAAM;wBAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC7E,CAAC,EACD,SAAS,EAAE,MAAM,CAAC,KAAK,GACvB,GACE,CACP,GACK,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ :where(.input){box-sizing:border-box;inline-size:100%;min-inline-size:0;min-block-size:var(--section-minimum-size);margin:0;padding:0;border:0;outline:0;background:rgba(0,0,0,0);color:inherit;font:inherit;font-variant-numeric:tabular-nums;text-align:center;appearance:textfield}:where(.input)::-webkit-inner-spin-button,:where(.input)::-webkit-outer-spin-button{margin:0;appearance:none}.button{align-self:stretch;border-radius:0}
@@ -0,0 +1,29 @@
1
+ :where(.input) {
2
+ box-sizing: border-box;
3
+ inline-size: 100%;
4
+ min-inline-size: 0;
5
+ min-block-size: var(--section-minimum-size);
6
+ margin: 0;
7
+ padding: 0;
8
+ border: 0;
9
+ outline: 0;
10
+ background: transparent;
11
+ color: inherit;
12
+ font: inherit;
13
+ font-variant-numeric: tabular-nums;
14
+ text-align: center;
15
+ appearance: textfield;
16
+
17
+ // The browser's own arrows go: the minus and plus sections replace them.
18
+ &::-webkit-inner-spin-button,
19
+ &::-webkit-outer-spin-button {
20
+ margin: 0;
21
+ appearance: none;
22
+ }
23
+ }
24
+
25
+ // The buttons fill their sections edge to edge, without corners of their own (a plain class, to beat the box's).
26
+ .button {
27
+ align-self: stretch;
28
+ border-radius: 0;
29
+ }