@nattstack/ui 0.0.30 → 0.0.31

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 (30) hide show
  1. package/dist/components/index.d.ts +183 -170
  2. package/dist/components/index.js +581 -730
  3. package/dist/components/style.css +727 -0
  4. package/package.json +8 -7
  5. package/dist/components/button-spinner.module-T3OGVJS4.module.css +0 -95
  6. package/dist/components/button.module-4EHK5C4W.module.css +0 -183
  7. package/dist/components/column.module-A7QCVPFC.module.css +0 -4
  8. package/dist/components/dialog-responsive-backdrop.module-O336AARV.module.css +0 -27
  9. package/dist/components/dialog-responsive-bar.module-QCLP4IUN.module.css +0 -14
  10. package/dist/components/dialog-responsive-popup.module-BOEQIHJ7.module.css +0 -58
  11. package/dist/components/dialog-responsive-portal.module-YFVKMKVT.module.css +0 -5
  12. package/dist/components/dialog-responsive-viewport.module-LT7MZPLD.module.css +0 -16
  13. package/dist/components/input.module-H5TWAPFX.module.css +0 -97
  14. package/dist/components/label.module-2UZDXZQ4.module.css +0 -8
  15. package/dist/components/row.module-GYNANRAY.module.css +0 -4
  16. package/dist/components/spacer.module-ZYYYWYEB.module.css +0 -3
  17. package/dist/components/switch.module-U6Q27QB5.module.css +0 -62
  18. package/dist/components/tabs-panel.module-VGH3G3KV.module.css +0 -12
  19. package/dist/components/tabs-pill-indicator.module-533HMO7L.module.css +0 -12
  20. package/dist/components/tabs-pill-list.module-KQW67ZSW.module.css +0 -7
  21. package/dist/components/tabs-pill-tab.module-5SZMEO3Y.module.css +0 -64
  22. package/dist/components/tabs-segmented-indicator.module-EG56DHS2.module.css +0 -12
  23. package/dist/components/tabs-segmented-list.module-I3DSVFSP.module.css +0 -11
  24. package/dist/components/tabs-segmented-tab.module-SVYVEM2O.module.css +0 -36
  25. package/dist/components/tabs-underline-indicator.module-6SHQHUH5.module.css +0 -10
  26. package/dist/components/tabs-underline-list.module-72ZCIEAS.module.css +0 -8
  27. package/dist/components/tabs-underline-tab.module-OAE4JH7K.module.css +0 -35
  28. package/dist/components/tabs.module-3Z5DRPPX.module.css +0 -5
  29. package/dist/components/textarea.module-LK25MKCZ.module.css +0 -10
  30. package/dist/components/tooltip-content.module-QGRFS5NN.module.css +0 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nattstack/ui",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "A collection of reusable React components built with Base UI, TypeScript, and CSS Modules",
5
5
  "keywords": [
6
6
  "base-ui",
@@ -41,9 +41,9 @@
41
41
  "access": "public"
42
42
  },
43
43
  "scripts": {
44
- "build": "tsup",
44
+ "build": "tsdown",
45
45
  "check:type": "tsc",
46
- "dev": "tsup --watch",
46
+ "dev": "tsdown --watch",
47
47
  "prepublishOnly": "bun run build",
48
48
  "release": "bun publish"
49
49
  },
@@ -51,13 +51,14 @@
51
51
  "@base-ui/react": "1.4.0"
52
52
  },
53
53
  "devDependencies": {
54
+ "@tsdown/css": "0.21.8",
54
55
  "@types/bun": "1.3.12",
55
- "@types/react": "19.2.14",
56
- "tsup": "8.5.1",
56
+ "tsdown": "0.21.8",
57
57
  "typescript": "5.9.3"
58
58
  },
59
59
  "peerDependencies": {
60
- "react": "^18.0.0 || ^19.0.0",
61
- "react-dom": "^18.0.0 || ^19.0.0"
60
+ "@types/react": "^18 || ^19",
61
+ "react": "^18 || ^19",
62
+ "react-dom": "^18 || ^19"
62
63
  }
63
64
  }
