@fea-ui/styles 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (39) hide show
  1. package/README.md +2 -14
  2. package/package.json +7 -8
  3. package/src/components/accordion.css +22 -26
  4. package/src/components/alert-dialog.css +50 -0
  5. package/src/components/alert.css +46 -0
  6. package/src/components/button-group.css +4 -4
  7. package/src/components/button.css +42 -32
  8. package/src/components/card.css +1 -1
  9. package/src/components/checkbox-group.css +1 -1
  10. package/src/components/checkbox.css +1 -1
  11. package/src/components/chip.css +10 -10
  12. package/src/components/container.css +1 -1
  13. package/src/components/description.css +3 -0
  14. package/src/components/dialog.css +13 -1
  15. package/src/components/drawer.css +84 -0
  16. package/src/components/field-error.css +3 -0
  17. package/src/components/fieldset.css +9 -0
  18. package/src/components/index.css +27 -17
  19. package/src/components/input.css +25 -27
  20. package/src/components/label.css +5 -1
  21. package/src/components/link.css +22 -16
  22. package/src/components/list.css +2 -2
  23. package/src/components/menu.css +48 -0
  24. package/src/components/meter.css +1 -1
  25. package/src/components/navbar.css +12 -14
  26. package/src/components/popover.css +11 -0
  27. package/src/components/progress.css +72 -0
  28. package/src/components/radio.css +31 -0
  29. package/src/components/sidebar.css +65 -0
  30. package/src/components/slider.css +25 -0
  31. package/src/components/switch.css +19 -19
  32. package/src/components/table.css +31 -0
  33. package/src/components/tabs.css +32 -32
  34. package/src/components/text-field.css +4 -0
  35. package/src/components/text.css +1 -1
  36. package/src/components/toggle-button.css +4 -4
  37. package/src/styles.css +99 -104
  38. package/src/components/field.css +0 -12
  39. package/src/components/textarea.css +0 -1
@@ -1,37 +1,35 @@
1
- /** Base Styling */
2
- .input {
3
- @apply bg-input text-input-foreground rounded border;
4
- @apply w-full px-3 py-2;
5
-
6
- @apply transition-all motion-reduce:transition-none;
7
-
8
- @media (hover: hover) {
9
- &:hover:not([data-disabled]) {
10
- @apply brightness-90;
11
- }
12
- }
13
-
14
- &:disabled {
15
- @apply status-disabled;
16
- }
17
-
18
- &:valid {
19
- @apply status-valid;
20
- }
21
-
22
- &:invalid:not(:placeholder-shown) {
23
- @apply status-invalid;
24
- }
1
+ .input,
2
+ .textarea {
3
+ @apply bg-input text-input-foreground rounded border;
4
+ @apply w-full px-3 py-2;
5
+
6
+ @apply transition-[brightness] motion-reduce:transition-none;
7
+
8
+ &::placeholder {
9
+ @apply text-muted-foreground;
10
+ }
11
+
12
+ &[data-focused] {
13
+ @apply status-focused;
14
+ }
15
+
16
+ &:disabled {
17
+ @apply status-disabled;
18
+ }
19
+
20
+ &[data-invalid] {
21
+ @apply border-danger;
22
+ }
25
23
  }
26
24
 
27
25
  .input--sm {
28
- @apply h-8 text-sm;
26
+ @apply h-8 text-sm;
29
27
  }
30
28
 
31
29
  .input--md {
32
- @apply h-10;
30
+ @apply h-10;
33
31
  }
34
32
 
35
33
  .input--lg {
36
- @apply h-12;
34
+ @apply h-12;
37
35
  }
@@ -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,29 +1,35 @@
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
4
 
5
- &:visited {
6
- @apply text-link/70;
7
- }
5
+ @apply transition-[color] motion-reduce:transition-none;
8
6
 
9
- &:hover {
10
- @apply text-link/80;
11
- }
7
+ &:visited {
8
+ @apply text-link/70;
9
+ }
12
10
 
13
- &[data-active] {
14
- @apply font-semibold;
15
- }
11
+ &:hover {
12
+ @apply text-link/80;
13
+ }
16
14
 
17
- &:disabled,
18
- [data-disabled] {
19
- @apply text-muted cursor-not-allowed;
20
- }
15
+ &[data-active] {
16
+ @apply font-semibold;
17
+ }
18
+
19
+ &:disabled,
20
+ [data-disabled] {
21
+ @apply text-muted cursor-not-allowed;
22
+ }
23
+
24
+ svg {
25
+ @apply size-4 text-muted-foreground;
26
+ }
21
27
  }
