@sereno-ds/ui 0.24.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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -0
  3. package/dist/_internal/CharCount.d.ts +9 -0
  4. package/dist/_internal/CharCount.js +25 -0
  5. package/dist/_internal/CharCount.js.map +1 -0
  6. package/dist/_internal/Field.d.ts +17 -0
  7. package/dist/_internal/Field.js +55 -0
  8. package/dist/_internal/Field.js.map +1 -0
  9. package/dist/_internal/mask.d.ts +12 -0
  10. package/dist/_internal/mask.js +56 -0
  11. package/dist/_internal/mask.js.map +1 -0
  12. package/dist/_internal/style.d.ts +12 -0
  13. package/dist/_internal/style.js +5 -0
  14. package/dist/_internal/style.js.map +1 -0
  15. package/dist/core/Avatar.d.ts +14 -0
  16. package/dist/core/Avatar.js +62 -0
  17. package/dist/core/Avatar.js.map +1 -0
  18. package/dist/core/Badge.d.ts +16 -0
  19. package/dist/core/Badge.js +49 -0
  20. package/dist/core/Badge.js.map +1 -0
  21. package/dist/core/Brand.d.ts +18 -0
  22. package/dist/core/Brand.js +58 -0
  23. package/dist/core/Brand.js.map +1 -0
  24. package/dist/core/Button.d.ts +31 -0
  25. package/dist/core/Button.js +100 -0
  26. package/dist/core/Button.js.map +1 -0
  27. package/dist/core/Card.d.ts +15 -0
  28. package/dist/core/Card.js +34 -0
  29. package/dist/core/Card.js.map +1 -0
  30. package/dist/core/IconButton.d.ts +18 -0
  31. package/dist/core/IconButton.js +64 -0
  32. package/dist/core/IconButton.js.map +1 -0
  33. package/dist/core/Menu.d.ts +69 -0
  34. package/dist/core/Menu.js +278 -0
  35. package/dist/core/Menu.js.map +1 -0
  36. package/dist/core/Table.d.ts +92 -0
  37. package/dist/core/Table.js +162 -0
  38. package/dist/core/Table.js.map +1 -0
  39. package/dist/feedback/Alert.d.ts +27 -0
  40. package/dist/feedback/Alert.js +68 -0
  41. package/dist/feedback/Alert.js.map +1 -0
  42. package/dist/feedback/Dialog.d.ts +36 -0
  43. package/dist/feedback/Dialog.js +218 -0
  44. package/dist/feedback/Dialog.js.map +1 -0
  45. package/dist/feedback/EmptyState.d.ts +13 -0
  46. package/dist/feedback/EmptyState.js +70 -0
  47. package/dist/feedback/EmptyState.js.map +1 -0
  48. package/dist/feedback/Skeleton.d.ts +23 -0
  49. package/dist/feedback/Skeleton.js +44 -0
  50. package/dist/feedback/Skeleton.js.map +1 -0
  51. package/dist/feedback/Toast.d.ts +23 -0
  52. package/dist/feedback/Toast.js +85 -0
  53. package/dist/feedback/Toast.js.map +1 -0
  54. package/dist/feedback/ToastProvider.d.ts +69 -0
  55. package/dist/feedback/ToastProvider.js +183 -0
  56. package/dist/feedback/ToastProvider.js.map +1 -0
  57. package/dist/forms/AvatarUpload.d.ts +57 -0
  58. package/dist/forms/AvatarUpload.js +579 -0
  59. package/dist/forms/AvatarUpload.js.map +1 -0
  60. package/dist/forms/Checkbox.d.ts +15 -0
  61. package/dist/forms/Checkbox.js +57 -0
  62. package/dist/forms/Checkbox.js.map +1 -0
  63. package/dist/forms/DateTimePicker.d.ts +43 -0
  64. package/dist/forms/DateTimePicker.js +391 -0
  65. package/dist/forms/DateTimePicker.js.map +1 -0
  66. package/dist/forms/FileUpload.d.ts +39 -0
  67. package/dist/forms/FileUpload.js +376 -0
  68. package/dist/forms/FileUpload.js.map +1 -0
  69. package/dist/forms/Input.d.ts +35 -0
  70. package/dist/forms/Input.js +143 -0
  71. package/dist/forms/Input.js.map +1 -0
  72. package/dist/forms/Radio.d.ts +18 -0
  73. package/dist/forms/Radio.js +50 -0
  74. package/dist/forms/Radio.js.map +1 -0
  75. package/dist/forms/SearchInput.d.ts +23 -0
  76. package/dist/forms/SearchInput.js +70 -0
  77. package/dist/forms/SearchInput.js.map +1 -0
  78. package/dist/forms/Select.d.ts +40 -0
  79. package/dist/forms/Select.js +524 -0
  80. package/dist/forms/Select.js.map +1 -0
  81. package/dist/forms/Switch.d.ts +20 -0
  82. package/dist/forms/Switch.js +76 -0
  83. package/dist/forms/Switch.js.map +1 -0
  84. package/dist/forms/Textarea.d.ts +19 -0
  85. package/dist/forms/Textarea.js +65 -0
  86. package/dist/forms/Textarea.js.map +1 -0
  87. package/dist/index.d.ts +33 -0
  88. package/dist/index.js +73 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/navigation/BottomNav.d.ts +17 -0
  91. package/dist/navigation/BottomNav.js +72 -0
  92. package/dist/navigation/BottomNav.js.map +1 -0
  93. package/dist/navigation/SidebarNav.d.ts +53 -0
  94. package/dist/navigation/SidebarNav.js +594 -0
  95. package/dist/navigation/SidebarNav.js.map +1 -0
  96. package/dist/navigation/Stepper.d.ts +33 -0
  97. package/dist/navigation/Stepper.js +87 -0
  98. package/dist/navigation/Stepper.js.map +1 -0
  99. package/dist/navigation/Tabs.d.ts +23 -0
  100. package/dist/navigation/Tabs.js +174 -0
  101. package/dist/navigation/Tabs.js.map +1 -0
  102. package/dist/navigation/TopBar.d.ts +17 -0
  103. package/dist/navigation/TopBar.js +65 -0
  104. package/dist/navigation/TopBar.js.map +1 -0
  105. package/dist/styles.css +258 -0
  106. package/dist/theme/ThemeProvider.d.ts +12 -0
  107. package/dist/theme/ThemeProvider.js +10 -0
  108. package/dist/theme/ThemeProvider.js.map +1 -0
  109. package/dist/theme/ThemeToggle.d.ts +14 -0
  110. package/dist/theme/ThemeToggle.js +25 -0
  111. package/dist/theme/ThemeToggle.js.map +1 -0
  112. package/package.json +79 -0
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { sx } from "../_internal/style";
4
+ const TRACK = { sm: { w: 36, h: 22, thumb: 16 }, md: { w: 44, h: 26, thumb: 20 } };
5
+ function Switch({ label, description, checked = false, disabled, size = "md", onChange, style }) {
6
+ const t = TRACK[size];
7
+ const toggle = () => {
8
+ if (!disabled && onChange) onChange({ target: { checked: !checked } });
9
+ };
10
+ return /* @__PURE__ */ jsxs(
11
+ "label",
12
+ {
13
+ style: sx({
14
+ display: "flex",
15
+ gap: "var(--space-3)",
16
+ alignItems: "center",
17
+ justifyContent: "space-between",
18
+ cursor: disabled ? "not-allowed" : "pointer",
19
+ opacity: disabled ? 0.6 : 1,
20
+ ...style
21
+ }),
22
+ children: [
23
+ /* @__PURE__ */ jsxs("span", { style: sx({ display: "flex", flexDirection: "column", gap: 2 }), children: [
24
+ label && /* @__PURE__ */ jsx("span", { style: sx({ fontFamily: "var(--font-body)", fontSize: "var(--text-base)", fontWeight: "var(--weight-medium)", color: "var(--text-primary)" }), children: label }),
25
+ description && /* @__PURE__ */ jsx("span", { style: sx({ fontFamily: "var(--font-body)", fontSize: "var(--text-xs)", color: "var(--text-muted)", lineHeight: 1.45 }), children: description })
26
+ ] }),
27
+ /* @__PURE__ */ jsx(
28
+ "span",
29
+ {
30
+ role: "switch",
31
+ "aria-checked": checked,
32
+ "aria-disabled": disabled || void 0,
33
+ tabIndex: disabled ? void 0 : 0,
34
+ className: "sereno-switch",
35
+ onClick: toggle,
36
+ onKeyDown: (e) => {
37
+ if (e.key === " " || e.key === "Enter") {
38
+ e.preventDefault();
39
+ toggle();
40
+ }
41
+ },
42
+ style: sx({
43
+ position: "relative",
44
+ width: t.w,
45
+ height: t.h,
46
+ flex: "0 0 auto",
47
+ borderRadius: "var(--radius-pill)",
48
+ background: checked ? "var(--interactive-primary)" : "var(--border-strong)",
49
+ transition: "background-color var(--duration-normal) var(--ease-standard)"
50
+ }),
51
+ children: /* @__PURE__ */ jsx(
52
+ "span",
53
+ {
54
+ style: sx({
55
+ position: "absolute",
56
+ top: 3,
57
+ left: checked ? t.w - t.thumb - 3 : 3,
58
+ width: t.thumb,
59
+ height: t.thumb,
60
+ borderRadius: "999px",
61
+ background: "#fff",
62
+ boxShadow: "var(--shadow-sm)",
63
+ transition: "left var(--duration-normal) var(--ease-gentle)"
64
+ })
65
+ }
66
+ )
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ export {
74
+ Switch
75
+ };
76
+ //# sourceMappingURL=Switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/forms/Switch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\n/** Instant-apply toggle for settings rows (agenda online, lembretes, tema). Never use inside a form that needs Save. Host must include the `.sereno-switch` focus rule (see globals.css). */\nexport interface SwitchProps {\n label?: string;\n description?: string;\n checked?: boolean;\n disabled?: boolean;\n /** Track size. `sm` for dense settings lists; `md` is the default. Matches `Checkbox` / `Radio`. */\n size?: 'sm' | 'md';\n onChange?: (e: { target: { checked: boolean } }) => void;\n style?: React.CSSProperties;\n}\n\nconst TRACK = { sm: { w: 36, h: 22, thumb: 16 }, md: { w: 44, h: 26, thumb: 20 } } as const;\n\nexport function Switch({ label, description, checked = false, disabled, size = 'md', onChange, style }: SwitchProps) {\n const t = TRACK[size];\n const toggle = () => {\n if (!disabled && onChange) onChange({ target: { checked: !checked } });\n };\n return (\n <label\n style={sx({\n display: 'flex',\n gap: 'var(--space-3)',\n alignItems: 'center',\n justifyContent: 'space-between',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n ...style,\n })}\n >\n <span style={sx({ display: 'flex', flexDirection: 'column', gap: 2 })}>\n {label && (\n <span style={sx({ fontFamily: 'var(--font-body)', fontSize: 'var(--text-base)', fontWeight: 'var(--weight-medium)', color: 'var(--text-primary)' })}>{label}</span>\n )}\n {description && (\n <span style={sx({ fontFamily: 'var(--font-body)', fontSize: 'var(--text-xs)', color: 'var(--text-muted)', lineHeight: 1.45 })}>{description}</span>\n )}\n </span>\n <span\n role=\"switch\"\n aria-checked={checked}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? undefined : 0}\n className=\"sereno-switch\"\n onClick={toggle}\n onKeyDown={(e) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n toggle();\n }\n }}\n style={sx({\n position: 'relative',\n width: t.w,\n height: t.h,\n flex: '0 0 auto',\n borderRadius: 'var(--radius-pill)',\n background: checked ? 'var(--interactive-primary)' : 'var(--border-strong)',\n transition: 'background-color var(--duration-normal) var(--ease-standard)',\n })}\n >\n <span\n style={sx({\n position: 'absolute',\n top: 3,\n left: checked ? t.w - t.thumb - 3 : 3,\n width: t.thumb,\n height: t.thumb,\n borderRadius: '999px',\n background: '#fff',\n boxShadow: 'var(--shadow-sm)',\n transition: 'left var(--duration-normal) var(--ease-gentle)',\n })}\n />\n </span>\n </label>\n );\n}\n"],"mappings":";AAoCM,SAEI,KAFJ;AAjCN,SAAS,UAAU;AAcnB,MAAM,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,OAAO,GAAG,GAAG,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,OAAO,GAAG,EAAE;AAE1E,SAAS,OAAO,EAAE,OAAO,aAAa,UAAU,OAAO,UAAU,OAAO,MAAM,UAAU,MAAM,GAAgB;AACnH,QAAM,IAAI,MAAM,IAAI;AACpB,QAAM,SAAS,MAAM;AACnB,QAAI,CAAC,YAAY,SAAU,UAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC;AAAA,EACvE;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,GAAG;AAAA,QACR,SAAS;AAAA,QACT,KAAK;AAAA,QACL,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,QAAQ,WAAW,gBAAgB;AAAA,QACnC,SAAS,WAAW,MAAM;AAAA,QAC1B,GAAG;AAAA,MACL,CAAC;AAAA,MAED;AAAA,6BAAC,UAAK,OAAO,GAAG,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,EAAE,CAAC,GACjE;AAAA,mBACC,oBAAC,UAAK,OAAO,GAAG,EAAE,YAAY,oBAAoB,UAAU,oBAAoB,YAAY,wBAAwB,OAAO,sBAAsB,CAAC,GAAI,iBAAM;AAAA,UAE7J,eACC,oBAAC,UAAK,OAAO,GAAG,EAAE,YAAY,oBAAoB,UAAU,kBAAkB,OAAO,qBAAqB,YAAY,KAAK,CAAC,GAAI,uBAAY;AAAA,WAEhJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,gBAAc;AAAA,YACd,iBAAe,YAAY;AAAA,YAC3B,UAAU,WAAW,SAAY;AAAA,YACjC,WAAU;AAAA,YACV,SAAS;AAAA,YACT,WAAW,CAAC,MAAM;AAChB,kBAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,kBAAE,eAAe;AACjB,uBAAO;AAAA,cACT;AAAA,YACF;AAAA,YACA,OAAO,GAAG;AAAA,cACR,UAAU;AAAA,cACV,OAAO,EAAE;AAAA,cACT,QAAQ,EAAE;AAAA,cACV,MAAM;AAAA,cACN,cAAc;AAAA,cACd,YAAY,UAAU,+BAA+B;AAAA,cACrD,YAAY;AAAA,YACd,CAAC;AAAA,YAED;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO,GAAG;AAAA,kBACR,UAAU;AAAA,kBACV,KAAK;AAAA,kBACL,MAAM,UAAU,EAAE,IAAI,EAAE,QAAQ,IAAI;AAAA,kBACpC,OAAO,EAAE;AAAA,kBACT,QAAQ,EAAE;AAAA,kBACV,cAAc;AAAA,kBACd,YAAY;AAAA,kBACZ,WAAW;AAAA,kBACX,YAAY;AAAA,gBACd,CAAC;AAAA;AAAA,YACH;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+
3
+ /** Multi-line field for booking notes and service descriptions. */
4
+ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
5
+ label?: string;
6
+ hint?: string;
7
+ error?: string;
8
+ required?: boolean;
9
+ rows?: number;
10
+ /**
11
+ * Show a `n / max` character counter on the hint row. Implied when `maxLength`
12
+ * is set; pass `showCount` on its own for a bare count with no ceiling.
13
+ */
14
+ showCount?: boolean;
15
+ containerStyle?: React.CSSProperties;
16
+ }
17
+ declare function Textarea({ label, hint, error, required, rows, showCount, disabled, id, style, containerStyle, ...rest }: TextareaProps): React.JSX.Element;
18
+
19
+ export { Textarea, type TextareaProps };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { sx } from "../_internal/style";
5
+ import { Field } from "../_internal/Field";
6
+ import { CharCount } from "../_internal/CharCount";
7
+ function Textarea({ label, hint, error, required, rows = 4, showCount, disabled, id, style, containerStyle, ...rest }) {
8
+ const [focus, setFocus] = React.useState(false);
9
+ const autoId = React.useId();
10
+ const rid = id || autoId;
11
+ const max = typeof rest.maxLength === "number" ? rest.maxLength : void 0;
12
+ const showCounter = Boolean(showCount) || max != null;
13
+ const [uncount, setUncount] = React.useState(
14
+ () => typeof rest.defaultValue === "string" || typeof rest.defaultValue === "number" ? String(rest.defaultValue).length : 0
15
+ );
16
+ const count = rest.value !== void 0 ? String(rest.value ?? "").length : uncount;
17
+ const handleChange = showCounter ? (e) => {
18
+ if (rest.value === void 0) setUncount(e.currentTarget.value.length);
19
+ rest.onChange?.(e);
20
+ } : rest.onChange;
21
+ return /* @__PURE__ */ jsx(
22
+ Field,
23
+ {
24
+ label,
25
+ hint,
26
+ error,
27
+ required,
28
+ htmlFor: rid,
29
+ style: containerStyle,
30
+ counter: showCounter ? /* @__PURE__ */ jsx(CharCount, { count, max }) : void 0,
31
+ children: /* @__PURE__ */ jsx(
32
+ "textarea",
33
+ {
34
+ id: rid,
35
+ rows,
36
+ disabled,
37
+ onFocus: () => setFocus(true),
38
+ onBlur: () => setFocus(false),
39
+ ...rest,
40
+ onChange: handleChange,
41
+ style: sx({
42
+ width: "100%",
43
+ padding: "var(--space-3)",
44
+ resize: "vertical",
45
+ borderRadius: "var(--radius-control)",
46
+ background: disabled ? "var(--interactive-disabled-bg)" : "var(--bg-surface)",
47
+ border: "var(--border-width-hairline) solid " + (error ? "var(--interactive-error)" : focus ? "var(--border-focus)" : "var(--border-default)"),
48
+ boxShadow: focus && !error ? "var(--focus-ring)" : "none",
49
+ outline: "none",
50
+ fontFamily: "var(--font-body)",
51
+ fontSize: "var(--text-base)",
52
+ lineHeight: "var(--leading-normal)",
53
+ color: disabled ? "var(--text-disabled)" : "var(--text-primary)",
54
+ transition: "var(--transition-control)",
55
+ ...style
56
+ })
57
+ }
58
+ )
59
+ }
60
+ );
61
+ }
62
+ export {
63
+ Textarea
64
+ };
65
+ //# sourceMappingURL=Textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/forms/Textarea.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\nimport { Field } from '../_internal/Field';\nimport { CharCount } from '../_internal/CharCount';\n\n/** Multi-line field for booking notes and service descriptions. */\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n label?: string;\n hint?: string;\n error?: string;\n required?: boolean;\n rows?: number;\n /**\n * Show a `n / max` character counter on the hint row. Implied when `maxLength`\n * is set; pass `showCount` on its own for a bare count with no ceiling.\n */\n showCount?: boolean;\n containerStyle?: React.CSSProperties;\n}\n\nexport function Textarea({ label, hint, error, required, rows = 4, showCount, disabled, id, style, containerStyle, ...rest }: TextareaProps) {\n const [focus, setFocus] = React.useState(false);\n // SSR-stable id (the DS source used Math.random(), which breaks hydration).\n const autoId = React.useId();\n const rid = id || autoId;\n\n const max = typeof rest.maxLength === 'number' ? rest.maxLength : undefined;\n const showCounter = Boolean(showCount) || max != null;\n const [uncount, setUncount] = React.useState(() =>\n typeof rest.defaultValue === 'string' || typeof rest.defaultValue === 'number' ? String(rest.defaultValue).length : 0,\n );\n const count = rest.value !== undefined ? String(rest.value ?? '').length : uncount;\n const handleChange = showCounter\n ? (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (rest.value === undefined) setUncount(e.currentTarget.value.length);\n rest.onChange?.(e);\n }\n : rest.onChange;\n\n return (\n <Field\n label={label}\n hint={hint}\n error={error}\n required={required}\n htmlFor={rid}\n style={containerStyle}\n counter={showCounter ? <CharCount count={count} max={max} /> : undefined}\n >\n <textarea\n id={rid}\n rows={rows}\n disabled={disabled}\n onFocus={() => setFocus(true)}\n onBlur={() => setFocus(false)}\n {...rest}\n onChange={handleChange}\n style={sx({\n width: '100%',\n padding: 'var(--space-3)',\n resize: 'vertical',\n borderRadius: 'var(--radius-control)',\n background: disabled ? 'var(--interactive-disabled-bg)' : 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid ' + (error ? 'var(--interactive-error)' : focus ? 'var(--border-focus)' : 'var(--border-default)'),\n boxShadow: focus && !error ? 'var(--focus-ring)' : 'none',\n outline: 'none',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-base)',\n lineHeight: 'var(--leading-normal)',\n color: disabled ? 'var(--text-disabled)' : 'var(--text-primary)',\n transition: 'var(--transition-control)',\n ...style,\n })}\n />\n </Field>\n );\n}"],"mappings":";AAiD6B;AA/C7B,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAiBnB,SAAS,SAAS,EAAE,OAAO,MAAM,OAAO,UAAU,OAAO,GAAG,WAAW,UAAU,IAAI,OAAO,gBAAgB,GAAG,KAAK,GAAkB;AAC3I,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAS,KAAK;AAE9C,QAAM,SAAS,MAAM,MAAM;AAC3B,QAAM,MAAM,MAAM;AAElB,QAAM,MAAM,OAAO,KAAK,cAAc,WAAW,KAAK,YAAY;AAClE,QAAM,cAAc,QAAQ,SAAS,KAAK,OAAO;AACjD,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM;AAAA,IAAS,MAC3C,OAAO,KAAK,iBAAiB,YAAY,OAAO,KAAK,iBAAiB,WAAW,OAAO,KAAK,YAAY,EAAE,SAAS;AAAA,EACtH;AACA,QAAM,QAAQ,KAAK,UAAU,SAAY,OAAO,KAAK,SAAS,EAAE,EAAE,SAAS;AAC3E,QAAM,eAAe,cACjB,CAAC,MAA8C;AAC7C,QAAI,KAAK,UAAU,OAAW,YAAW,EAAE,cAAc,MAAM,MAAM;AACrE,SAAK,WAAW,CAAC;AAAA,EACnB,IACA,KAAK;AAET,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS,cAAc,oBAAC,aAAU,OAAc,KAAU,IAAK;AAAA,MAE/D;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ;AAAA,UACA;AAAA,UACA,SAAS,MAAM,SAAS,IAAI;AAAA,UAC5B,QAAQ,MAAM,SAAS,KAAK;AAAA,UAC3B,GAAG;AAAA,UACJ,UAAU;AAAA,UACV,OAAO,GAAG;AAAA,YACR,OAAO;AAAA,YACP,SAAS;AAAA,YACT,QAAQ;AAAA,YACR,cAAc;AAAA,YACd,YAAY,WAAW,mCAAmC;AAAA,YAC1D,QAAQ,yCAAyC,QAAQ,6BAA6B,QAAQ,wBAAwB;AAAA,YACtH,WAAW,SAAS,CAAC,QAAQ,sBAAsB;AAAA,YACnD,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,YAAY;AAAA,YACZ,OAAO,WAAW,yBAAyB;AAAA,YAC3C,YAAY;AAAA,YACZ,GAAG;AAAA,UACL,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,33 @@
1
+ export { Button, ButtonProps } from './core/Button.js';
2
+ export { IconButton, IconButtonProps } from './core/IconButton.js';
3
+ export { Badge, BadgeProps } from './core/Badge.js';
4
+ export { Card, CardProps } from './core/Card.js';
5
+ export { Avatar, AvatarProps } from './core/Avatar.js';
6
+ export { Brand, BrandProps } from './core/Brand.js';
7
+ export { Menu, MenuEntry, MenuHeading, MenuItem, MenuProps, MenuSeparator } from './core/Menu.js';
8
+ export { CellProps, HeaderCellProps, SortDirection, Table, TableProps, TableRowProps, TableSort } from './core/Table.js';
9
+ export { Input, InputProps } from './forms/Input.js';
10
+ export { Textarea, TextareaProps } from './forms/Textarea.js';
11
+ export { Select, SelectOption, SelectProps } from './forms/Select.js';
12
+ export { Checkbox, CheckboxProps } from './forms/Checkbox.js';
13
+ export { Radio, RadioProps } from './forms/Radio.js';
14
+ export { Switch, SwitchProps } from './forms/Switch.js';
15
+ export { DateTimePicker, DateTimePickerProps, TimeSlot } from './forms/DateTimePicker.js';
16
+ export { FileUpload, FileUploadProps } from './forms/FileUpload.js';
17
+ export { AvatarUpload, AvatarUploadProps } from './forms/AvatarUpload.js';
18
+ export { SearchInput, SearchInputProps } from './forms/SearchInput.js';
19
+ export { TopBar, TopBarProps } from './navigation/TopBar.js';
20
+ export { TabItem, Tabs, TabsProps } from './navigation/Tabs.js';
21
+ export { BottomNav, BottomNavItem, BottomNavProps } from './navigation/BottomNav.js';
22
+ export { SidebarNav, SidebarNavItem, SidebarNavProps, SidebarNavSection, SidebarNavSubItem } from './navigation/SidebarNav.js';
23
+ export { Stepper, StepperProps, StepperStep } from './navigation/Stepper.js';
24
+ export { Alert, AlertProps } from './feedback/Alert.js';
25
+ export { Toast, ToastProps } from './feedback/Toast.js';
26
+ export { ToastApi, ToastContextValue, ToastOptions, ToastPosition, ToastProvider, ToastProviderProps, useToast } from './feedback/ToastProvider.js';
27
+ export { Dialog, DialogProps } from './feedback/Dialog.js';
28
+ export { Skeleton, SkeletonProps } from './feedback/Skeleton.js';
29
+ export { EmptyState, EmptyStateProps } from './feedback/EmptyState.js';
30
+ export { ThemeProvider } from './theme/ThemeProvider.js';
31
+ export { ThemeToggle } from './theme/ThemeToggle.js';
32
+ import 'react';
33
+ import './_internal/mask.js';
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ import { Button } from "./core/Button";
2
+ import { IconButton } from "./core/IconButton";
3
+ import { Badge } from "./core/Badge";
4
+ import { Card } from "./core/Card";
5
+ import { Avatar } from "./core/Avatar";
6
+ import { Brand } from "./core/Brand";
7
+ import { Menu } from "./core/Menu";
8
+ import {
9
+ Table
10
+ } from "./core/Table";
11
+ import { Input } from "./forms/Input";
12
+ import { Textarea } from "./forms/Textarea";
13
+ import { Select } from "./forms/Select";
14
+ import { Checkbox } from "./forms/Checkbox";
15
+ import { Radio } from "./forms/Radio";
16
+ import { Switch } from "./forms/Switch";
17
+ import { DateTimePicker } from "./forms/DateTimePicker";
18
+ import { FileUpload } from "./forms/FileUpload";
19
+ import { AvatarUpload } from "./forms/AvatarUpload";
20
+ import { SearchInput } from "./forms/SearchInput";
21
+ import { TopBar } from "./navigation/TopBar";
22
+ import { Tabs } from "./navigation/Tabs";
23
+ import { BottomNav } from "./navigation/BottomNav";
24
+ import {
25
+ SidebarNav
26
+ } from "./navigation/SidebarNav";
27
+ import { Stepper } from "./navigation/Stepper";
28
+ import { Alert } from "./feedback/Alert";
29
+ import { Toast } from "./feedback/Toast";
30
+ import {
31
+ ToastProvider,
32
+ useToast
33
+ } from "./feedback/ToastProvider";
34
+ import { Dialog } from "./feedback/Dialog";
35
+ import { Skeleton } from "./feedback/Skeleton";
36
+ import { EmptyState } from "./feedback/EmptyState";
37
+ import { ThemeProvider } from "./theme/ThemeProvider";
38
+ import { ThemeToggle } from "./theme/ThemeToggle";
39
+ export {
40
+ Alert,
41
+ Avatar,
42
+ AvatarUpload,
43
+ Badge,
44
+ BottomNav,
45
+ Brand,
46
+ Button,
47
+ Card,
48
+ Checkbox,
49
+ DateTimePicker,
50
+ Dialog,
51
+ EmptyState,
52
+ FileUpload,
53
+ IconButton,
54
+ Input,
55
+ Menu,
56
+ Radio,
57
+ SearchInput,
58
+ Select,
59
+ SidebarNav,
60
+ Skeleton,
61
+ Stepper,
62
+ Switch,
63
+ Table,
64
+ Tabs,
65
+ Textarea,
66
+ ThemeProvider,
67
+ ThemeToggle,
68
+ Toast,
69
+ ToastProvider,
70
+ TopBar,
71
+ useToast
72
+ };
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System — public component surface.\n// 25 primitives ported 1:1 from the approved DS source, plus FileUpload (SS-49),\n// AvatarUpload (SS-146), SearchInput (SS-50) and SidebarNav (SS-52) — all\n// net-new. Icons are passed in as props (lucide-react), never imported here;\n// theming is 100% CSS custom properties.\n\n// core\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { Card, type CardProps } from './core/Card';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport { DateTimePicker, type DateTimePickerProps, type TimeSlot } from './forms/DateTimePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabItem } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItem } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSection,\n type SidebarNavItem,\n type SidebarNavSubItem,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStep } from './navigation/Stepper';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme — the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAOA,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,YAA4B;AACrC,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,sBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAgC;AACzC,SAAS,YAA0C;AACnD,SAAS,iBAA0D;AACnE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAoD;AAG7D,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAgC;AACzC,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ interface BottomNavItem {
4
+ value: string;
5
+ label: string;
6
+ icon?: React.ReactNode;
7
+ badge?: boolean;
8
+ }
9
+ /** Mobile primary navigation — 3–5 destinations, 64px tall, translucent blurred surface. */
10
+ interface BottomNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
11
+ items: BottomNavItem[];
12
+ value?: string;
13
+ onChange?: (value: string) => void;
14
+ }
15
+ declare function BottomNav({ items, value, onChange, style, ...rest }: BottomNavProps): React.JSX.Element;
16
+
17
+ export { BottomNav, type BottomNavItem, type BottomNavProps };
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { sx } from "../_internal/style";
4
+ function BottomNav({ items = [], value, onChange, style, ...rest }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "nav",
7
+ {
8
+ ...rest,
9
+ style: sx({
10
+ display: "flex",
11
+ alignItems: "stretch",
12
+ height: "var(--bottom-nav-height)",
13
+ background: "color-mix(in srgb,var(--bg-surface) 88%,transparent)",
14
+ backdropFilter: "blur(12px)",
15
+ borderTop: "var(--border-width-hairline) solid var(--border-default)",
16
+ ...style
17
+ }),
18
+ children: items.map((it) => {
19
+ const active = value === it.value;
20
+ return /* @__PURE__ */ jsxs(
21
+ "button",
22
+ {
23
+ onClick: () => onChange && onChange(it.value),
24
+ style: sx({
25
+ flex: 1,
26
+ display: "flex",
27
+ flexDirection: "column",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ gap: 4,
31
+ border: "none",
32
+ background: "transparent",
33
+ cursor: "pointer",
34
+ outline: "none",
35
+ position: "relative",
36
+ color: active ? "var(--text-brand)" : "var(--text-muted)",
37
+ transition: "var(--transition-control)"
38
+ }),
39
+ children: [
40
+ /* @__PURE__ */ jsxs("span", { style: sx({ display: "flex", position: "relative" }), children: [
41
+ it.icon,
42
+ it.badge && /* @__PURE__ */ jsx(
43
+ "span",
44
+ {
45
+ style: sx({ position: "absolute", top: -3, right: -5, minWidth: 8, height: 8, borderRadius: "999px", background: "var(--interactive-accent)" })
46
+ }
47
+ )
48
+ ] }),
49
+ /* @__PURE__ */ jsx(
50
+ "span",
51
+ {
52
+ style: sx({
53
+ fontFamily: "var(--font-body)",
54
+ fontSize: "var(--text-2xs)",
55
+ fontWeight: active ? "var(--weight-semibold)" : "var(--weight-medium)",
56
+ letterSpacing: "var(--tracking-snug)"
57
+ }),
58
+ children: it.label
59
+ }
60
+ )
61
+ ]
62
+ },
63
+ it.value
64
+ );
65
+ })
66
+ }
67
+ );
68
+ }
69
+ export {
70
+ BottomNav
71
+ };
72
+ //# sourceMappingURL=BottomNav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/navigation/BottomNav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\nexport interface BottomNavItem {\n value: string;\n label: string;\n icon?: React.ReactNode;\n badge?: boolean;\n}\n\n/** Mobile primary navigation — 3–5 destinations, 64px tall, translucent blurred surface. */\nexport interface BottomNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n items: BottomNavItem[];\n value?: string;\n onChange?: (value: string) => void;\n}\n\nexport function BottomNav({ items = [], value, onChange, style, ...rest }: BottomNavProps) {\n return (\n <nav\n {...rest}\n style={sx({\n display: 'flex',\n alignItems: 'stretch',\n height: 'var(--bottom-nav-height)',\n background: 'color-mix(in srgb,var(--bg-surface) 88%,transparent)',\n backdropFilter: 'blur(12px)',\n borderTop: 'var(--border-width-hairline) solid var(--border-default)',\n ...style,\n })}\n >\n {items.map((it) => {\n const active = value === it.value;\n return (\n <button\n key={it.value}\n onClick={() => onChange && onChange(it.value)}\n style={sx({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n border: 'none',\n background: 'transparent',\n cursor: 'pointer',\n outline: 'none',\n position: 'relative',\n color: active ? 'var(--text-brand)' : 'var(--text-muted)',\n transition: 'var(--transition-control)',\n })}\n >\n <span style={sx({ display: 'flex', position: 'relative' })}>\n {it.icon}\n {it.badge && (\n <span\n style={sx({ position: 'absolute', top: -3, right: -5, minWidth: 8, height: 8, borderRadius: '999px', background: 'var(--interactive-accent)' })}\n />\n )}\n </span>\n <span\n style={sx({\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: active ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n letterSpacing: 'var(--tracking-snug)',\n })}\n >\n {it.label}\n </span>\n </button>\n );\n })}\n </nav>\n );\n}"],"mappings":";AAuDY,SAGI,KAHJ;AApDZ,SAAS,UAAU;AAgBZ,SAAS,UAAU,EAAE,QAAQ,CAAC,GAAG,OAAO,UAAU,OAAO,GAAG,KAAK,GAAmB;AACzF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,GAAG;AAAA,QACR,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,WAAW;AAAA,QACX,GAAG;AAAA,MACL,CAAC;AAAA,MAEA,gBAAM,IAAI,CAAC,OAAO;AACjB,cAAM,SAAS,UAAU,GAAG;AAC5B,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,SAAS,MAAM,YAAY,SAAS,GAAG,KAAK;AAAA,YAC5C,OAAO,GAAG;AAAA,cACR,MAAM;AAAA,cACN,SAAS;AAAA,cACT,eAAe;AAAA,cACf,YAAY;AAAA,cACZ,gBAAgB;AAAA,cAChB,KAAK;AAAA,cACL,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,QAAQ;AAAA,cACR,SAAS;AAAA,cACT,UAAU;AAAA,cACV,OAAO,SAAS,sBAAsB;AAAA,cACtC,YAAY;AAAA,YACd,CAAC;AAAA,YAED;AAAA,mCAAC,UAAK,OAAO,GAAG,EAAE,SAAS,QAAQ,UAAU,WAAW,CAAC,GACtD;AAAA,mBAAG;AAAA,gBACH,GAAG,SACF;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO,GAAG,EAAE,UAAU,YAAY,KAAK,IAAI,OAAO,IAAI,UAAU,GAAG,QAAQ,GAAG,cAAc,SAAS,YAAY,4BAA4B,CAAC;AAAA;AAAA,gBAChJ;AAAA,iBAEJ;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO,GAAG;AAAA,oBACR,YAAY;AAAA,oBACZ,UAAU;AAAA,oBACV,YAAY,SAAS,2BAA2B;AAAA,oBAChD,eAAe;AAAA,kBACjB,CAAC;AAAA,kBAEA,aAAG;AAAA;AAAA,cACN;AAAA;AAAA;AAAA,UAnCK,GAAG;AAAA,QAoCV;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -0,0 +1,53 @@
1
+ import * as React from 'react';
2
+
3
+ interface SidebarNavSubItem {
4
+ value: string;
5
+ label: string;
6
+ count?: number;
7
+ }
8
+ interface SidebarNavItem {
9
+ value: string;
10
+ label: string;
11
+ /** A Lucide icon passed as a node — sized by the caller. */
12
+ icon?: React.ReactNode;
13
+ count?: number;
14
+ /** Render this leaf as a real link (routing, new-tab, SSR-active) via `linkComponent`. */
15
+ href?: string;
16
+ /** Second-level items. A parent with children toggles them; it is not a destination itself. */
17
+ children?: SidebarNavSubItem[];
18
+ }
19
+ interface SidebarNavSection {
20
+ /** Small uppercase heading above the block. Omit for an unlabelled group — the divider still shows. */
21
+ label?: string;
22
+ items: SidebarNavItem[];
23
+ }
24
+ interface SidebarNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
25
+ sections: SidebarNavSection[];
26
+ value?: string;
27
+ onChange?: (value: string) => void;
28
+ /** Controlled collapse (icon-only rail). */
29
+ collapsed?: boolean;
30
+ defaultCollapsed?: boolean;
31
+ onCollapsedChange?: (collapsed: boolean) => void;
32
+ /** Show the collapse toggle in the footer. */
33
+ collapsible?: boolean;
34
+ /** Brand / logo slot at the top. */
35
+ header?: React.ReactNode;
36
+ /** Persistent slot pinned to the bottom (user card, plan nudge). Hidden while collapsed. */
37
+ footer?: React.ReactNode;
38
+ labels?: {
39
+ expand?: string;
40
+ collapse?: string;
41
+ };
42
+ /** Component used to render items that carry `href` (e.g. Next's `Link`). Defaults to `'a'`. */
43
+ linkComponent?: React.ElementType;
44
+ }
45
+ /**
46
+ * Desktop primary navigation — the counterpart to `BottomNav`. Grouped sections
47
+ * with dividers, an optional second level per item, and a collapse toggle that
48
+ * drops it to a 72px icon rail. Controlled: `value` / `onChange` for the active
49
+ * destination, `collapsed` / `onCollapsedChange` for the rail state.
50
+ */
51
+ declare function SidebarNav({ sections, value, onChange, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, collapsible, header, footer, labels, linkComponent, style, ...rest }: SidebarNavProps): React.JSX.Element;
52
+
53
+ export { SidebarNav, type SidebarNavItem, type SidebarNavProps, type SidebarNavSection, type SidebarNavSubItem };