@fea-ui/styles 0.1.0-alpha.8 → 0.1.0-alpha.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fea-ui/styles",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0-alpha.9",
4
4
  "description": "FeaUI Styles - Tailwind CSS styles for FeaUI components",
5
5
  "keywords": [
6
6
  "fea-ui",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "scripts": {
37
37
  "build:css": "bunx @tailwindcss/cli -i src/styles.css -o dist/index.css --minify",
38
- "check": "biome check --write"
38
+ "check": "biome check --write",
39
+ "gen:exports": "bun run scripts/gen-exports.mjs"
39
40
  },
40
41
  "dependencies": {
41
42
  "tailwindcss": "^4.1.18"
@@ -1,5 +1,5 @@
1
1
  .accordion {
2
- @apply bg-card text-card-foreground flex w-full max-w-md flex-col justify-center;
2
+ @apply bg-surface text-surface-foreground flex w-full max-w-md flex-col justify-center;
3
3
  }
4
4
 
5
5
  .accordion__trigger {
@@ -0,0 +1,46 @@
1
+ .alert {
2
+ @apply flex items-start justify-between p-5 rounded border bg-surface shadow;
3
+
4
+ @apply w-full;
5
+ }
6
+
7
+ .alert__indicator {
8
+ @apply shrink-0 mr-4 mt-1;
9
+
10
+ svg {
11
+ @apply size-5;
12
+ }
13
+ }
14
+
15
+ .alert__content {
16
+ @apply flex-1 flex flex-col gap-1;
17
+ }
18
+
19
+ .alert__title {
20
+ @apply font-medium;
21
+ }
22
+
23
+ .alert__description {
24
+ @apply text-sm text-muted-foreground;
25
+ }
26
+
27
+ /* Variants */
28
+ .alert--primary {
29
+ @apply text-primary;
30
+ }
31
+
32
+ .alert--danger {
33
+ @apply text-red-500;
34
+ }
35
+
36
+ .alert--success {
37
+ @apply text-green-500;
38
+ }
39
+
40
+ .alert--warning {
41
+ @apply text-yellow-500;
42
+ }
43
+
44
+ .alert--info {
45
+ @apply text-blue-500;
46
+ }
@@ -8,22 +8,26 @@
8
8
 
9
9
  @apply transition-[scale] motion-reduce:transition-none;
10
10
 
11
- &:hover:not([data-disabled]) {
11
+ &[data-hovered] {
12
12
  @apply brightness-90;
13
13
  }
14
14
 
15
- &:active {
16
- @apply scale-95;
15
+ &[data-focused] {
16
+ @apply status-focused;
17
17
  }
18
18
 
19
- &:focus-visible {
20
- @apply status-focused;
19
+ &:active {
20
+ @apply scale-95;
21
21
  }
22
22
 
23
23
  &[data-disabled] {
24
24
  @apply status-disabled;
25
25
  }
26
26
 
27
+ &[data-pending] {
28
+ @apply status-pending;
29
+ }
30
+
27
31
  svg {
28
32
  @apply size-5 shrink-0;
29
33
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  /** Variants */
9
9
  .card--default {
10
- @apply bg-card text-card-foreground;
10
+ @apply bg-surface text-surface-foreground;
11
11
  }
12
12
 
13
13
  .card--transparent {
@@ -1,4 +1,4 @@
1
1
  /** Base Styling */
2
2
  .checkbox-group {
3
- @apply flex flex-col items-start gap-4;
3
+ @apply flex flex-col;
4
4
  }
@@ -0,0 +1,3 @@
1
+ .description {
2
+ @apply text-muted-foreground text-sm;
3
+ }
@@ -10,9 +10,9 @@
10
10
  }
11
11
 
12
12
  .drawer__popup {
13
- @apply box-border fixed p-3;
13
+ @apply fixed p-3 z-50;
14
14
 
15
- @apply bg-card text-card-foreground shadow;
15
+ @apply bg-surface text-surface-foreground shadow;
16
16
 
17
17
  @apply transition-[translate] motion-reduce:transition-none;
18
18
  }
@@ -0,0 +1,3 @@
1
+ .field-error {
2
+ @apply text-danger text-sm;
3
+ }
@@ -1,32 +1,35 @@
1
- @import "./input.css";
2
- @import "./textarea.css";
3
1
  @import "./meter.css";
2
+ @import "./label.css";
3
+ @import "./toggle-button.css";
4
4
  @import "./list.css";
5
- @import "./navbar.css";
6
- @import "./checkbox-group.css";
7
- @import "./card.css";
8
- @import "./avatar.css";
9
- @import "./button-group.css";
5
+ @import "./radio.css";
10
6
  @import "./accordion.css";
11
- @import "./label.css";
12
- @import "./menu.css";
13
- @import "./chip.css";
14
7
  @import "./link.css";
15
- @import "./container.css";
8
+ @import "./checkbox.css";
16
9
  @import "./tabs.css";
17
- @import "./button.css";
10
+ @import "./drawer.css";
11
+ @import "./fieldset.css";
12
+ @import "./button-group.css";
13
+ @import "./checkbox-group.css";
14
+ @import "./description.css";
15
+ @import "./chip.css";
16
+ @import "./container.css";
17
+ @import "./navbar.css";
18
+ @import "./slider.css";
19
+ @import "./avatar.css";
20
+ @import "./text-field.css";
18
21
  @import "./text.css";
19
- @import "./form.css";
20
- @import "./separator.css";
21
22
  @import "./switch.css";
22
- @import "./checkbox.css";
23
- @import "./field.css";
24
- @import "./toggle-button.css";
23
+ @import "./popover.css";
24
+ @import "./input.css";
25
25
  @import "./table.css";
26
- @import "./dialog.css";
27
26
  @import "./alert-dialog.css";
28
- @import "./fieldset.css";
29
- @import "./drawer.css";
30
- @import "./popover.css";
31
27
  @import "./progress.css";
32
- @import "./radio.css";
28
+ @import "./card.css";
29
+ @import "./form.css";
30
+ @import "./field-error.css";
31
+ @import "./dialog.css";
32
+ @import "./menu.css";
33
+ @import "./button.css";
34
+ @import "./separator.css";
35
+ @import "./alert.css";
@@ -1,22 +1,24 @@
1
- /** Base Styling */
2
- .input {
1
+ .input,
2
+ .textarea {
3
3
  @apply bg-input text-input-foreground rounded border;
4
4
  @apply w-full px-3 py-2;
5
5
 
6
6
  @apply transition-[brightness] motion-reduce:transition-none;
7
7
 
8
- @media (hover: hover) {
9
- &:hover:not([data-disabled]) {
10
- @apply brightness-90;
11
- }
8
+ &::placeholder {
9
+ @apply text-muted-foreground;
10
+ }
11
+
12
+ &[data-focused] {
13
+ @apply status-focused;
12
14
  }
13
15
 
14
16
  &:disabled {
15
17
  @apply status-disabled;
16
18
  }
17
19
 
18
- &:invalid:not(:placeholder-shown) {
19
- @apply status-invalid;
20
+ &[data-invalid] {
21
+ @apply border-danger;
20
22
  }
21
23
  }
22
24
 
@@ -1,4 +1,8 @@
1
1
  /** Base Styling */
2
2
  .label {
3
- @apply flex items-center gap-2 select-none;
3
+ @apply font-medium text-foreground leading-none;
4
+ }
5
+
6
+ [data-required="true"] .label {
7
+ @apply after:content-['*'] after:ml-0.5 after:text-danger;
4
8
  }
@@ -1,6 +1,8 @@
1
1
  /** Base Styling */
2
2
  .link {
3
- @apply text-link underline-offset-2 transition-colors;
3
+ @apply text-link underline-offset-2 inline-flex items-center;
4
+
5
+ @apply transition-[color] motion-reduce:transition-none;
4
6
 
5
7
  &:visited {
6
8
  @apply text-link/70;
@@ -18,6 +20,10 @@
18
20
  [data-disabled] {
19
21
  @apply text-muted cursor-not-allowed;
20
22
  }
23
+
24
+ svg {
25
+ @apply size-4 text-muted-foreground;
26
+ }
21
27
  }
22
28
 
23
29
  .link--underline {
@@ -0,0 +1,48 @@
1
+ .menu__positioner {
2
+ @apply outline-0;
3
+ }
4
+
5
+ .menu__popup {
6
+ @apply p-3 rounded;
7
+
8
+ @apply bg-popover text-popover-foreground shadow;
9
+
10
+ @apply transition-[transform,scale] motion-reduce:transition-none;
11
+
12
+ &[data-starting-style],
13
+ &[data-ending-style] {
14
+ @apply opacity-0 scale-90;
15
+ }
16
+ }
17
+
18
+ .menu__arrow {
19
+ @apply flex text-popover size-6;
20
+
21
+ &[data-side="top"] {
22
+ @apply -bottom-3 rotate-180;
23
+ }
24
+
25
+ &[data-side="right"] {
26
+ @apply -start-3 rotate-90;
27
+ }
28
+
29
+ &[data-side="bottom"] {
30
+ @apply -top-3;
31
+ }
32
+
33
+ &[data-side="left"] {
34
+ @apply -end-3 -rotate-90;
35
+ }
36
+ }
37
+
38
+ .menu__item {
39
+ @apply select-none relative flex items-center px-3 py-2 rounded text-sm leading-none cursor-pointer;
40
+
41
+ &:focus {
42
+ @apply outline-none bg-secondary text-secondary-foreground;
43
+ }
44
+ }
45
+
46
+ .menu__separator {
47
+ @apply my-2 h-px bg-border;
48
+ }
@@ -1,6 +1,6 @@
1
1
  /** Base Styling */
2
2
  .navbar {
3
- @apply bg-secondary/50 border-border relative z-50 flex h-(--navbar-height) w-full items-center justify-between border-b px-4 py-2;
3
+ @apply bg-surface/50 border-border relative z-50 flex h-(--navbar-height) w-full items-center justify-between border-b px-4 py-2;
4
4
  }
5
5
 
6
6
  .navbar__container {
@@ -15,7 +15,7 @@
15
15
  @apply md:hidden;
16
16
 
17
17
  svg {
18
- @apply size-4;
18
+ @apply size-5 me-2;
19
19
  }
20
20
  }
21
21
 
@@ -1,54 +1,11 @@
1
- .popover__trigger {
2
- @apply transition-[scale] motion-reduce:transition-none;
1
+ .popover {
2
+ @apply bg-overlay text-overlay-foreground rounded shadow;
3
+ @apply px-3 py-2;
3
4
 
4
- &[data-popup-open] {
5
- @apply scale-95;
6
- }
7
- }
8
-
9
- .popover__positioner {
10
- width: var(--positioner-width);
11
- max-width: var(--available-width);
12
- height: var(--positioner-width);
13
- }
14
-
15
- .popover__popup {
16
- @apply box-border p-3 rounded;
17
-
18
- @apply bg-popover text-popover-foreground shadow;
5
+ @apply transition-[opacity,scale] motion-reduce:transition-none;
19
6
 
20
- @apply transition-[transform,scale] motion-reduce:transition-none;
21
-
22
- &[data-starting-style],
23
- &[data-ending-style] {
7
+ &[data-entering],
8
+ &[data-exiting] {
24
9
  @apply opacity-0 scale-90;
25
10
  }
26
11
  }
27
-
28
- .popover__arrow {
29
- @apply flex text-popover size-6;
30
-
31
- &[data-side="top"] {
32
- @apply -bottom-3 rotate-180;
33
- }
34
-
35
- &[data-side="right"] {
36
- @apply -start-3 rotate-90;
37
- }
38
-
39
- &[data-side="bottom"] {
40
- @apply -top-3;
41
- }
42
-
43
- &[data-side="left"] {
44
- @apply -end-3 -rotate-90;
45
- }
46
- }
47
-
48
- .popover__title {
49
- @apply text-lg font-medium;
50
- }
51
-
52
- .popover__description {
53
- @apply text-sm text-muted-foreground;
54
- }
@@ -3,7 +3,7 @@
3
3
  }
4
4
 
5
5
  .radio {
6
- @apply box-border flex size-5 items-center justify-center rounded-full;
6
+ @apply flex size-5 items-center justify-center rounded-full;
7
7
 
8
8
  &[data-unchecked] {
9
9
  @apply border-border bg-secondary;
@@ -0,0 +1,25 @@
1
+ .slider__control {
2
+ @apply flex w-full touch-none select-none items-center py-3;
3
+ }
4
+
5
+ .slider__track {
6
+ @apply relative h-1 w-full rounded bg-secondary shadow-inner shadow-secondary select-none;
7
+ }
8
+
9
+ .slider__indicator {
10
+ @apply absolute rounded bg-primary select-none;
11
+ }
12
+
13
+ .slider__thumb {
14
+ @apply size-4 rounded-full bg-primary outline outline-border select-none;
15
+
16
+ @apply transition-[box-shadow,transform,outline] motion-reduce:transition-none;
17
+
18
+ &:focus-visible {
19
+ @apply status-focused;
20
+ }
21
+
22
+ &:active {
23
+ @apply scale-90;
24
+ }
25
+ }
@@ -1,6 +1,6 @@
1
1
  /** Base Styling */
2
2
  .table {
3
- @apply w-full border-collapse bg-card;
3
+ @apply w-full border-collapse bg-surface text-surface-foreground;
4
4
  }
5
5
 
6
6
  .table__thead {
@@ -1,10 +1,10 @@
1
1
  /** Base Styling */
2
2
  .tabs {
3
- @apply bg-card/50 text-secondary-foreground rounded border;
3
+ @apply bg-surface/50 text-secondary-foreground rounded border;
4
4
  }
5
5
 
6
6
  .tabs__list {
7
- @apply bg-card relative z-0 flex gap-1 rounded-t border-b px-1;
7
+ @apply bg-surface relative z-0 flex gap-1 rounded-t border-b px-1;
8
8
  }
9
9
 
10
10
  .tabs__tab {
@@ -0,0 +1,4 @@
1
+ /** Base Styling */
2
+ .text-field {
3
+ @apply flex flex-col gap-1;
4
+ }
package/src/styles.css CHANGED
@@ -5,11 +5,11 @@
5
5
  --navbar-height: 4rem;
6
6
  --radius: 0.625rem;
7
7
 
8
- --background: oklch(1 0 0);
8
+ --background: oklch(0.9702 0 0);
9
9
  --foreground: oklch(0.145 0 0);
10
10
 
11
- --card: oklch(1 0 0);
12
- --card-foreground: oklch(0.145 0 0);
11
+ --surface: oklch(1 0 0);
12
+ --surface-foreground: oklch(0.145 0 0);
13
13
  --popover: oklch(1 0 0);
14
14
  --popover-foreground: oklch(0.145 0 0);
15
15
  --input: oklch(0.922 0 0);
@@ -19,7 +19,7 @@
19
19
 
20
20
  --primary: oklch(0.205 0 0);
21
21
  --primary-foreground: oklch(0.985 0 0);
22
- --secondary: oklch(0.97 0 0);
22
+ --secondary: oklch(0.91 0.0013 286.37);
23
23
  --secondary-foreground: oklch(0.205 0 0);
24
24
  --muted: oklch(0.97 0 0);
25
25
  --muted-foreground: oklch(0.556 0 0);
@@ -39,8 +39,10 @@
39
39
  --background: oklch(0.145 0 0);
40
40
  --foreground: oklch(0.985 0 0);
41
41
 
42
- --card: oklch(0.205 0 0);
43
- --card-foreground: oklch(0.985 0 0);
42
+ --surface: oklch(0.205 0 0);
43
+ --surface-foreground: oklch(0.985 0 0);
44
+ --overlay: oklch(0.205 0 0);
45
+ --overlay-foreground: oklch(0.985 0 0);
44
46
  --popover: oklch(0.205 0 0);
45
47
  --popover-foreground: oklch(0.985 0 0);
46
48
  --input: oklch(1 0 0 / 15%);
@@ -70,8 +72,10 @@
70
72
  --color-background: var(--background);
71
73
  --color-foreground: var(--foreground);
72
74
 
73
- --color-card: var(--card);
74
- --color-card-foreground: var(--card-foreground);
75
+ --color-surface: var(--surface);
76
+ --color-surface-foreground: var(--surface-foreground);
77
+ --color-overlay: var(--overlay);
78
+ --color-overlay-foreground: var(--overlay-foreground);
75
79
  --color-popover: var(--popover);
76
80
  --color-popover-foreground: var(--popover-foreground);
77
81
  --color-input: var(--input);
@@ -107,14 +111,6 @@
107
111
  @apply cursor-wait opacity-75;
108
112
  }
109
113
 
110
- @utility status-valid {
111
- @apply border-success;
112
- }
113
-
114
- @utility status-invalid {
115
- @apply border-danger;
116
- }
117
-
118
114
  @layer base {
119
115
  * {
120
116
  @apply border-border outline-ring/50;
@@ -1,12 +0,0 @@
1
- /** Base Styling */
2
- .field {
3
- @apply flex flex-col gap-1;
4
- }
5
-
6
- .field__description {
7
- @apply text-muted-foreground text-sm;
8
- }
9
-
10
- .field__error {
11
- @apply text-danger text-sm;
12
- }
@@ -1 +0,0 @@
1
- /** Base Styling */