22
28
 
23
29
  .link--underline {
24
- @apply underline;
30
+ @apply underline;
25
31
  }
26
32
 
27
33
  .link--no-underline {
28
- @apply no-underline;
34
+ @apply no-underline;
29
35
  }
@@ -1,8 +1,8 @@
1
1
  /** Base Styling */
2
2
  .list {
3
- @apply flex flex-col gap-1;
3
+ @apply flex flex-col gap-1;
4
4
  }
5
5
 
6
6
  .list__item {
7
- @apply cursor-pointer;
7
+ @apply cursor-pointer;
8
8
  }
@@ -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
+ }
@@ -18,7 +18,7 @@
18
18
  .meter__indicator {
19
19
  @apply block rounded;
20
20
 
21
- @apply transition-all motion-reduce:transition-none;
21
+ @apply transition-[width] motion-reduce:transition-none;
22
22
  }
23
23
 
24
24
  /** Variants */
@@ -1,38 +1,36 @@
1
1
  /** Base Styling */
2
2
  .navbar {
3
- @apply bg-secondary/50 border-border relative z-50 flex h-[var(--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 {
7
- @apply mx-auto flex w-full max-w-7xl items-center justify-between;
7
+ @apply mx-auto flex w-full max-w-7xl items-center justify-between;
8
8
  }
9
9
 
10
10
  .navbar__content {
11
- @apply flex items-center gap-2;
11
+ @apply flex items-center gap-2;
12
12
  }
13
13
 
14
14
  .navbar__toggle {
15
- @apply md:hidden;
15
+ @apply md:hidden;
16
+
17
+ svg {
18
+ @apply size-5 me-2;
19
+ }
16
20
  }
17
21
 
18
22
  .navbar__list {
19
- @apply hidden md:flex md:items-center md:gap-6;
23
+ @apply flex items-center gap-4;
20
24
  }
21
25
 
22
26
  .navbar__list-item {
23
- @apply list-none;
27
+ @apply list-none;
24
28
  }
25
29
 
26
30
  .navbar__menu {
27
- @apply bg-secondary/50 absolute top-16 left-0 hidden w-full flex-col border border-b py-4 md:hidden;
28
-
29
- @apply transition-[height] motion-reduce:transition-none;
30
-
31
- &[data-expanded="true"] {
32
- @apply flex;
33
- }
31
+ @apply flex flex-col gap-1;
34
32
  }
35
33
 
36
34
  .navbar__menu-item {
37
- @apply w-full list-none px-4 py-2;
35
+ @apply w-full list-none px-4 py-2;
38
36
  }
@@ -0,0 +1,11 @@
1
+ .popover {
2
+ @apply bg-overlay text-overlay-foreground rounded shadow;
3
+ @apply px-3 py-2;
4
+
5
+ @apply transition-[opacity,scale] motion-reduce:transition-none;
6
+
7
+ &[data-entering],
8
+ &[data-exiting] {
9
+ @apply opacity-0 scale-90;
10
+ }
11
+ }
@@ -0,0 +1,72 @@
1
+ /** Base Styling */
2
+ .progress {
3
+ @apply grid grid-cols-2 items-center gap-1;
4
+ }
5
+
6
+ .progress__label {
7
+ @apply font-medium;
8
+ }
9
+
10
+ .progress__value {
11
+ @apply col-start-2 m-0 text-right text-sm leading-5;
12
+ }
13
+
14
+ .progress__track {
15
+ @apply col-span-2 block w-48 overflow-hidden rounded shadow-inner;
16
+ }
17
+
18
+ .progress__indicator {
19
+ @apply block rounded;
20
+
21
+ @apply transition-[width] motion-reduce:transition-none;
22
+ }
23
+
24
+ /** Variants */
25
+ .progress--primary .progress__track {
26
+ @apply bg-primary/10;
27
+ }
28
+
29
+ .progress--primary .progress__indicator {
30
+ @apply bg-primary;
31
+ }
32
+
33
+ .progress--secondary .progress__track {
34
+ @apply bg-secondary/10;
35
+ }
36
+
37
+ .progress--secondary .progress__indicator {
38
+ @apply bg-secondary;
39
+ }
40
+
41
+ .progress--success .progress__track {
42
+ @apply bg-success/10;
43
+ }
44
+
45
+ .progress--success .progress__indicator {
46
+ @apply bg-success;
47
+ }
48
+
49
+ .progress--danger .progress__track {
50
+ @apply bg-danger/10;
51
+ }
52
+
53
+ .progress--danger .progress__indicator {
54
+ @apply bg-danger;
55
+ }
56
+
57
+ /** Sizes */
58
+ .progress--sm .progress__track {
59
+ @apply h-2;
60
+ }
61
+
62
+ .progress--sm .progress__label {
63
+ @apply text-sm;
64
+ }
65
+
66
+ .progress--md .progress__track {
67
+ @apply h-3;
68
+ }
69
+
70
+ .progress--lg .progress__track {
71
+ @apply h-4;
72
+ }
@@ -0,0 +1,31 @@
1
+ .radio__group {
2
+ @apply flex flex-col gap-4;
3
+ }
4
+
5
+ .radio {
6
+ @apply flex size-5 items-center justify-center rounded-full;
7
+
8
+ &[data-unchecked] {
9
+ @apply border-border bg-secondary;
10
+ }
11
+
12
+ &[data-checked] {
13
+ @apply border-primary bg-primary;
14
+ }
15
+
16
+ &:focus-visible {
17
+ @apply status-focused;
18
+ }
19
+ }
20
+
21
+ .radio__indicator {
22
+ @apply flex items-center justify-center;
23
+
24
+ &[data-unchecked] {
25
+ @apply hidden;
26
+ }
27
+
28
+ &::before {
29
+ @apply block size-2 rounded-full bg-background content-[''];
30
+ }
31
+ }
@@ -0,0 +1,65 @@
1
+ .sidebar {
2
+ @apply flex h-full w-full;
3
+ }
4
+
5
+ .sidebar__panel {
6
+ @apply fixed top-0 left-0 h-full w-64;
7
+
8
+ @apply flex flex-col;
9
+
10
+ @apply bg-surface shadow-lg text-surface-foreground;
11
+
12
+ @apply transition-transform duration-300 ease-in-out motion-reduce:transition-none;
13
+ }
14
+
15
+ .sidebar__header {
16
+ @apply flex items-center justify-between gap-3 p-4;
17
+ @apply border-b;
18
+ }
19
+
20
+ .sidebar__content {
21
+ @apply flex-1 p-4;
22
+ }
23
+
24
+ .sidebar__footer {
25
+ @apply border-t;
26
+ @apply p-4;
27
+ }
28
+
29
+ .sidebar__outlet {
30
+ @apply md:ml-64;
31
+
32
+ @apply transition-[margin] duration-300 ease-in-out motion-reduce:transition-none;
33
+ }
34
+
35
+ /**
36
+ * State
37
+ */
38
+
39
+ [data-open="false"] {
40
+ .sidebar__panel {
41
+ @apply -translate-x-full;
42
+ }
43
+
44
+ .sidebar__outlet {
45
+ @apply ml-0;
46
+ }
47
+ }
48
+
49
+ .sidebar__trigger {
50
+ @apply cursor-pointer;
51
+ @apply size-8 flex items-center justify-center;
52
+ @apply rounded border-border text-muted-foreground;
53
+
54
+ @apply transition-[color] motion-reduce:transition-none;
55
+
56
+ @media (hover: hover) {
57
+ &:hover {
58
+ @apply text-foreground;
59
+ }
60
+ }
61
+
62
+ :focus-visible {
63
+ @apply status-focused;
64
+ }
65
+ }
@@ -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,40 +1,40 @@
1
1
  /** Base Styling */
2
2
  .switch {
3
- @apply cursor-pointer;
3
+ @apply cursor-pointer;
4
4
 
5
- @apply bg-secondary/50 relative flex cursor-pointer rounded-full border-2;
5
+ @apply bg-secondary/50 relative flex cursor-pointer rounded-full border-2;
6
6
 
7
- &:active {
8
- @apply bg-secondary;
9
- }
7
+ &:active {
8
+ @apply bg-secondary;
9
+ }
10
10
 
11
- &:focus-visible {
12
- @apply status-focused;
13
- }
11
+ &:focus-visible {
12
+ @apply status-focused;
13
+ }
14
14
 
15
- &[data-disabled] {
16
- @apply status-disabled;
17
- }
15
+ &[data-disabled] {
16
+ @apply status-disabled;
17
+ }
18
18
  }
19
19
 
20
20
  .switch__thumb {
21
- @apply bg-primary aspect-square h-full rounded-full shadow;
21
+ @apply bg-primary aspect-square h-full rounded-full shadow;
22
22
 
23
- @apply transition-[translate] motion-reduce:transition-none;
23
+ @apply transition-[translate] motion-reduce:transition-none;
24
24
 
25
- &[data-checked] {
26
- @apply translate-x-full;
27
- }
25
+ &[data-checked] {
26
+ @apply translate-x-full;
27
+ }
28
28
  }
29
29
 
30
30
  .switch--sm {
31
- @apply h-4 w-7;
31
+ @apply h-4 w-7;
32
32
  }
33
33
 
34
34
  .switch--md {
35
- @apply h-6 w-10;
35
+ @apply h-6 w-10;
36
36
  }
37
37
 
38
38
  .switch--lg {
39
- @apply h-8 w-14;
39
+ @apply h-8 w-14;
40
40
  }
@@ -1 +1,32 @@
1
1
  /** Base Styling */
2
+ .table {
3
+ @apply w-full border-collapse bg-surface text-surface-foreground;
4
+ }
5
+
6
+ .table__thead {
7
+ @apply bg-secondary text-secondary-foreground;
8
+ }
9
+
10
+ .table__th {
11
+ @apply border-border px-4 py-2 text-left font-medium;
12
+ }
13
+
14
+ .table__tbody {
15
+ @apply divide-y divide-border;
16
+ }
17
+
18
+ .table__tr {
19
+ @apply cursor-pointer;
20
+
21
+ &:hover {
22
+ @apply bg-secondary/50;
23
+ }
24
+ }
25
+
26
+ .table__td {
27
+ @apply border-border px-4 py-2;
28
+ }
29
+
30
+ .table__caption {
31
+ @apply mt-2 text-sm text-secondary-foreground;
32
+ }
@@ -1,49 +1,49 @@
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 {
11
- @apply m-0 flex appearance-none items-center justify-center border-0 bg-transparent outline-none;
12
- @apply text-muted-foreground break-keep whitespace-nowrap select-none;
13
- @apply h-8 px-2 py-0;
14
-
15
- &[data-active] {
16
- @apply text-foreground;
17
- }
18
-
19
- @media (hover: hover) {
20
- &:hover {
21
- @apply text-foreground;
22
- }
23
- }
24
-
25
- &:focus-visible {
26
- @apply relative;
27
-
28
- &::before {
29
- content: "";
30
- @apply outline-primary absolute inset-x-0 inset-y-1 rounded outline-2 -outline-offset-1;
31
- }
32
- }
11
+ @apply m-0 flex appearance-none items-center justify-center border-0 bg-transparent outline-none;
12
+ @apply text-muted-foreground break-keep whitespace-nowrap select-none;
13
+ @apply h-8 px-2 py-0;
14
+
15
+ &[data-active] {
16
+ @apply text-foreground;
17
+ }
18
+
19
+ @media (hover: hover) {
20
+ &:hover {
21
+ @apply text-foreground;
22
+ }
23
+ }
24
+
25
+ &:focus-visible {
26
+ @apply relative;
27
+
28
+ &::before {
29
+ content: "";
30
+ @apply outline-primary absolute inset-x-0 inset-y-1 rounded outline-2 -outline-offset-1;
31
+ }
32
+ }
33
33
  }
34
34
 
35
35
  .tabs__indicator {
36
- @apply bg-primary absolute bottom-0 left-0 -z-10 h-px;
37
- @apply transition-[translate,width] motion-reduce:transition-none;
36
+ width: var(--active-tab-width);
38
37
 
39
- translate: var(--active-tab-left) -50%;
40
- width: var(--active-tab-width);
38
+ translate: var(--active-tab-left) -50%;
39
+ @apply bg-primary absolute bottom-0 left-0 -z-10 h-px;
40
+ @apply transition-[translate,width] motion-reduce:transition-none;
41
41
  }
42
42
 
43
43
  .tabs__panel {
44
- @apply relative flex h-32 items-center justify-center outline-none;
44
+ @apply relative flex h-32 items-center justify-center outline-none;
45
45
 
46
- &:focus-visible {
47
- @apply status-focused;
48
- }
46
+ &:focus-visible {
47
+ @apply status-focused;
48
+ }
49
49
  }
@@ -0,0 +1,4 @@
1
+ /** Base Styling */
2
+ .text-field {
3
+ @apply flex flex-col gap-1;
4
+ }
@@ -1,4 +1,4 @@
1
1
  /** Base Styling */
2
2
  .text {
3
- @apply text-danger;
3
+ @apply text-danger;
4
4
  }
@@ -1,8 +1,8 @@
1
1
  /** Base Styling */
2
2
  .toggle-button {
3
- @apply brightness-50;
3
+ @apply brightness-50;
4
4
 
5
- &[data-pressed] {
6
- @apply brightness-100;
7
- }
5
+ &[data-pressed] {
6
+ @apply brightness-100;
7
+ }
8
8
  }