@poppyui/core 0.1.0 → 0.1.2-next.0c371f0

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 (56) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +225 -166
  3. package/dist/components/accordion.css +1 -1
  4. package/dist/components/button.css +3 -3
  5. package/dist/components/checkbox.css +2 -2
  6. package/dist/components/drawer.css +4 -4
  7. package/dist/components/dropdown.css +3 -3
  8. package/dist/components/input.css +2 -2
  9. package/dist/components/modal.css +6 -6
  10. package/dist/components/progress.css +1 -1
  11. package/dist/components/radio.css +1 -1
  12. package/dist/components/skeleton.css +1 -1
  13. package/dist/components/stat.css +1 -1
  14. package/dist/components/tabs.css +2 -2
  15. package/dist/components/toast.css +2 -2
  16. package/dist/components/toggle.css +1 -1
  17. package/dist/core.css +2 -0
  18. package/dist/poppy.css +32 -30
  19. package/dist/poppy.min.css +1 -1
  20. package/package.json +53 -53
  21. package/src/base/base.css +40 -40
  22. package/src/components/accordion.css +98 -98
  23. package/src/components/alert.css +58 -58
  24. package/src/components/avatar.css +67 -67
  25. package/src/components/badge.css +87 -87
  26. package/src/components/breadcrumbs.css +68 -68
  27. package/src/components/button.css +139 -139
  28. package/src/components/card.css +87 -87
  29. package/src/components/checkbox.css +77 -77
  30. package/src/components/divider.css +46 -46
  31. package/src/components/drawer.css +84 -84
  32. package/src/components/dropdown.css +100 -100
  33. package/src/components/field.css +71 -71
  34. package/src/components/input.css +127 -127
  35. package/src/components/join.css +70 -70
  36. package/src/components/kbd.css +35 -35
  37. package/src/components/loading.css +74 -74
  38. package/src/components/menu.css +147 -147
  39. package/src/components/modal.css +83 -83
  40. package/src/components/navbar.css +54 -54
  41. package/src/components/progress.css +91 -91
  42. package/src/components/radio.css +65 -65
  43. package/src/components/range.css +83 -83
  44. package/src/components/skeleton.css +43 -43
  45. package/src/components/stat.css +54 -54
  46. package/src/components/steps.css +100 -100
  47. package/src/components/table.css +65 -65
  48. package/src/components/tabs.css +125 -125
  49. package/src/components/toast.css +80 -80
  50. package/src/components/toggle.css +76 -76
  51. package/src/components/tooltip.css +59 -59
  52. package/src/core.css +7 -7
  53. package/src/poppy.css +34 -34
  54. package/src/themes/dark.css +33 -31
  55. package/src/themes/light.css +33 -32
  56. package/src/tokens/tokens.css +52 -52
