@sovereignfs/ui 0.21.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 (141) hide show
  1. package/LICENSE +661 -0
  2. package/NOTICE +24 -0
  3. package/dist/Avatar.module.css +38 -0
  4. package/dist/Badge.module.css +88 -0
  5. package/dist/Button.module.css +77 -0
  6. package/dist/Card.module.css +34 -0
  7. package/dist/Dialog.module.css +188 -0
  8. package/dist/Drawer.module.css +30 -0
  9. package/dist/EmptyState.module.css +27 -0
  10. package/dist/FormField.module.css +28 -0
  11. package/dist/Icon.module.css +22 -0
  12. package/dist/Input.module.css +37 -0
  13. package/dist/NavTabs.module.css +48 -0
  14. package/dist/PageHeader.module.css +32 -0
  15. package/dist/Popover.module.css +44 -0
  16. package/dist/SegmentedControl.module.css +53 -0
  17. package/dist/Select.module.css +69 -0
  18. package/dist/Spinner.module.css +39 -0
  19. package/dist/SystemBanner.module.css +67 -0
  20. package/dist/Tabs.module.css +49 -0
  21. package/dist/Toast.module.css +130 -0
  22. package/dist/Toggle.module.css +52 -0
  23. package/dist/Tooltip.module.css +51 -0
  24. package/dist/index.d.ts +327 -0
  25. package/dist/index.js +1370 -0
  26. package/dist/tokens/primitives.css +99 -0
  27. package/dist/tokens/semantic.css +111 -0
  28. package/dist/tokens.css +5 -0
  29. package/package.json +50 -0
  30. package/src/components/Avatar/Avatar.module.css +38 -0
  31. package/src/components/Avatar/Avatar.tsx +42 -0
  32. package/src/components/Badge/Badge.module.css +88 -0
  33. package/src/components/Badge/Badge.stories.tsx +118 -0
  34. package/src/components/Badge/Badge.tsx +59 -0
  35. package/src/components/Badge/__tests__/Badge.test.tsx +64 -0
  36. package/src/components/Button/Button.module.css +77 -0
  37. package/src/components/Button/Button.stories.tsx +76 -0
  38. package/src/components/Button/Button.tsx +36 -0
  39. package/src/components/Button/__tests__/Button.test.tsx +37 -0
  40. package/src/components/Card/Card.module.css +34 -0
  41. package/src/components/Card/Card.tsx +34 -0
  42. package/src/components/Dialog/Dialog.module.css +188 -0
  43. package/src/components/Dialog/Dialog.stories.tsx +97 -0
  44. package/src/components/Dialog/Dialog.tsx +137 -0
  45. package/src/components/Dialog/__tests__/Dialog.test.tsx +73 -0
  46. package/src/components/Drawer/Drawer.module.css +30 -0
  47. package/src/components/Drawer/Drawer.stories.tsx +88 -0
  48. package/src/components/Drawer/Drawer.tsx +103 -0
  49. package/src/components/Drawer/__tests__/Drawer.test.tsx +56 -0
  50. package/src/components/EmptyState/EmptyState.module.css +27 -0
  51. package/src/components/EmptyState/EmptyState.tsx +27 -0
  52. package/src/components/FormField/FormField.module.css +28 -0
  53. package/src/components/FormField/FormField.tsx +53 -0
  54. package/src/components/Icon/Icon.module.css +22 -0
  55. package/src/components/Icon/Icon.stories.tsx +94 -0
  56. package/src/components/Icon/Icon.tsx +43 -0
  57. package/src/components/Icon/__tests__/Icon.test.tsx +40 -0
  58. package/src/components/Icon/icons/activity.tsx +20 -0
  59. package/src/components/Icon/icons/alert-triangle.tsx +22 -0
  60. package/src/components/Icon/icons/bell.tsx +21 -0
  61. package/src/components/Icon/icons/check.tsx +20 -0
  62. package/src/components/Icon/icons/chevron-down.tsx +20 -0
  63. package/src/components/Icon/icons/chevron-left.tsx +20 -0
  64. package/src/components/Icon/icons/chevron-right.tsx +20 -0
  65. package/src/components/Icon/icons/chevron-up.tsx +20 -0
  66. package/src/components/Icon/icons/eye-off.tsx +23 -0
  67. package/src/components/Icon/icons/eye.tsx +21 -0
  68. package/src/components/Icon/icons/grid-2x2.tsx +22 -0
  69. package/src/components/Icon/icons/house.tsx +21 -0
  70. package/src/components/Icon/icons/index.ts +122 -0
  71. package/src/components/Icon/icons/info.tsx +22 -0
  72. package/src/components/Icon/icons/lock.tsx +21 -0
  73. package/src/components/Icon/icons/log-out.tsx +22 -0
  74. package/src/components/Icon/icons/mail.tsx +21 -0
  75. package/src/components/Icon/icons/package.tsx +23 -0
  76. package/src/components/Icon/icons/pencil.tsx +21 -0
  77. package/src/components/Icon/icons/plus.tsx +21 -0
  78. package/src/components/Icon/icons/rotate-ccw.tsx +21 -0
  79. package/src/components/Icon/icons/search.tsx +21 -0
  80. package/src/components/Icon/icons/settings.tsx +21 -0
  81. package/src/components/Icon/icons/shield.tsx +20 -0
  82. package/src/components/Icon/icons/sliders-horizontal.tsx +28 -0
  83. package/src/components/Icon/icons/terminal.tsx +19 -0
  84. package/src/components/Icon/icons/trash-2.tsx +24 -0
  85. package/src/components/Icon/icons/user.tsx +21 -0
  86. package/src/components/Icon/icons/x.tsx +21 -0
  87. package/src/components/Input/Input.module.css +37 -0
  88. package/src/components/Input/Input.stories.tsx +86 -0
  89. package/src/components/Input/Input.tsx +14 -0
  90. package/src/components/Input/__tests__/Input.test.tsx +22 -0
  91. package/src/components/NavTabs/NavTabs.module.css +48 -0
  92. package/src/components/NavTabs/NavTabs.tsx +33 -0
  93. package/src/components/PageHeader/PageHeader.module.css +32 -0
  94. package/src/components/PageHeader/PageHeader.tsx +21 -0
  95. package/src/components/Popover/Popover.module.css +44 -0
  96. package/src/components/Popover/Popover.stories.tsx +232 -0
  97. package/src/components/Popover/Popover.tsx +75 -0
  98. package/src/components/Popover/__tests__/Popover.test.tsx +98 -0
  99. package/src/components/SegmentedControl/SegmentedControl.module.css +53 -0
  100. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +118 -0
  101. package/src/components/SegmentedControl/SegmentedControl.tsx +56 -0
  102. package/src/components/SegmentedControl/__tests__/SegmentedControl.test.tsx +63 -0
  103. package/src/components/Select/Select.module.css +69 -0
  104. package/src/components/Select/Select.stories.tsx +115 -0
  105. package/src/components/Select/Select.tsx +40 -0
  106. package/src/components/Select/__tests__/Select.test.tsx +59 -0
  107. package/src/components/Spinner/Spinner.module.css +39 -0
  108. package/src/components/Spinner/Spinner.tsx +23 -0
  109. package/src/components/SystemBanner/SystemBanner.module.css +67 -0
  110. package/src/components/SystemBanner/SystemBanner.stories.tsx +86 -0
  111. package/src/components/SystemBanner/SystemBanner.tsx +50 -0
  112. package/src/components/SystemBanner/__tests__/SystemBanner.test.tsx +50 -0
  113. package/src/components/Tabs/Tabs.module.css +49 -0
  114. package/src/components/Tabs/Tabs.stories.tsx +100 -0
  115. package/src/components/Tabs/Tabs.tsx +46 -0
  116. package/src/components/Tabs/__tests__/Tabs.test.tsx +45 -0
  117. package/src/components/Toast/Toast.module.css +130 -0
  118. package/src/components/Toast/Toast.stories.tsx +191 -0
  119. package/src/components/Toast/Toast.tsx +139 -0
  120. package/src/components/Toggle/Toggle.module.css +52 -0
  121. package/src/components/Toggle/Toggle.stories.tsx +95 -0
  122. package/src/components/Toggle/Toggle.tsx +39 -0
  123. package/src/components/Toggle/__tests__/Toggle.test.tsx +47 -0
  124. package/src/components/Tooltip/Tooltip.module.css +51 -0
  125. package/src/components/Tooltip/Tooltip.tsx +30 -0
  126. package/src/css-modules.d.ts +4 -0
  127. package/src/index.ts +45 -0
  128. package/src/stories/Avatar.stories.tsx +44 -0
  129. package/src/stories/Card.stories.tsx +35 -0
  130. package/src/stories/DesignSystemOverview.stories.tsx +1683 -0
  131. package/src/stories/EmptyState.stories.tsx +33 -0
  132. package/src/stories/FormField.stories.tsx +47 -0
  133. package/src/stories/MobilePatterns.stories.tsx +1285 -0
  134. package/src/stories/NavTabs.stories.tsx +35 -0
  135. package/src/stories/PageHeader.stories.tsx +31 -0
  136. package/src/stories/Spinner.stories.tsx +25 -0
  137. package/src/stories/TokenGallery.stories.tsx +355 -0
  138. package/src/stories/Tooltip.stories.tsx +59 -0
  139. package/src/tokens/primitives.css +99 -0
  140. package/src/tokens/semantic.css +111 -0
  141. package/src/tokens.css +5 -0
