@sovereignfs/ui 0.21.3 → 0.33.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 (130) hide show
  1. package/dist/Button.module.css +75 -8
  2. package/dist/Calendar.module.css +126 -0
  3. package/dist/Card.module.css +4 -2
  4. package/dist/Checkbox.module.css +109 -0
  5. package/dist/CodeTextarea.module.css +53 -0
  6. package/dist/ConfirmDialog.module.css +109 -0
  7. package/dist/DatePicker.module.css +57 -0
  8. package/dist/Dialog.module.css +73 -46
  9. package/dist/DragHandleRow.module.css +57 -0
  10. package/dist/Drawer.module.css +61 -0
  11. package/dist/FormField.module.css +5 -0
  12. package/dist/Icon.module.css +5 -0
  13. package/dist/Input.module.css +10 -0
  14. package/dist/Menu.module.css +82 -0
  15. package/dist/NavTabs.module.css +4 -2
  16. package/dist/OverlayHeader.module.css +98 -0
  17. package/dist/Popover.module.css +31 -1
  18. package/dist/SegmentedControl.module.css +4 -2
  19. package/dist/Select.module.css +9 -0
  20. package/dist/Sheet.module.css +55 -0
  21. package/dist/SplitPane.module.css +85 -0
  22. package/dist/StatusBadge.module.css +59 -0
  23. package/dist/SystemBanner.module.css +4 -2
  24. package/dist/Tabs.module.css +4 -2
  25. package/dist/TagInput.module.css +141 -0
  26. package/dist/Textarea.module.css +39 -0
  27. package/dist/Toast.module.css +7 -5
  28. package/dist/Toggle.module.css +1 -1
  29. package/dist/Tooltip.module.css +6 -1
  30. package/dist/index.d.ts +549 -20
  31. package/dist/index.js +1496 -193
  32. package/dist/tokens/primitives.css +19 -0
  33. package/dist/tokens/semantic.css +19 -0
  34. package/package.json +1 -1
  35. package/src/__tests__/motion.test.tsx +105 -0
  36. package/src/components/Button/Button.module.css +75 -8
  37. package/src/components/Button/Button.stories.tsx +6 -0
  38. package/src/components/Button/Button.tsx +17 -1
  39. package/src/components/Button/__tests__/Button.test.tsx +19 -0
  40. package/src/components/Calendar/Calendar.module.css +126 -0
  41. package/src/components/Calendar/Calendar.tsx +213 -0
  42. package/src/components/Calendar/__tests__/Calendar.test.tsx +98 -0
  43. package/src/components/Calendar/dateUtils.ts +97 -0
  44. package/src/components/Card/Card.module.css +4 -2
  45. package/src/components/Checkbox/Checkbox.module.css +109 -0
  46. package/src/components/Checkbox/Checkbox.tsx +78 -0
  47. package/src/components/CodeTextarea/CodeTextarea.module.css +53 -0
  48. package/src/components/CodeTextarea/CodeTextarea.stories.tsx +77 -0
  49. package/src/components/CodeTextarea/CodeTextarea.tsx +36 -0
  50. package/src/components/ConfirmDialog/ConfirmDialog.module.css +109 -0
  51. package/src/components/ConfirmDialog/ConfirmDialog.tsx +124 -0
  52. package/src/components/ConfirmDialog/__tests__/ConfirmDialog.test.tsx +146 -0
  53. package/src/components/DatePicker/DatePicker.module.css +57 -0
  54. package/src/components/DatePicker/DatePicker.tsx +103 -0
  55. package/src/components/DatePicker/__tests__/DatePicker.test.tsx +89 -0
  56. package/src/components/Dialog/Dialog.module.css +73 -46
  57. package/src/components/Dialog/Dialog.stories.tsx +51 -1
  58. package/src/components/Dialog/Dialog.tsx +86 -22
  59. package/src/components/Dialog/__tests__/Dialog.test.tsx +67 -3
  60. package/src/components/DragHandleRow/DragHandleRow.module.css +57 -0
  61. package/src/components/DragHandleRow/DragHandleRow.tsx +61 -0
  62. package/src/components/Drawer/Drawer.module.css +61 -0
  63. package/src/components/Drawer/Drawer.tsx +117 -13
  64. package/src/components/Drawer/__tests__/Drawer.test.tsx +123 -2
  65. package/src/components/FormField/FormField.module.css +5 -0
  66. package/src/components/FormField/FormField.tsx +36 -11
  67. package/src/components/FormField/__tests__/FormField.test.tsx +83 -0
  68. package/src/components/Icon/Icon.module.css +5 -0
  69. package/src/components/Icon/Icon.stories.tsx +4 -3
  70. package/src/components/Icon/Icon.tsx +1 -1
  71. package/src/components/Icon/icons/calendar.tsx +23 -0
  72. package/src/components/Icon/icons/ellipsis-vertical.tsx +22 -0
  73. package/src/components/Icon/icons/index.ts +8 -4
  74. package/src/components/Icon/icons/sliders-horizontal.tsx +9 -9
  75. package/src/components/Input/Input.module.css +10 -0
  76. package/src/components/Menu/Menu.module.css +82 -0
  77. package/src/components/Menu/Menu.tsx +137 -0
  78. package/src/components/Menu/__tests__/Menu.test.tsx +197 -0
  79. package/src/components/NavTabs/NavTabs.module.css +4 -2
  80. package/src/components/OverlayHeader/OverlayHeader.module.css +98 -0
  81. package/src/components/OverlayHeader/OverlayHeader.tsx +62 -0
  82. package/src/components/OverlayHeader/__tests__/OverlayHeader.test.tsx +51 -0
  83. package/src/components/Popover/Popover.module.css +31 -1
  84. package/src/components/Popover/Popover.stories.tsx +126 -1
  85. package/src/components/Popover/Popover.tsx +140 -7
  86. package/src/components/SegmentedControl/SegmentedControl.module.css +4 -2
  87. package/src/components/Select/Select.module.css +9 -0
  88. package/src/components/Select/Select.tsx +10 -2
  89. package/src/components/Sheet/Sheet.module.css +55 -0
  90. package/src/components/Sheet/Sheet.tsx +151 -0
  91. package/src/components/Sheet/__tests__/Sheet.test.tsx +99 -0
  92. package/src/components/SplitPane/SplitPane.module.css +85 -0
  93. package/src/components/SplitPane/SplitPane.stories.tsx +160 -0
  94. package/src/components/SplitPane/SplitPane.tsx +149 -0
  95. package/src/components/SplitPane/__tests__/SplitPane.test.tsx +51 -0
  96. package/src/components/StatusBadge/StatusBadge.module.css +59 -0
  97. package/src/components/StatusBadge/StatusBadge.stories.tsx +74 -0
  98. package/src/components/StatusBadge/StatusBadge.tsx +65 -0
  99. package/src/components/SystemBanner/SystemBanner.module.css +4 -2
  100. package/src/components/Tabs/Tabs.module.css +4 -2
  101. package/src/components/TagInput/TagInput.module.css +141 -0
  102. package/src/components/TagInput/TagInput.stories.tsx +109 -0
  103. package/src/components/TagInput/TagInput.tsx +174 -0
  104. package/src/components/TagInput/__tests__/TagInput.test.tsx +69 -0
  105. package/src/components/Textarea/Textarea.module.css +39 -0
  106. package/src/components/Textarea/Textarea.tsx +15 -0
  107. package/src/components/Textarea/__tests__/Textarea.test.tsx +29 -0
  108. package/src/components/Toast/Toast.module.css +7 -5
  109. package/src/components/Toggle/Toggle.module.css +1 -1
  110. package/src/components/Tooltip/Tooltip.module.css +6 -1
  111. package/src/hooks/__tests__/useDoubleTap.test.tsx +117 -0
  112. package/src/hooks/__tests__/useIsMobile.test.tsx +80 -0
  113. package/src/hooks/__tests__/useLongPress.test.tsx +158 -0
  114. package/src/hooks/index.ts +4 -0
  115. package/src/hooks/useDoubleTap.ts +91 -0
  116. package/src/hooks/useIsMobile.ts +33 -0
  117. package/src/hooks/useLongPress.ts +185 -0
  118. package/src/index.ts +37 -2
  119. package/src/motion.ts +78 -0
  120. package/src/stories/Checkbox.stories.tsx +45 -0
  121. package/src/stories/DesignSystemOverview.stories.tsx +354 -8
  122. package/src/stories/DragHandleRow.stories.tsx +41 -0
  123. package/src/stories/FormField.stories.tsx +8 -8
  124. package/src/stories/InteractionHooks.stories.tsx +388 -0
  125. package/src/stories/MobilePatterns.stories.tsx +4 -4
  126. package/src/stories/Textarea.stories.tsx +51 -0
  127. package/src/stories/TokenGallery.stories.tsx +87 -1
  128. package/src/tokens/primitives.css +19 -0
  129. package/src/tokens/semantic.css +19 -0
  130. package/src/components/Icon/icons/terminal.tsx +0 -19