@@ -1,54 +1,54 @@
1
- /*
2
- * Stat
3
- * <div class="stats">
4
- * <div class="stat">
5
- * <div class="stat-title">Revenue</div>
6
- * <div class="stat-value">$12k</div>
7
- * <div class="stat-desc">+8% this month</div>
8
- * </div>
9
- * </div>
10
- */
11
- @layer poppy.tokens, poppy.base, poppy.components;
12
-
13
- @layer poppy.components {
14
- .stats {
15
- display: flex;
16
- flex-wrap: wrap;
17
- border: 1px solid var(--color-border);
18
- border-radius: var(--radius-lg);
19
- background: var(--color-base-100);
20
- color: var(--color-base-content);
21
- overflow: hidden;
22
-
23
- & > .stat {
24
- flex: 1 1 10rem;
25
- /* Hairlines between items; still works when items wrap. */
26
- box-shadow:
27
- 1px 0 0 0 var(--color-border),
28
- 0 1px 0 0 var(--color-border);
29
- }
30
- }
31
-
32
- .stat {
33
- display: flex;
34
- flex-direction: column;
35
- gap: var(--space-1);
36
- padding: var(--space-4) var(--space-6);
37
- }
38
-
39
- .stat-title {
40
- color: var(--color-muted);
41
- font-size: var(--text-sm);
42
- }
43
-
44
- .stat-value {
45
- font-size: 1.875rem;
46
- font-weight: var(--weight-semibold);
47
- line-height: 1.2;
48
- }
49
-
50
- .stat-desc {
51
- color: var(--color-muted);
52
- font-size: var(--text-sm);
53
- }
54
- }
1
+ /*
2
+ * Stat
3
+ * <div class="stats">
4
+ * <div class="stat">
5
+ * <div class="stat-title">Revenue</div>
6
+ * <div class="stat-value">$12k</div>
7
+ * <div class="stat-desc">+8% this month</div>
8
+ * </div>
9
+ * </div>
10
+ */
11
+ @layer poppy.tokens, poppy.base, poppy.components;
12
+
13
+ @layer poppy.components {
14
+ .stats {
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ border: 1px solid var(--color-border);
18
+ border-radius: var(--radius-lg);
19
+ background: var(--color-base-100);
20
+ color: var(--color-base-content);
21
+ overflow: hidden;
22
+
23
+ & > .stat {
24
+ flex: 1 1 10rem;
25
+ /* Hairlines between items; still works when items wrap. */
26
+ box-shadow:
27
+ 1px 0 0 0 var(--color-border),
28
+ 0 1px 0 0 var(--color-border);
29
+ }
30
+ }
31
+
32
+ .stat {
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: var(--space-1);
36
+ padding: var(--space-4) var(--space-6);
37
+ }
38
+
39
+ .stat-title {
40
+ color: var(--color-muted);
41
+ font-size: var(--text-sm);
42
+ }
43
+
44
+ .stat-value {
45
+ font-size: 1.875rem;
46
+ font-weight: var(--weight-semibold);
47
+ line-height: 1.2;
48
+ }
49
+
50
+ .stat-desc {
51
+ color: var(--color-muted);
52
+ font-size: var(--text-sm);
53
+ }
54
+ }
@@ -1,100 +1,100 @@
1
- /*
2
- * Steps: zero JS. Numbers come from a CSS counter; the line connects each step to the next.
3
- *
4
- * <ol class="steps">
5
- * <li class="step step-done">Account</li>
6
- * <li class="step" aria-current="step">Profile</li>
7
- * <li class="step">Finish</li>
8
- * </ol>
9
- *
10
- * Modifier: .steps-vertical. Done steps: .step-done; current: [aria-current="step"].
11
- */
12
- @layer poppy.tokens, poppy.base, poppy.components;
13
-
14
- @layer poppy.components {
15
- .steps {
16
- --step-size: 2rem;
17
-
18
- display: flex;
19
- margin: 0;
20
- padding: 0;
21
- list-style: none;
22
- counter-reset: poppy-step;
23
- color: var(--color-base-content);
24
- font-size: var(--text-sm);
25
- }
26
-
27
- .step {
28
- --step-bg: var(--color-base-300);
29
- --step-fg: var(--color-base-content);
30
- --step-line: var(--color-border);
31
-
32
- position: relative;
33
- display: grid;
34
- flex: 1;
35
- justify-items: center;
36
- align-content: start;
37
- gap: var(--space-2);
38
- counter-increment: poppy-step;
39
- text-align: center;
40
-
41
- /* Circle. */
42
- &::before {
43
- content: counter(poppy-step);
44
- z-index: 1;
45
- display: grid;
46
- place-items: center;
47
- inline-size: var(--step-size);
48
- block-size: var(--step-size);
49
- border-radius: var(--radius-full);
50
- background: var(--step-bg);
51
- color: var(--step-fg);
52
- font-weight: var(--weight-semibold);
53
- }
54
-
55
- /* Connecting line, from this circle's center to the next one's. */
56
- &:not(:last-child)::after {
57
- content: "";
58
- position: absolute;
59
- inset-block-start: calc(var(--step-size) / 2 - 1px);
60
- inset-inline-start: 50%;
61
- inline-size: 100%;
62
- block-size: 2px;
63
- background: var(--step-line);
64
- }
65
-
66
- &.step-done,
67
- &[aria-current="step"] {
68
- --step-bg: var(--color-primary);
69
- --step-fg: var(--color-primary-content);
70
- }
71
-
72
- &.step-done {
73
- --step-line: var(--color-primary);
74
- }
75
-
76
- &[aria-current="step"] {
77
- font-weight: var(--weight-semibold);
78
- }
79
- }
80
-
81
- .steps-vertical {
82
- flex-direction: column;
83
-
84
- & .step {
85
- grid-template-columns: var(--step-size) 1fr;
86
- justify-items: start;
87
- align-items: center;
88
- column-gap: var(--space-3);
89
- min-block-size: 3.5rem;
90
- text-align: start;
91
-
92
- &:not(:last-child)::after {
93
- inset-block-start: var(--step-size);
94
- inset-inline-start: calc(var(--step-size) / 2 - 1px);
95
- inline-size: 2px;
96
- block-size: calc(100% - var(--step-size));
97
- }
98
- }
99
- }
100
- }
1
+ /*
2
+ * Steps: zero JS. Numbers come from a CSS counter; the line connects each step to the next.
3
+ *
4
+ * <ol class="steps">
5
+ * <li class="step step-done">Account</li>
6
+ * <li class="step" aria-current="step">Profile</li>
7
+ * <li class="step">Finish</li>
8
+ * </ol>
9
+ *
10
+ * Modifier: .steps-vertical. Done steps: .step-done; current: [aria-current="step"].
11
+ */
12
+ @layer poppy.tokens, poppy.base, poppy.components;
13
+
14
+ @layer poppy.components {
15
+ .steps {
16
+ --step-size: 2rem;
17
+
18
+ display: flex;
19
+ margin: 0;
20
+ padding: 0;
21
+ list-style: none;
22
+ counter-reset: poppy-step;
23
+ color: var(--color-base-content);
24
+ font-size: var(--text-sm);
25
+ }
26
+
27
+ .step {
28
+ --step-bg: var(--color-base-300);
29
+ --step-fg: var(--color-base-content);
30
+ --step-line: var(--color-border);
31
+
32
+ position: relative;
33
+ display: grid;
34
+ flex: 1;
35
+ justify-items: center;
36
+ align-content: start;
37
+ gap: var(--space-2);
38
+ counter-increment: poppy-step;
39
+ text-align: center;
40
+
41
+ /* Circle. */
42
+ &::before {
43
+ content: counter(poppy-step);
44
+ z-index: 1;
45
+ display: grid;
46
+ place-items: center;
47
+ inline-size: var(--step-size);
48
+ block-size: var(--step-size);
49
+ border-radius: var(--radius-full);
50
+ background: var(--step-bg);
51
+ color: var(--step-fg);
52
+ font-weight: var(--weight-semibold);
53
+ }
54
+
55
+ /* Connecting line, from this circle's center to the next one's. */
56
+ &:not(:last-child)::after {
57
+ content: "";
58
+ position: absolute;
59
+ inset-block-start: calc(var(--step-size) / 2 - 1px);
60
+ inset-inline-start: 50%;
61
+ inline-size: 100%;
62
+ block-size: 2px;
63
+ background: var(--step-line);
64
+ }
65
+
66
+ &.step-done,
67
+ &[aria-current="step"] {
68
+ --step-bg: var(--color-primary);
69
+ --step-fg: var(--color-primary-content);
70
+ }
71
+
72
+ &.step-done {
73
+ --step-line: var(--color-primary);
74
+ }
75
+
76
+ &[aria-current="step"] {
77
+ font-weight: var(--weight-semibold);
78
+ }
79
+ }
80
+
81
+ .steps-vertical {
82
+ flex-direction: column;
83
+
84
+ & .step {
85
+ grid-template-columns: var(--step-size) 1fr;
86
+ justify-items: start;
87
+ align-items: center;
88
+ column-gap: var(--space-3);
89
+ min-block-size: 3.5rem;
90
+ text-align: start;
91
+
92
+ &:not(:last-child)::after {
93
+ inset-block-start: var(--step-size);
94
+ inset-inline-start: calc(var(--step-size) / 2 - 1px);
95
+ inline-size: 2px;
96
+ block-size: calc(100% - var(--step-size));
97
+ }
98
+ }
99
+ }
100
+ }
@@ -1,65 +1,65 @@
1
- /*
2
- * Table
3
- * <div class="table-wrap" role="region" aria-label="Users" tabindex="0">
4
- * <table class="table table-zebra table-hover">
5
- * <thead><tr><th scope="col">Name</th></tr></thead>
6
- * <tbody><tr><td>Ada</td></tr></tbody>
7
- * </table>
8
- * </div>
9
- * Modifiers: table-zebra | table-hover | table-sm.
10
- * .table-wrap scrolls horizontally on narrow screens; keep tabindex="0" + a labelled region so keyboard users can scroll.
11
- */
12
- @layer poppy.tokens, poppy.base, poppy.components;
13
-
14
- @layer poppy.components {
15
- .table-wrap {
16
- overflow-x: auto;
17
- max-inline-size: 100%;
18
-
19
- &:focus-visible {
20
- outline: var(--focus-width) solid var(--color-focus);
21
- outline-offset: var(--focus-offset);
22
- }
23
- }
24
-
25
- .table {
26
- --table-py: var(--space-3);
27
- --table-px: var(--space-4);
28
-
29
- inline-size: 100%;
30
- border-collapse: collapse;
31
- color: var(--color-base-content);
32
- font-size: var(--text-sm);
33
-
34
- & :is(th, td) {
35
- padding: var(--table-py) var(--table-px);
36
- border-block-end: 1px solid var(--color-border);
37
- text-align: start;
38
- }
39
-
40
- & thead th {
41
- background: var(--color-base-200);
42
- font-weight: var(--weight-semibold);
43
- white-space: nowrap;
44
- }
45
-
46
- & caption {
47
- padding-block-end: var(--space-2);
48
- color: var(--color-muted);
49
- text-align: start;
50
- }
51
- }
52
-
53
- .table-zebra tbody tr:nth-child(even) {
54
- background: var(--color-base-200);
55
- }
56
-
57
- .table-hover tbody tr:hover {
58
- background: color-mix(in oklch, var(--color-base-content) 8%, var(--color-base-100));
59
- }
60
-
61
- .table-sm {
62
- --table-py: var(--space-1);
63
- --table-px: var(--space-2);
64
- }
65
- }
1
+ /*
2
+ * Table
3
+ * <div class="table-wrap" role="region" aria-label="Users" tabindex="0">
4
+ * <table class="table table-zebra table-hover">
5
+ * <thead><tr><th scope="col">Name</th></tr></thead>
6
+ * <tbody><tr><td>Ada</td></tr></tbody>
7
+ * </table>
8
+ * </div>
9
+ * Modifiers: table-zebra | table-hover | table-sm.
10
+ * .table-wrap scrolls horizontally on narrow screens; keep tabindex="0" + a labelled region so keyboard users can scroll.
11
+ */
12
+ @layer poppy.tokens, poppy.base, poppy.components;
13
+
14
+ @layer poppy.components {
15
+ .table-wrap {
16
+ overflow-x: auto;
17
+ max-inline-size: 100%;
18
+
19
+ &:focus-visible {
20
+ outline: var(--focus-width) solid var(--color-focus);
21
+ outline-offset: var(--focus-offset);
22
+ }
23
+ }
24
+
25
+ .table {
26
+ --table-py: var(--space-3);
27
+ --table-px: var(--space-4);
28
+
29
+ inline-size: 100%;
30
+ border-collapse: collapse;
31
+ color: var(--color-base-content);
32
+ font-size: var(--text-sm);
33
+
34
+ & :is(th, td) {
35
+ padding: var(--table-py) var(--table-px);
36
+ border-block-end: 1px solid var(--color-border);
37
+ text-align: start;
38
+ }
39
+
40
+ & thead th {
41
+ background: var(--color-base-200);
42
+ font-weight: var(--weight-semibold);
43
+ white-space: nowrap;
44
+ }
45
+
46
+ & caption {
47
+ padding-block-end: var(--space-2);
48
+ color: var(--color-muted);
49
+ text-align: start;
50
+ }
51
+ }
52
+
53
+ .table-zebra tbody tr:nth-child(even) {
54
+ background: var(--color-base-200);
55
+ }
56
+
57
+ .table-hover tbody tr:hover {
58
+ background: color-mix(in oklch, var(--color-base-content) 8%, var(--color-base-100));
59
+ }
60
+
61
+ .table-sm {
62
+ --table-py: var(--space-1);
63
+ --table-px: var(--space-2);
64
+ }
65
+ }