@poppyui/core 0.1.0 → 0.1.1

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 (53) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +166 -166
  3. package/dist/components/accordion.css +1 -1
  4. package/dist/components/button.css +3 -3
  5. package/dist/components/checkbox.css +1 -1
  6. package/dist/components/drawer.css +4 -4
  7. package/dist/components/dropdown.css +3 -3
  8. package/dist/components/input.css +1 -1
  9. package/dist/components/modal.css +6 -6
  10. package/dist/components/progress.css +1 -1
  11. package/dist/components/skeleton.css +1 -1
  12. package/dist/components/stat.css +1 -1
  13. package/dist/components/tabs.css +2 -2
  14. package/dist/components/toast.css +2 -2
  15. package/dist/components/toggle.css +1 -1
  16. package/dist/poppy.css +27 -27
  17. package/package.json +53 -53
  18. package/src/base/base.css +40 -40
  19. package/src/components/accordion.css +98 -98
  20. package/src/components/alert.css +58 -58
  21. package/src/components/avatar.css +67 -67
  22. package/src/components/badge.css +87 -87
  23. package/src/components/breadcrumbs.css +68 -68
  24. package/src/components/button.css +139 -139
  25. package/src/components/card.css +87 -87
  26. package/src/components/checkbox.css +77 -77
  27. package/src/components/divider.css +46 -46
  28. package/src/components/drawer.css +84 -84
  29. package/src/components/dropdown.css +100 -100
  30. package/src/components/field.css +71 -71
  31. package/src/components/input.css +127 -127
  32. package/src/components/join.css +70 -70
  33. package/src/components/kbd.css +35 -35
  34. package/src/components/loading.css +74 -74
  35. package/src/components/menu.css +147 -147
  36. package/src/components/modal.css +83 -83
  37. package/src/components/navbar.css +54 -54
  38. package/src/components/progress.css +91 -91
  39. package/src/components/radio.css +65 -65
  40. package/src/components/range.css +83 -83
  41. package/src/components/skeleton.css +43 -43
  42. package/src/components/stat.css +54 -54
  43. package/src/components/steps.css +100 -100
  44. package/src/components/table.css +65 -65
  45. package/src/components/tabs.css +125 -125
  46. package/src/components/toast.css +80 -80
  47. package/src/components/toggle.css +76 -76
  48. package/src/components/tooltip.css +59 -59
  49. package/src/core.css +7 -7
  50. package/src/poppy.css +34 -34
  51. package/src/themes/dark.css +31 -31
  52. package/src/themes/light.css +32 -32
  53. package/src/tokens/tokens.css +52 -52