@@ -0,0 +1,85 @@
1
+ .splitPane {
2
+ display: grid;
3
+ grid-template-columns:
4
+ minmax(0, var(--split-pane-primary-size, 50%)) 12px
5
+ minmax(0, calc(100% - var(--split-pane-primary-size, 50%)));
6
+ width: 100%;
7
+ min-height: 320px;
8
+ border: 1px solid var(--sv-color-border);
9
+ border-radius: var(--sv-radius-lg);
10
+ overflow: hidden;
11
+ background: var(--sv-color-surface);
12
+ }
13
+
14
+ .splitPane:not(:has(.handle)) {
15
+ grid-template-columns:
16
+ minmax(0, var(--split-pane-primary-size, 50%))
17
+ minmax(0, calc(100% - var(--split-pane-primary-size, 50%)));
18
+ }
19
+
20
+ .pane {
21
+ min-width: 0;
22
+ min-height: 0;
23
+ overflow: auto;
24
+ background: var(--sv-color-surface);
25
+ }
26
+
27
+ .pane + .pane {
28
+ border-left: 1px solid var(--sv-color-border);
29
+ }
30
+
31
+ .handle {
32
+ position: relative;
33
+ width: 12px;
34
+ min-width: 12px;
35
+ padding: 0;
36
+ border: 0;
37
+ border-inline: 1px solid var(--sv-color-border);
38
+ cursor: col-resize;
39
+ background: var(--sv-color-surface-sunken);
40
+ }
41
+
42
+ .handle::before {
43
+ position: absolute;
44
+ inset-block: 50%;
45
+ inset-inline: 50%;
46
+ width: 2px;
47
+ height: 40px;
48
+ content: '';
49
+ background: var(--sv-color-border-strong);
50
+ border-radius: var(--sv-radius-full);
51
+ transform: translate(-50%, -50%);
52
+ }
53
+
54
+ @media (hover: hover) {
55
+ .handle:hover {
56
+ background: var(--sv-color-accent-subtle);
57
+ }
58
+ }
59
+
60
+ .handle:focus-visible {
61
+ background: var(--sv-color-accent-subtle);
62
+ outline: 2px solid var(--sv-color-focus-ring);
63
+ outline-offset: -2px;
64
+ }
65
+
66
+ @media (max-width: 720px) {
67
+ .splitPane,
68
+ .splitPane:not(:has(.handle)) {
69
+ grid-template-columns: 1fr;
70
+ min-height: 0;
71
+ }
72
+
73
+ .handle {
74
+ display: none;
75
+ }
76
+
77
+ .pane {
78
+ min-height: 220px;
79
+ }
80
+
81
+ .pane + .pane {
82
+ border-top: 1px solid var(--sv-color-border);
83
+ border-left: 0;
84
+ }
85
+ }
@@ -0,0 +1,59 @@
1
+ .badge {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ max-width: 100%;
5
+ min-height: 24px;
6
+ gap: var(--sv-space-1);
7
+ padding: 2px var(--sv-space-2);
8
+ border: 1px solid var(--sv-color-border);
9
+ border-radius: var(--sv-radius-full);
10
+ font-family: var(--sv-font-family);
11
+ font-size: var(--sv-font-size-xs);
12
+ font-weight: var(--sv-font-weight-semibold);
13
+ line-height: 1.2;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ .dot {
18
+ width: 7px;
19
+ height: 7px;
20
+ flex: 0 0 auto;
21
+ border-radius: var(--sv-radius-full);
22
+ background: currentColor;
23
+ }
24
+
25
+ .label {
26
+ min-width: 0;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ }
30
+
31
+ .neutral {
32
+ color: var(--sv-color-text-muted);
33
+ background: var(--sv-color-surface-sunken);
34
+ border-color: var(--sv-color-border);
35
+ }
36
+
37
+ .info {
38
+ color: var(--sv-color-info-text);
39
+ background: var(--sv-color-info-surface);
40
+ border-color: var(--sv-color-info-border);
41
+ }
42
+
43
+ .success {
44
+ color: var(--sv-color-success-text);
45
+ background: var(--sv-color-success-surface);
46
+ border-color: var(--sv-color-success-border);
47
+ }
48
+
49
+ .warning {
50
+ color: var(--sv-color-warning-text);
51
+ background: var(--sv-color-warning-surface);
52
+ border-color: var(--sv-color-warning-border);
53
+ }
54
+
55
+ .error {
56
+ color: var(--sv-color-error-text);
57
+ background: var(--sv-color-error-surface);
58
+ border-color: var(--sv-color-error-border);
59
+ }
@@ -38,8 +38,10 @@
38
38
  transition: opacity 0.12s ease;
39
39
  }