@@ -1,95 +0,0 @@
1
- .button_spinner {
2
- position: relative;
3
- width: var(--size);
4
- height: var(--size);
5
- scale: -1 1;
6
- animation: spinner 1000ms steps(12, end) infinite;
7
- }
8
-
9
- @keyframes spinner {
10
- to {
11
- rotate: 1turn;
12
- }
13
- }
14
-
15
- .button_spinner > div {
16
- position: absolute;
17
- top: 50%;
18
- right: 0;
19
- width: calc(var(--size) / 2);
20
- height: calc(var(--size) / 12);
21
- pointer-events: none;
22
- transform-origin: center left;
23
- translate: 0 -50%;
24
- transition: all 150ms;
25
- }
26
-
27
- .button_spinner > div::after {
28
- position: absolute;
29
- right: 0;
30
- width: 50%;
31
- height: 100%;
32
- content: "";
33
- background-color: currentColor;
34
- border-radius: 9999px;
35
- }
36
-
37
- .button_spinner > div:nth-child(1) {
38
- opacity: 1;
39
- rotate: 0deg;
40
- }
41
-
42
- .button_spinner > div:nth-child(2) {
43
- opacity: 0.925;
44
- rotate: 30deg;
45
- }
46
-
47
- .button_spinner > div:nth-child(3) {
48
- opacity: 0.85;
49
- rotate: 60deg;
50
- }
51
-
52
- .button_spinner > div:nth-child(4) {
53
- opacity: 0.775;
54
- rotate: 90deg;
55
- }
56
-
57
- .button_spinner > div:nth-child(5) {
58
- opacity: 0.7;
59
- rotate: 120deg;
60
- }
61
-
62
- .button_spinner > div:nth-child(6) {
63
- opacity: 0.625;
64
- rotate: 150deg;
65
- }
66
-
67
- .button_spinner > div:nth-child(7) {
68
- opacity: 0.55;
69
- rotate: 180deg;
70
- }
71
-
72
- .button_spinner > div:nth-child(8) {
73
- opacity: 0.475;
74
- rotate: 210deg;
75
- }
76
-
77
- .button_spinner > div:nth-child(9) {
78
- opacity: 0.4;
79
- rotate: 240deg;
80
- }
81
-
82
- .button_spinner > div:nth-child(10) {
83
- opacity: 0.325;
84
- rotate: 270deg;
85
- }
86
-
87
- .button_spinner > div:nth-child(11) {
88
- opacity: 0.25;
89
- rotate: 300deg;
90
- }
91
-
92
- .button_spinner > div:nth-child(12) {
93
- opacity: 0.15;
94
- rotate: 330deg;
95
- }
@@ -1,183 +0,0 @@
1
- /* ===================================================== */
2
- /* Base */
3
- /* ===================================================== */
4
- .button {
5
- align-items: safe center;
6
- border-style: none;
7
- column-gap: 8px;
8
- cursor: pointer;
9
- display: flex;
10
- flex-shrink: 0;
11
- font-family: var(--font-body);
12
- font-size: 14px;
13
- font-weight: 500;
14
- height: var(--size-button);
15
- justify-content: safe center;
16
- line-height: 1.5;
17
- outline-color: var(--color-primary-9);
18
- outline-offset: 2px;
19
- outline-style: solid;
20
- outline-width: 0px;
21
- overflow: hidden;
22
- transition-duration: 150ms;
23
- transition-property: background-color, opacity, translate;
24
- user-select: none;
25
- }
26
-
27
- /* When pressed, move the button down */
28
- .button:active:not(:disabled),
29
- .button[aria-pressed="true"]:not(:disabled) {
30
- translate: 0 1px;
31
- }
32
-
33
- /* When disabled, disable cursor and reduce opacity */
34
- .button:disabled {
35
- cursor: not-allowed;
36
- opacity: 0.5;
37
- }
38
-
39
- /* When keyboard focused, show outline */
40
- .button:focus-visible {
41
- outline-width: 2px;
42
- }
43
-
44
- /* Icon size */
45
- .button > svg {
46
- --size-icon: 20px;
47
- height: var(--size-icon);
48
- width: var(--size-icon);
49
- }
50
-
51
- /* ===================================================== */
52
- /* Icon only */
53
- /* ===================================================== */
54
- .button__icon_only {
55
- width: var(--size-button) !important;
56
- padding: 0 !important;
57
- }
58
-
59
- /* ===================================================== */
60
- /* Rounded */
61
- /* ===================================================== */
62
- .button__rounded_base {
63
- border-radius: 12px;
64
- }
65
-
66
- .button__rounded_full {
67
- border-radius: 9999px !important;
68
- }
69
-
70
- /* ===================================================== */
71
- /* Size */
72
- /* ===================================================== */
73
- .button__size_32 {
74
- --size-button: 32px;
75
- padding: 0 10px;
76
- border-radius: 6px;
77
- }
78
-
79
- .button__size_36 {
80
- --size-button: 36px;
81
- padding: 0 12px;
82
- border-radius: 8px;
83
- }
84
-
85
- .button__size_40 {
86
- --size-button: 40px;
87
- padding: 0 14px;
88
- border-radius: 10px;
89
- }
90
-
91
- .button__size_44 {
92
- --size-button: 44px;
93
- padding: 0 16px;
94
- border-radius: 12px;
95
- }
96
-
97
- .button__size_48 {
98
- --size-button: 48px;
99
- padding: 0 18px;
100
- border-radius: 14px;
101
- }
102
-
103
- /* ===================================================== */
104
- /* Variant */
105
- /* ===================================================== */
106
- /* Ghost */
107
- .button__variant_ghost {
108
- color: black;
109
- background-color: transparent;
110
- }
111
-
112
- .button__variant_ghost:active:not(:disabled),
113
- .button__variant_ghost:hover:not(:disabled),
114
- .button__variant_ghost[aria-pressed="true"]:not(:disabled) {
115
- background-color: var(--color-gray-3);
116
- }
117
-
118
- :global(.dark) .button__variant_ghost {
119
- color: white;
120
- }
121
-
122
- /* Primary */
123
- .button__variant_primary {
124
- color: white;
125
- background-color: var(--color-primary-9);
126
- background-image: linear-gradient(
127
- to bottom,
128
- color-mix(in oklab, transparent 100%, #ffffff 5%) 50%,
129
- color-mix(in oklab, transparent 100%, #ffffff 0%) 50%
130
- );
131
- }
132
-
133
- .button__variant_primary:active:not(:disabled),
134
- .button__variant_primary:hover:not(:disabled),
135
- .button__variant_primary[aria-pressed="true"]:not(:disabled) {
136
- background-color: color-mix(in oklab, var(--color-primary-9) 100%, #ffffff 10%);
137
- }
138
-
139
- :global(.dark) .button__variant_primary {
140
- background-image: linear-gradient(
141
- to bottom,
142
- color-mix(in oklab, transparent 100%, #000000 0%) 50%,
143
- color-mix(in oklab, transparent 100%, #000000 5%) 50%
144
- );
145
- }
146
-
147
- /* Secondary */
148
- .button__variant_secondary {
149
- color: black;
150
- background-color: var(--color-gray-2);
151
- background-image: linear-gradient(
152
- to bottom,
153
- color-mix(in oklab, transparent 100%, #000000 0%) 50%,
154
- color-mix(in oklab, transparent 100%, #000000 2%) 50%
155
- );
156
- box-shadow: 0 0 0 1px var(--color-gray-4) inset;
157
- }
158
-
159
- .button__variant_secondary:active:not(:disabled),
160
- .button__variant_secondary:hover:not(:disabled),
161
- .button__variant_secondary[aria-pressed="true"]:not(:disabled) {
162
- background-color: var(--color-gray-3);
163
- }
164
-
165
- :global(.dark) .button__variant_secondary {
166
- color: white;
167
- background-image: linear-gradient(
168
- to bottom,
169
- color-mix(in oklab, transparent 100%, #ffffff 1%) 50%,
170
- color-mix(in oklab, transparent 100%, #ffffff 0%) 50%
171
- );
172
- }
173
-
174
- /* ===================================================== */
175
- /* Width */
176
- /* ===================================================== */
177
- .button__width_base {
178
- width: max-content; /* Fit the button content */
179
- }
180
-
181
- .button__width_full {
182
- width: 100%;
183
- }
@@ -1,4 +0,0 @@
1
- .column {
2
- display: flex;
3
- flex-direction: column;
4
- }
@@ -1,27 +0,0 @@
1
- .dialog_responsive_backdrop {
2
- --backdrop-opacity: 0.25;
3
- background-color: black;
4
- inset: 0;
5
- opacity: calc(var(--backdrop-opacity) * (1 - var(--drawer-swipe-progress)));
6
- outline-color: var(--color-primary-9);
7
- position: fixed;
8
- transition-duration: 150ms;
9
- transition-property: opacity;
10
- }
11
-
12
- .dialog_responsive_backdrop[data-ending-style],
13
- .dialog_responsive_backdrop[data-starting-style] {
14
- opacity: 0;
15
- }
16
-
17
- .dialog_responsive_backdrop[data-ending-style] {
18
- transition-duration: calc(var(--drawer-swipe-strength) * 400ms);
19
- }
20
-
21
- .dialog_responsive_backdrop[data-swiping] {
22
- transition-duration: 0ms;
23
- }
24
-
25
- :global(.dark) .dialog_responsive_backdrop {
26
- --backdrop-opacity: 0.75;
27
- }
@@ -1,14 +0,0 @@
1
- .dialog_responsive_bar {
2
- background-color: var(--color-gray-4);
3
- border-radius: 9999px;
4
- display: none;
5
- height: 4px;
6
- margin: 12px auto;
7
- width: 48px;
8
- }
9
-
10
- @media (max-width: 640px) {
11
- .dialog_responsive_bar {
12
- display: block;
13
- }
14
- }
@@ -1,58 +0,0 @@
1
- .dialog_responsive_popup {
2
- background-color: var(--color-gray-1);
3
- border-radius: 16px;
4
- cursor: auto;
5
- display: flex;
6
- flex-direction: column;
7
- max-width: 640px;
8
- outline-color: var(--color-primary-9);
9
- outline-offset: -4px;
10
- outline-style: solid;
11
- outline-width: 0;
12
- padding: 16px;
13
- transition-duration: 150ms;
14
- transition-property: opacity, transform;
15
- width: 100%;
16
- will-change: opacity, transform;
17
- }
18
-
19
- .dialog_responsive_popup:focus-visible {
20
- outline-width: 2px;
21
- }
22
-
23
- /* Desktop */
24
- .dialog_responsive_popup[data-ending-style],
25
- .dialog_responsive_popup[data-starting-style] {
26
- opacity: 0;
27
- transform: scale(0.975);
28
- }
29
-
30
- .dialog_responsive_popup[data-swiping] {
31
- user-select: none;
32
- }
33
-
34
- /* Mobile */
35
- @media (max-width: 640px) {
36
- .dialog_responsive_popup {
37
- --radius-mobile: 24px;
38
- border-bottom-left-radius: 0;
39
- border-bottom-right-radius: 0;
40
- border-top-left-radius: var(--radius-mobile);
41
- border-top-right-radius: var(--radius-mobile);
42
- padding-top: 0;
43
- transform: translateY(var(--drawer-swipe-movement-y));
44
- transition-duration: 450ms;
45
- transition-property: transform;
46
- transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
47
- }
48
-
49
- .dialog_responsive_popup[data-ending-style],
50
- .dialog_responsive_popup[data-starting-style] {
51
- opacity: 1;
52
- transform: scale(1) translateY(100%);
53
- }
54
-
55
- .dialog_responsive_popup[data-ending-style] {
56
- transition-duration: calc(var(--drawer-swipe-strength) * 300ms);
57
- }
58
- }
@@ -1,5 +0,0 @@
1
- .dialog_responsive_portal {
2
- isolation: isolate;
3
- position: relative;
4
- z-index: 30;
5
- }
@@ -1,16 +0,0 @@
1
- .dialog_responsive_viewport {
2
- align-items: safe center;
3
- cursor: pointer;
4
- display: flex;
5
- inset: 0;
6
- justify-content: safe center;
7
- padding: 24px;
8
- position: fixed;
9
- }
10
-
11
- @media (max-width: 640px) {
12
- .dialog_responsive_viewport {
13
- align-items: safe flex-end;
14
- padding: 48px 0 0;
15
- }
16
- }
@@ -1,97 +0,0 @@
1
- /* ===================================================== */
2
- /* Base */
3
- /* ===================================================== */
4
- .input {
5
- appearance: none;
6
- background-color: var(--color-bg-primary);
7
- border-style: none;
8
- box-shadow: 0 0 0 1px var(--color-border) inset;
9
- color: var(--color-text-primary);
10
- cursor: text;
11
- font-family: var(--font-body);
12
- font-size: 14px;
13
- font-weight: 500;
14
- line-height: 1.5;
15
- outline-color: transparent;
16
- outline-offset: -2px;
17
- outline-style: solid;
18
- outline-width: 2px;
19
- text-decoration: none;
20
- transition-duration: 150ms;
21
- transition-property: box-shadow, opacity;
22
- width: 100%;
23
- }
24
-
25
- .input::placeholder {
26
- color: var(--color-gray-9);
27
- user-select: none;
28
- }
29
-
30
- .input:disabled {
31
- cursor: not-allowed;
32
- opacity: 0.5;
33
- }
34
-
35
- .input:enabled:active,
36
- .input:enabled:focus,
37
- .input:enabled:hover,
38
- .input:enabled[data-is-active="true"] {
39
- box-shadow: 0 0 0 1px var(--color-gray-6) inset;
40
- }
41
-
42
- .input[data-is-valid="true"] {
43
- outline-color: #30a46c;
44
- }
45
-
46
- .input[data-is-invalid="true"] {
47
- outline-color: #e5484d;
48
- }
49
-
50
- /* Focus overrides valid and invalid */
51
- .input:focus-visible {
52
- outline-color: var(--color-outline);
53
- }
54
-
55
- /* ===================================================== */
56
- /* Rounded */
57
- /* ===================================================== */
58
- .input__rounded_base {
59
- border-radius: 12px;
60
- }
61
-
62
- .input__rounded_full {
63
- border-radius: 9999px;
64
- }
65
-
66
- /* ===================================================== */
67
- /* Size */
68
- /* ===================================================== */
69
- .input__size_32 {
70
- border-radius: 8px;
71
- min-height: 32px;
72
- padding: 0 8px;
73
- }
74
-
75
- .input__size_36 {
76
- border-radius: 10px;
77
- min-height: 36px;
78
- padding: 0 10px;
79
- }
80
-
81
- .input__size_40 {
82
- border-radius: 12px;
83
- min-height: 40px;
84
- padding: 0 12px;
85
- }
86
-
87
- .input__size_44 {
88
- border-radius: 14px;
89
- min-height: 44px;
90
- padding: 0 14px;
91
- }
92
-
93
- .input__size_48 {
94
- border-radius: 16px;
95
- min-height: 48px;
96
- padding: 0 16px;
97
- }
@@ -1,8 +0,0 @@
1
- /* ===================================================== */
2
- /* Base */
3
- /* ===================================================== */
4
- .label {
5
- color: var(--color-text-secondary);
6
- font-size: 14px;
7
- width: fit-content;
8
- }
@@ -1,4 +0,0 @@
1
- .row {
2
- display: flex;
3
- flex-direction: row;
4
- }
@@ -1,3 +0,0 @@
1
- .spacer {
2
- flex-shrink: 0;
3
- }
@@ -1,62 +0,0 @@
1
- /* ===================================================== */
2
- /* Base */
3
- /* ===================================================== */
4
- .switch {
5
- background-color: var(--color-gray-6);
6
- border-radius: 9999px;
7
- cursor: pointer;
8
- display: flex;
9
- outline-color: var(--color-primary-9);
10
- outline-offset: 2px;
11
- outline-style: solid;
12
- outline-width: 0;
13
- overflow: hidden;
14
- padding: 2px;
15
- transition-duration: 150ms;
16
- transition-property: background-color;
17
- }
18
-
19
- .switch:focus-visible {
20
- outline-width: 2px;
21
- }
22
-
23
- .switch[data-checked] {
24
- background-color: var(--color-primary-9);
25
- }
26
-
27
- .switch[data-disabled] {
28
- cursor: not-allowed;
29
- opacity: 0.5;
30
- }
31
-
32
- /* ===================================================== */
33
- /* Thumb */
34
- /* ===================================================== */
35
-
36
- .switch__thumb {
37
- height: 100%;
38
- aspect-ratio: 1 / 1;
39
- background-color: white;
40
- border-radius: 9999px;
41
- transition-duration: 150ms;
42
- transition-property: transform;
43
- }
44
-
45
- .switch__thumb[data-checked] {
46
- transform: translateX(var(--translateX));
47
- }
48
-
49
- /* ===================================================== */
50
- /* Size */
51
- /* ===================================================== */
52
- .switch__size_18 {
53
- --translateX: 12px;
54
- width: 30px;
55
- height: 18px;
56
- }
57
-
58
- .switch__size_24 {
59
- --translateX: 16px;
60
- width: 40px;
61
- height: 24px;
62
- }
@@ -1,12 +0,0 @@
1
- .tabs_panel {
2
- display: flex;
3
- flex-direction: column;
4
- outline-color: var(--color-primary-9);
5
- outline-offset: -2px;
6
- outline-style: solid;
7
- outline-width: 0px;
8
- }
9
-
10
- .tabs_panel:focus-visible {
11
- outline-width: 2px;
12
- }
@@ -1,12 +0,0 @@
1
- .tabs_pill_indicator {
2
- background-color: var(--color-gray-12);
3
- border-radius: 12px;
4
- height: var(--active-tab-height);
5
- left: var(--active-tab-left);
6
- position: absolute;
7
- top: var(--active-tab-top);
8
- transition-duration: 150ms;
9
- transition-property: left, width;
10
- width: var(--active-tab-width);
11
- z-index: -1;
12
- }
@@ -1,7 +0,0 @@
1
- .tabs_pill_list {
2
- column-gap: 8px;
3
- display: flex;
4
- isolation: isolate;
5
- overflow-x: auto;
6
- position: relative;
7
- }