@@ -0,0 +1,111 @@
1
+ /*
2
+ * Sovereign Design System — semantic tokens.
3
+ *
4
+ * Contextual roles mapped from primitives. THIS is the theming surface: dark
5
+ * mode and tenant theming work by overriding these values at :root (or under
6
+ * [data-theme]) — no component changes required. Every value here references a
7
+ * primitive token; none is a hardcoded literal (except shadows and the scrim,
8
+ * which compose rgba layers).
9
+ *
10
+ * Identity is monochrome: the accent is near-black on light, near-white on dark.
11
+ * A tenant gives Sovereign its own colour by overriding --sv-color-accent.
12
+ */
13
+ :root {
14
+ --sv-color-surface: var(--sv-white);
15
+ --sv-color-surface-sunken: var(--sv-grey-50);
16
+ --sv-color-surface-raised: var(--sv-white);
17
+
18
+ --sv-color-text-primary: var(--sv-grey-950);
19
+ --sv-color-text-muted: var(--sv-grey-500);
20
+ --sv-color-text-subtle: var(--sv-grey-400);
21
+ --sv-color-text-on-accent: var(--sv-white);
22
+
23
+ --sv-color-border: var(--sv-grey-200);
24
+ --sv-color-border-strong: var(--sv-grey-300);
25
+
26
+ --sv-color-accent: var(--sv-grey-900);
27
+ --sv-color-accent-hover: var(--sv-grey-700);
28
+
29
+ --sv-color-focus-ring: var(--sv-grey-900);
30
+
31
+ /* Status surfaces — error (red), warning (amber), success (green).
32
+ Use these for banners, badges, and inline validation UI.
33
+ Never hardcode colour hex in components — reference these tokens. */
34
+ --sv-color-error-surface: var(--sv-red-100);
35
+ --sv-color-error-text: var(--sv-red-800);
36
+ --sv-color-error-border: var(--sv-red-200);
37
+ --sv-color-warning-surface: var(--sv-amber-100);
38
+ --sv-color-warning-text: var(--sv-amber-800);
39
+ --sv-color-warning-border: var(--sv-amber-200);
40
+ --sv-color-success-surface: var(--sv-green-100);
41
+ --sv-color-success-text: var(--sv-green-800);
42
+ --sv-color-success-border: var(--sv-green-200);
43
+
44
+ /* Info surfaces — blue palette. Use for informational banners and badges.
45
+ Never hardcode colour hex in components — reference these tokens. */
46
+ --sv-color-info-surface: var(--sv-blue-100);
47
+ --sv-color-info-text: var(--sv-blue-800);
48
+ --sv-color-info-border: var(--sv-blue-200);
49
+
50
+ /* Overlay surfaces (Dialog/Sheet): the scrim behind a dialog and the panel's
51
+ elevation shadow. Composed rgba layers, like --sv-shadow-card. */
52
+ --sv-color-scrim: rgba(0, 0, 0, 0.5);
53
+
54
+ --sv-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
55
+ --sv-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.08); /* e1 — card hover lift */
56
+ --sv-shadow-popover:
57
+ 0 4px 16px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08); /* e2 — floating panels */
58
+ --sv-shadow-overlay: 0 10px 38px rgba(0, 0, 0, 0.18), 0 6px 12px rgba(0, 0, 0, 0.12);
59
+
60
+ /*
61
+ * Instance identity tokens (RFC 0027 / RFC 0032 rename). Distinct namespace from --sv-color-*:
62
+ * these hold URLs (not colours) and are set once by the operator, not swapped
63
+ * with dark mode. Set by InstanceProvider server component from instance_config DB.
64
+ * CSS: background-image: var(--sv-instance-logo);
65
+ * or <img src="var(--sv-instance-logo)"> is NOT correct — use the InstanceProvider
66
+ * prop `instanceName` and the /api/instance/* routes for the actual URLs.
67
+ */
68
+ --sv-instance-logo: none;
69
+ --sv-instance-logo-dark: none;
70
+ --sv-instance-favicon: none;
71
+ }
72
+
73
+ [data-theme='dark'] {
74
+ --sv-color-surface: var(--sv-grey-950);
75
+ --sv-color-surface-sunken: var(--sv-grey-900);
76
+ --sv-color-surface-raised: var(--sv-grey-900);
77
+
78
+ --sv-color-text-primary: var(--sv-grey-50);
79
+ --sv-color-text-muted: var(--sv-grey-400);
80
+ --sv-color-text-subtle: var(--sv-grey-600);
81
+ --sv-color-text-on-accent: var(--sv-grey-950);
82
+
83
+ --sv-color-border: var(--sv-grey-800);
84
+ --sv-color-border-strong: var(--sv-grey-700);
85
+
86
+ --sv-color-accent: var(--sv-grey-50);
87
+ --sv-color-accent-hover: var(--sv-grey-200);
88
+
89
+ --sv-color-focus-ring: var(--sv-grey-100);
90
+
91
+ --sv-color-error-surface: var(--sv-red-900);
92
+ --sv-color-error-text: var(--sv-red-200);
93
+ --sv-color-error-border: var(--sv-red-700);
94
+ --sv-color-warning-surface: var(--sv-amber-900);
95
+ --sv-color-warning-text: var(--sv-amber-200);
96
+ --sv-color-warning-border: var(--sv-amber-800);
97
+ --sv-color-success-surface: var(--sv-green-900);
98
+ --sv-color-success-text: var(--sv-green-200);
99
+ --sv-color-success-border: var(--sv-green-800);
100
+
101
+ --sv-color-info-surface: var(--sv-blue-900);
102
+ --sv-color-info-text: var(--sv-blue-100);
103
+ --sv-color-info-border: var(--sv-blue-800);
104
+
105
+ --sv-color-scrim: rgba(0, 0, 0, 0.65);
106
+
107
+ --sv-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
108
+ --sv-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.3);
109
+ --sv-shadow-popover: 0 4px 16px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
110
+ --sv-shadow-overlay: 0 10px 38px rgba(0, 0, 0, 0.6), 0 6px 12px rgba(0, 0, 0, 0.5);
111
+ }
package/src/tokens.css ADDED
@@ -0,0 +1,5 @@
1
+ /* Convenience entry that loads both token tiers. The runtime shell imports this
2
+ * once so --sv-* variables are available globally (primitives first, then the
3
+ * semantic layer that maps them). */
4
+ @import './tokens/primitives.css';
5
+ @import './tokens/semantic.css';