40
40
 
41
- .dismiss:hover {
42
- opacity: 1;
41
+ @media (hover: hover) {
42
+ .dismiss:hover {
43
+ opacity: 1;
44
+ }
43
45
  }
44
46
 
45
47
  .dismiss:focus-visible {
@@ -44,6 +44,8 @@
44
44
  font-weight: var(--sv-font-weight-medium);
45
45
  }
46
46
 
47
- .inactive:hover {
48
- color: var(--sv-color-text-primary);
47
+ @media (hover: hover) {
48
+ .inactive:hover {
49
+ color: var(--sv-color-text-primary);
50
+ }
49
51
  }
@@ -0,0 +1,141 @@
1
+ .wrapper {
2
+ display: flex;
3
+ width: 100%;
4
+ flex-direction: column;
5
+ gap: var(--sv-space-1);
6
+ }
7
+
8
+ .control {
9
+ display: flex;
10
+ min-height: 40px;
11
+ width: 100%;
12
+ align-items: center;
13
+ gap: var(--sv-space-1);
14
+ flex-wrap: wrap;
15
+ padding: 5px var(--sv-space-2);
16
+ color: var(--sv-color-text-primary);
17
+ background: var(--sv-color-surface);
18
+ border: 1px solid var(--sv-color-border-strong);
19
+ border-radius: var(--sv-radius-md);
20
+ transition:
21
+ border-color 0.15s ease,
22
+ box-shadow 0.15s ease;
23
+ }
24
+
25
+ .control:focus-within {
26
+ border-color: var(--sv-color-accent);
27
+ box-shadow: 0 0 0 2px var(--sv-color-focus-ring);
28
+ }
29
+
30
+ .invalid {
31
+ border-color: var(--sv-color-error-border);
32
+ }
33
+
34
+ .invalid:focus-within {
35
+ border-color: var(--sv-color-error-border);
36
+ box-shadow: 0 0 0 2px var(--sv-color-error-border);
37
+ }
38
+
39
+ .disabled {
40
+ opacity: 0.5;
41
+ cursor: not-allowed;
42
+ }
43
+
44
+ .tag {
45
+ display: inline-flex;
46
+ max-width: 100%;
47
+ min-height: 28px;
48
+ align-items: center;
49
+ gap: var(--sv-space-1);
50
+ padding-inline: var(--sv-space-2) 2px;
51
+ color: var(--sv-color-text-primary);
52
+ background: var(--sv-color-surface-sunken);
53
+ border: 1px solid var(--sv-color-border);
54
+ border-radius: var(--sv-radius-full);
55
+ font-family: var(--sv-font-family);
56
+ font-size: var(--sv-font-size-xs);
57
+ font-weight: var(--sv-font-weight-medium);
58
+ }
59
+
60
+ .tagLabel {
61
+ min-width: 0;
62
+ overflow: hidden;
63
+ text-overflow: ellipsis;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .removeButton {
68
+ display: inline-flex;
69
+ width: 22px;
70
+ height: 22px;
71
+ align-items: center;
72
+ justify-content: center;
73
+ padding: 0;
74
+ color: var(--sv-color-text-muted);
75
+ background: transparent;
76
+ border: 0;
77
+ border-radius: var(--sv-radius-full);
78
+ cursor: pointer;
79
+ font: inherit;
80
+ line-height: 1;
81
+ }
82
+
83
+ @media (hover: hover) {
84
+ .removeButton:hover:not(:disabled) {
85
+ color: var(--sv-color-text-primary);
86
+ background: var(--sv-color-surface);
87
+ }
88
+ }
89
+
90
+ .removeButton:focus-visible {
91
+ outline: 2px solid var(--sv-color-focus-ring);
92
+ outline-offset: 1px;
93
+ }
94
+
95
+ .removeButton:disabled {
96
+ cursor: not-allowed;
97
+ }
98
+
99
+ .input {
100
+ min-width: 120px;
101
+ flex: 1 1 140px;
102
+ height: 28px;
103
+ padding: 0 var(--sv-space-1);
104
+ color: var(--sv-color-text-primary);
105
+ background: transparent;
106
+ border: 0;
107
+ outline: 0;
108
+ font-family: var(--sv-font-family);
109
+ font-size: var(--sv-font-size-sm);
110
+ line-height: 1.5;
111
+ }
112
+
113
+ .input::placeholder {
114
+ color: var(--sv-color-text-muted);
115
+ }
116
+
117
+ .input:disabled {
118
+ cursor: not-allowed;
119
+ }
120
+
121
+ .hint,
122
+ .error {
123
+ margin: 0;
124
+ font-family: var(--sv-font-family);
125
+ font-size: var(--sv-font-size-caption);
126
+ line-height: 1.4;
127
+ }
128
+
129
+ .hint {
130
+ color: var(--sv-color-text-muted);
131
+ }
132
+
133
+ .error {
134
+ color: var(--sv-color-error-text);
135
+ }
136
+
137
+ @media (pointer: coarse) {
138
+ .input {
139
+ font-size: var(--sv-font-size-md);
140
+ }
141
+ }
@@ -0,0 +1,39 @@
1
+ .textarea {
2
+ display: block;
3
+ width: 100%;
4
+ padding: var(--sv-space-2) var(--sv-space-3);
5
+ font-family: var(--sv-font-family);
6
+ font-size: var(--sv-font-size-sm);
7
+ line-height: 1.5;
8
+ color: var(--sv-color-text-primary);
9
+ background-color: var(--sv-color-surface);
10
+ border: 1px solid var(--sv-color-border-strong);
11
+ border-radius: var(--sv-radius-md);
12
+ resize: vertical;
13
+ transition:
14
+ border-color 0.15s ease,
15
+ box-shadow 0.15s ease;
16
+ }
17
+
18
+ .textarea::placeholder {
19
+ color: var(--sv-color-text-muted);
20
+ }
21
+
22
+ .textarea:focus-visible {
23
+ outline: none;
24
+ border-color: var(--sv-color-accent);
25
+ box-shadow: 0 0 0 2px var(--sv-color-focus-ring);
26
+ }
27
+
28
+ .textarea:read-only {
29
+ background-color: var(--sv-color-surface-sunken);
30
+ color: var(--sv-color-text-muted);
31
+ border-color: var(--sv-color-border);
32
+ cursor: default;
33
+ }
34
+
35
+ .textarea:disabled {
36
+ opacity: 0.5;
37
+ cursor: not-allowed;
38
+ resize: none;
39
+ }
@@ -80,7 +80,7 @@
80
80
 
81
81
  .message {
82
82
  font-size: var(--sv-font-size-sm);
83
- color: var(--sv-color-text-secondary);
83
+ color: var(--sv-color-text-muted);
84
84
  margin-top: var(--sv-space-1);
85
85
  line-height: 1.4;
86
86
  }
@@ -91,13 +91,15 @@
91
91
  border: none;
92
92
  padding: 0;
93
93
  cursor: pointer;
94
- color: var(--sv-color-text-tertiary);
94
+ color: var(--sv-color-text-subtle);
95
95
  line-height: 1;
96
- font-size: var(--sv-font-size-base);
96
+ font-size: var(--sv-font-size-md);
97
97
  }
98
98
 
99
- .close:hover {
100
- color: var(--sv-color-text-primary);
99
+ @media (hover: hover) {
100
+ .close:hover {
101
+ color: var(--sv-color-text-primary);
102
+ }
101
103
  }
102
104
 
103
105
  @keyframes toastIn {
@@ -40,7 +40,7 @@
40
40
  background: var(--sv-white);
41
41
  transition: transform 0.15s ease;
42
42
  left: 2px;
43
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
43
+ box-shadow: var(--sv-shadow-control);
44
44
  }
45
45
 
46
46
  .on .thumb {
@@ -20,7 +20,12 @@
20
20
  transition: opacity 0.1s ease;
21
21
  }
22
22
 
23
- .wrapper:hover .tip,
23
+ @media (hover: hover) {
24
+ .wrapper:hover .tip {
25
+ opacity: 1;
26
+ }
27
+ }
28
+
24
29
  .wrapper:focus-within .tip {
25
30
  opacity: 1;
26
31
  }