@@ -1,147 +1,147 @@
1
- /*
2
- * Menu: zero JS. Vertical navigation list; nested <details> make collapsible submenus.
3
- *
4
- * <ul class="menu">
5
- * <li class="menu-title">Group</li>
6
- * <li><a href="#" aria-current="page">Dashboard</a></li>
7
- * <li><button type="button">Settings</button></li>
8
- * <li>
9
- * <details>
10
- * <summary>More</summary>
11
- * <ul><li><a href="#">Sub item</a></li></ul>
12
- * </details>
13
- * </li>
14
- * </ul>
15
- *
16
- * Modifiers: .menu-horizontal, .menu-sm, .menu-lg. Active item: [aria-current="page"] or .active.
17
- */
18
- @layer poppy.tokens, poppy.base, poppy.components;
19
-
20
- @layer poppy.components {
21
- .menu {
22
- --menu-pad: var(--space-2) var(--space-3);
23
- --menu-font: var(--text-md);
24
-
25
- display: flex;
26
- flex-direction: column;
27
- gap: 2px;
28
- margin: 0;
29
- padding: var(--space-1);
30
- list-style: none;
31
- color: var(--color-base-content);
32
- font-size: var(--menu-font);
33
-
34
- &.menu-sm {
35
- --menu-pad: var(--space-1) var(--space-2);
36
- --menu-font: var(--text-sm);
37
- }
38
-
39
- &.menu-lg {
40
- --menu-pad: var(--space-3) var(--space-4);
41
- --menu-font: var(--text-lg);
42
- }
43
-
44
- &.menu-horizontal {
45
- flex-direction: row;
46
- flex-wrap: wrap;
47
- align-items: center;
48
- }
49
-
50
- & ul {
51
- display: flex;
52
- flex-direction: column;
53
- gap: 2px;
54
- margin: 0;
55
- margin-inline-start: var(--space-4);
56
- padding: 0;
57
- padding-inline-start: var(--space-2);
58
- border-inline-start: 1px solid var(--color-border);
59
- list-style: none;
60
- }
61
-
62
- & :is(a, button, summary) {
63
- display: flex;
64
- align-items: center;
65
- gap: var(--space-2);
66
- inline-size: 100%;
67
- padding: var(--menu-pad);
68
- border: 0;
69
- border-radius: var(--radius-sm);
70
- background: transparent;
71
- color: inherit;
72
- font: inherit;
73
- text-align: start;
74
- text-decoration: none;
75
- cursor: pointer;
76
- transition: background-color var(--duration-fast) var(--ease-out);
77
-
78
- &:hover {
79
- background: var(--color-base-200);
80
- }
81
-
82
- &:focus-visible {
83
- outline: var(--focus-width) solid var(--color-focus);
84
- outline-offset: -2px;
85
- }
86
-
87
- &[aria-current="page"],
88
- &.active {
89
- background: color-mix(in oklch, var(--color-primary) 14%, var(--color-base-100));
90
- font-weight: var(--weight-semibold);
91
- }
92
- }
93
-
94
- & summary {
95
- list-style: none;
96
- justify-content: space-between;
97
-
98
- &::-webkit-details-marker {
99
- display: none;
100
- }
101
-
102
- &::marker {
103
- content: "";
104
- }
105
-
106
- &::after {
107
- content: "";
108
- flex: none;
109
- inline-size: 0.4rem;
110
- block-size: 0.4rem;
111
- border-inline-end: 2px solid currentColor;
112
- border-block-end: 2px solid currentColor;
113
- rotate: 45deg;
114
- transition: rotate var(--duration-fast) var(--ease-out);
115
- }
116
- }
117
-
118
- & details[open] > summary::after {
119
- rotate: -135deg;
120
- }
121
-
122
- &.menu-horizontal > li > details {
123
- position: relative;
124
-
125
- & > ul {
126
- position: absolute;
127
- inset-block-start: 100%;
128
- inset-inline-start: 0;
129
- z-index: 1;
130
- min-inline-size: 10rem;
131
- margin: var(--space-1) 0 0;
132
- padding: var(--space-1);
133
- border: 1px solid var(--color-border);
134
- border-radius: var(--radius-md);
135
- background: var(--color-base-100);
136
- box-shadow: var(--shadow-md);
137
- }
138
- }
139
- }
140
-
141
- .menu-title {
142
- padding: var(--menu-pad);
143
- color: var(--color-muted);
144
- font-size: var(--text-sm);
145
- font-weight: var(--weight-semibold);
146
- }
147
- }
1
+ /*
2
+ * Menu: zero JS. Vertical navigation list; nested <details> make collapsible submenus.
3
+ *
4
+ * <ul class="menu">
5
+ * <li class="menu-title">Group</li>
6
+ * <li><a href="#" aria-current="page">Dashboard</a></li>
7
+ * <li><button type="button">Settings</button></li>
8
+ * <li>
9
+ * <details>
10
+ * <summary>More</summary>
11
+ * <ul><li><a href="#">Sub item</a></li></ul>
12
+ * </details>
13
+ * </li>
14
+ * </ul>
15
+ *
16
+ * Modifiers: .menu-horizontal, .menu-sm, .menu-lg. Active item: [aria-current="page"] or .active.
17
+ */
18
+ @layer poppy.tokens, poppy.base, poppy.components;
19
+
20
+ @layer poppy.components {
21
+ .menu {
22
+ --menu-pad: var(--space-2) var(--space-3);
23
+ --menu-font: var(--text-md);
24
+
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 2px;
28
+ margin: 0;
29
+ padding: var(--space-1);
30
+ list-style: none;
31
+ color: var(--color-base-content);
32
+ font-size: var(--menu-font);
33
+
34
+ &.menu-sm {
35
+ --menu-pad: var(--space-1) var(--space-2);
36
+ --menu-font: var(--text-sm);
37
+ }
38
+
39
+ &.menu-lg {
40
+ --menu-pad: var(--space-3) var(--space-4);
41
+ --menu-font: var(--text-lg);
42
+ }
43
+
44
+ &.menu-horizontal {
45
+ flex-direction: row;
46
+ flex-wrap: wrap;
47
+ align-items: center;
48
+ }
49
+
50
+ & ul {
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: 2px;
54
+ margin: 0;
55
+ margin-inline-start: var(--space-4);
56
+ padding: 0;
57
+ padding-inline-start: var(--space-2);
58
+ border-inline-start: 1px solid var(--color-border);
59
+ list-style: none;
60
+ }
61
+
62
+ & :is(a, button, summary) {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: var(--space-2);
66
+ inline-size: 100%;
67
+ padding: var(--menu-pad);
68
+ border: 0;
69
+ border-radius: var(--radius-sm);
70
+ background: transparent;
71
+ color: inherit;
72
+ font: inherit;
73
+ text-align: start;
74
+ text-decoration: none;
75
+ cursor: pointer;
76
+ transition: background-color var(--duration-fast) var(--ease-out);
77
+
78
+ &:hover {
79
+ background: var(--color-base-200);
80
+ }
81
+
82
+ &:focus-visible {
83
+ outline: var(--focus-width) solid var(--color-focus);
84
+ outline-offset: -2px;
85
+ }
86
+
87
+ &[aria-current="page"],
88
+ &.active {
89
+ background: color-mix(in oklch, var(--color-primary) 14%, var(--color-base-100));
90
+ font-weight: var(--weight-semibold);
91
+ }
92
+ }
93
+
94
+ & summary {
95
+ list-style: none;
96
+ justify-content: space-between;
97
+
98
+ &::-webkit-details-marker {
99
+ display: none;
100
+ }
101
+
102
+ &::marker {
103
+ content: "";
104
+ }
105
+
106
+ &::after {
107
+ content: "";
108
+ flex: none;
109
+ inline-size: 0.4rem;
110
+ block-size: 0.4rem;
111
+ border-inline-end: 2px solid currentColor;
112
+ border-block-end: 2px solid currentColor;
113
+ rotate: 45deg;
114
+ transition: rotate var(--duration-fast) var(--ease-out);
115
+ }
116
+ }
117
+
118
+ & details[open] > summary::after {
119
+ rotate: -135deg;
120
+ }
121
+
122
+ &.menu-horizontal > li > details {
123
+ position: relative;
124
+
125
+ & > ul {
126
+ position: absolute;
127
+ inset-block-start: 100%;
128
+ inset-inline-start: 0;
129
+ z-index: 1;
130
+ min-inline-size: 10rem;
131
+ margin: var(--space-1) 0 0;
132
+ padding: var(--space-1);
133
+ border: 1px solid var(--color-border);
134
+ border-radius: var(--radius-md);
135
+ background: var(--color-base-100);
136
+ box-shadow: var(--shadow-md);
137
+ }
138
+ }
139
+ }
140
+
141
+ .menu-title {
142
+ padding: var(--menu-pad);
143
+ color: var(--color-muted);
144
+ font-size: var(--text-sm);
145
+ font-weight: var(--weight-semibold);
146
+ }
147
+ }
@@ -1,83 +1,83 @@
1
- /*
2
- * Modal: zero JS. Native <dialog> gives focus trapping, Esc to close and inert background.
3
- *
4
- * <button class="btn" commandfor="m1" command="show-modal">Open</button>
5
- * <dialog id="m1" class="modal" aria-labelledby="m1-title" closedby="any">
6
- * <h2 id="m1-title" class="modal-title">Title</h2>
7
- * <p>Body</p>
8
- * <div class="modal-actions">
9
- * <button class="btn" commandfor="m1" command="close">Close</button>
10
- * </div>
11
- * </dialog>
12
- */
13
- @layer poppy.tokens, poppy.base, poppy.components;
14
-
15
- @layer poppy.components {
16
- .modal {
17
- inline-size: min(32rem, 100% - 2 * var(--space-4));
18
- max-block-size: min(85dvh, 100% - 2 * var(--space-4));
19
- padding: var(--space-6);
20
- border: 1px solid var(--color-border);
21
- border-radius: var(--radius-lg);
22
- background: var(--color-base-100);
23
- color: var(--color-base-content);
24
- box-shadow: var(--shadow-lg);
25
- overflow: auto;
26
- overscroll-behavior: contain;
27
-
28
- /* Exit state (also the state we transition back to on close). */
29
- opacity: 0;
30
- translate: 0 var(--space-2);
31
- scale: 0.96;
32
- transition:
33
- opacity var(--duration-normal) var(--ease-out),
34
- translate var(--duration-normal) var(--ease-out),
35
- scale var(--duration-normal) var(--ease-out),
36
- overlay var(--duration-normal) allow-discrete,
37
- display var(--duration-normal) allow-discrete;
38
-
39
- &[open] {
40
- opacity: 1;
41
- translate: 0 0;
42
- scale: 1;
43
-
44
- @starting-style {
45
- opacity: 0;
46
- translate: 0 var(--space-2);
47
- scale: 0.96;
48
- }
49
- }
50
-
51
- &::backdrop {
52
- background-color: transparent;
53
- transition:
54
- background-color var(--duration-normal) var(--ease-out),
55
- overlay var(--duration-normal) allow-discrete,
56
- display var(--duration-normal) allow-discrete;
57
- }
58
-
59
- &[open]::backdrop {
60
- background-color: var(--color-backdrop);
61
- }
62
-
63
- @starting-style {
64
- &[open]::backdrop {
65
- background-color: transparent;
66
- }
67
- }
68
- }
69
-
70
- .modal-title {
71
- margin: 0 0 var(--space-2);
72
- font-size: var(--text-xl);
73
- font-weight: var(--weight-semibold);
74
- }
75
-
76
- .modal-actions {
77
- display: flex;
78
- flex-wrap: wrap;
79
- justify-content: flex-end;
80
- gap: var(--space-2);
81
- margin-block-start: var(--space-6);
82
- }
83
- }
1
+ /*
2
+ * Modal: zero JS. Native <dialog> gives focus trapping, Esc to close and inert background.
3
+ *
4
+ * <button class="btn" commandfor="m1" command="show-modal">Open</button>
5
+ * <dialog id="m1" class="modal" aria-labelledby="m1-title" closedby="any">
6
+ * <h2 id="m1-title" class="modal-title">Title</h2>
7
+ * <p>Body</p>
8
+ * <div class="modal-actions">
9
+ * <button class="btn" commandfor="m1" command="close">Close</button>
10
+ * </div>
11
+ * </dialog>
12
+ */
13
+ @layer poppy.tokens, poppy.base, poppy.components;
14
+
15
+ @layer poppy.components {
16
+ .modal {
17
+ inline-size: min(32rem, 100% - 2 * var(--space-4));
18
+ max-block-size: min(85dvh, 100% - 2 * var(--space-4));
19
+ padding: var(--space-6);
20
+ border: 1px solid var(--color-border);
21
+ border-radius: var(--radius-lg);
22
+ background: var(--color-base-100);
23
+ color: var(--color-base-content);
24
+ box-shadow: var(--shadow-lg);
25
+ overflow: auto;
26
+ overscroll-behavior: contain;
27
+
28
+ /* Exit state (also the state we transition back to on close). */
29
+ opacity: 0;
30
+ translate: 0 var(--space-2);
31
+ scale: 0.96;
32
+ transition:
33
+ opacity var(--duration-normal) var(--ease-out),
34
+ translate var(--duration-normal) var(--ease-out),
35
+ scale var(--duration-normal) var(--ease-out),
36
+ overlay var(--duration-normal) allow-discrete,
37
+ display var(--duration-normal) allow-discrete;
38
+
39
+ &[open] {
40
+ opacity: 1;
41
+ translate: 0 0;
42
+ scale: 1;
43
+
44
+ @starting-style {
45
+ opacity: 0;
46
+ translate: 0 var(--space-2);
47
+ scale: 0.96;
48
+ }
49
+ }
50
+
51
+ &::backdrop {
52
+ background-color: transparent;
53
+ transition:
54
+ background-color var(--duration-normal) var(--ease-out),
55
+ overlay var(--duration-normal) allow-discrete,
56
+ display var(--duration-normal) allow-discrete;
57
+ }
58
+
59
+ &[open]::backdrop {
60
+ background-color: var(--color-backdrop);
61
+ }
62
+
63
+ @starting-style {
64
+ &[open]::backdrop {
65
+ background-color: transparent;
66
+ }
67
+ }
68
+ }
69
+
70
+ .modal-title {
71
+ margin: 0 0 var(--space-2);
72
+ font-size: var(--text-xl);
73
+ font-weight: var(--weight-semibold);
74
+ }
75
+
76
+ .modal-actions {
77
+ display: flex;
78
+ flex-wrap: wrap;
79
+ justify-content: flex-end;
80
+ gap: var(--space-2);
81
+ margin-block-start: var(--space-6);
82
+ }
83
+ }
@@ -1,54 +1,54 @@
1
- /*
2
- * Navbar: zero JS. App bar with start / center / end regions.
3
- *
4
- * <header class="navbar navbar-sticky">
5
- * <div class="navbar-start"><a href="/">Brand</a></div>
6
- * <nav class="navbar-center" aria-label="Main">...</nav>
7
- * <div class="navbar-end"><button class="btn">Sign in</button></div>
8
- * </header>
9
- *
10
- * .navbar-sticky pins the bar to the top of its scroll container.
11
- */
12
- @layer poppy.tokens, poppy.base, poppy.components;
13
-
14
- @layer poppy.components {
15
- .navbar {
16
- display: flex;
17
- align-items: center;
18
- gap: var(--space-4);
19
- min-block-size: 3.5rem;
20
- padding-inline: var(--space-4);
21
- border-block-end: 1px solid var(--color-border);
22
- background: var(--color-base-100);
23
- color: var(--color-base-content);
24
- }
25
-
26
- .navbar-sticky {
27
- position: sticky;
28
- inset-block-start: 0;
29
- z-index: 10;
30
- }
31
-
32
- .navbar-start,
33
- .navbar-center,
34
- .navbar-end {
35
- display: flex;
36
- align-items: center;
37
- gap: var(--space-2);
38
- }
39
-
40
- .navbar-start {
41
- flex: 1;
42
- justify-content: flex-start;
43
- }
44
-
45
- .navbar-center {
46
- flex: none;
47
- justify-content: center;
48
- }
49
-
50
- .navbar-end {
51
- flex: 1;
52
- justify-content: flex-end;
53
- }
54
- }
1
+ /*
2
+ * Navbar: zero JS. App bar with start / center / end regions.
3
+ *
4
+ * <header class="navbar navbar-sticky">
5
+ * <div class="navbar-start"><a href="/">Brand</a></div>
6
+ * <nav class="navbar-center" aria-label="Main">...</nav>
7
+ * <div class="navbar-end"><button class="btn">Sign in</button></div>
8
+ * </header>
9
+ *
10
+ * .navbar-sticky pins the bar to the top of its scroll container.
11
+ */
12
+ @layer poppy.tokens, poppy.base, poppy.components;
13
+
14
+ @layer poppy.components {
15
+ .navbar {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: var(--space-4);
19
+ min-block-size: 3.5rem;
20
+ padding-inline: var(--space-4);
21
+ border-block-end: 1px solid var(--color-border);
22
+ background: var(--color-base-100);
23
+ color: var(--color-base-content);
24
+ }
25
+
26
+ .navbar-sticky {
27
+ position: sticky;
28
+ inset-block-start: 0;
29
+ z-index: 10;
30
+ }
31
+
32
+ .navbar-start,
33
+ .navbar-center,
34
+ .navbar-end {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: var(--space-2);
38
+ }
39
+
40
+ .navbar-start {
41
+ flex: 1;
42
+ justify-content: flex-start;
43
+ }
44
+
45
+ .navbar-center {
46
+ flex: none;
47
+ justify-content: center;
48
+ }
49
+
50
+ .navbar-end {
51
+ flex: 1;
52
+ justify-content: flex-end;
53
+ }
54
+ }