@skra/ui 0.2.0
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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +39 -0
- package/consumer-guide/README.md +84 -0
- package/consumer-guide/accessible-names.md +80 -0
- package/consumer-guide/forms-and-binding.md +149 -0
- package/consumer-guide/layout.md +86 -0
- package/consumer-guide/overlays.md +100 -0
- package/consumer-guide/setup-and-gotchas.md +103 -0
- package/consumer-guide/theming-and-encapsulation.md +115 -0
- package/consumer-guide/wrapping-patterns.md +90 -0
- package/fesm2022/skra-ui-accordion.mjs +333 -0
- package/fesm2022/skra-ui-accordion.mjs.map +1 -0
- package/fesm2022/skra-ui-alert.mjs +110 -0
- package/fesm2022/skra-ui-alert.mjs.map +1 -0
- package/fesm2022/skra-ui-avatar.mjs +83 -0
- package/fesm2022/skra-ui-avatar.mjs.map +1 -0
- package/fesm2022/skra-ui-badge.mjs +91 -0
- package/fesm2022/skra-ui-badge.mjs.map +1 -0
- package/fesm2022/skra-ui-button.mjs +67 -0
- package/fesm2022/skra-ui-button.mjs.map +1 -0
- package/fesm2022/skra-ui-checkbox.mjs +98 -0
- package/fesm2022/skra-ui-checkbox.mjs.map +1 -0
- package/fesm2022/skra-ui-chip.mjs +82 -0
- package/fesm2022/skra-ui-chip.mjs.map +1 -0
- package/fesm2022/skra-ui-combobox.mjs +335 -0
- package/fesm2022/skra-ui-combobox.mjs.map +1 -0
- package/fesm2022/skra-ui-core.mjs +529 -0
- package/fesm2022/skra-ui-core.mjs.map +1 -0
- package/fesm2022/skra-ui-counter.mjs +53 -0
- package/fesm2022/skra-ui-counter.mjs.map +1 -0
- package/fesm2022/skra-ui-datepicker.mjs +867 -0
- package/fesm2022/skra-ui-datepicker.mjs.map +1 -0
- package/fesm2022/skra-ui-dialog.mjs +133 -0
- package/fesm2022/skra-ui-dialog.mjs.map +1 -0
- package/fesm2022/skra-ui-field.mjs +293 -0
- package/fesm2022/skra-ui-field.mjs.map +1 -0
- package/fesm2022/skra-ui-icon.mjs +54 -0
- package/fesm2022/skra-ui-icon.mjs.map +1 -0
- package/fesm2022/skra-ui-input.mjs +42 -0
- package/fesm2022/skra-ui-input.mjs.map +1 -0
- package/fesm2022/skra-ui-kbd.mjs +44 -0
- package/fesm2022/skra-ui-kbd.mjs.map +1 -0
- package/fesm2022/skra-ui-layout.mjs +119 -0
- package/fesm2022/skra-ui-layout.mjs.map +1 -0
- package/fesm2022/skra-ui-link.mjs +29 -0
- package/fesm2022/skra-ui-link.mjs.map +1 -0
- package/fesm2022/skra-ui-loading-indicator.mjs +24 -0
- package/fesm2022/skra-ui-loading-indicator.mjs.map +1 -0
- package/fesm2022/skra-ui-menu.mjs +334 -0
- package/fesm2022/skra-ui-menu.mjs.map +1 -0
- package/fesm2022/skra-ui-multi-select.mjs +179 -0
- package/fesm2022/skra-ui-multi-select.mjs.map +1 -0
- package/fesm2022/skra-ui-native-select.mjs +123 -0
- package/fesm2022/skra-ui-native-select.mjs.map +1 -0
- package/fesm2022/skra-ui-popover.mjs +158 -0
- package/fesm2022/skra-ui-popover.mjs.map +1 -0
- package/fesm2022/skra-ui-progress.mjs +57 -0
- package/fesm2022/skra-ui-progress.mjs.map +1 -0
- package/fesm2022/skra-ui-radio.mjs +92 -0
- package/fesm2022/skra-ui-radio.mjs.map +1 -0
- package/fesm2022/skra-ui-rating-display.mjs +81 -0
- package/fesm2022/skra-ui-rating-display.mjs.map +1 -0
- package/fesm2022/skra-ui-select.mjs +151 -0
- package/fesm2022/skra-ui-select.mjs.map +1 -0
- package/fesm2022/skra-ui-skeleton.mjs +65 -0
- package/fesm2022/skra-ui-skeleton.mjs.map +1 -0
- package/fesm2022/skra-ui-star-rating.mjs +110 -0
- package/fesm2022/skra-ui-star-rating.mjs.map +1 -0
- package/fesm2022/skra-ui-status-dot.mjs +61 -0
- package/fesm2022/skra-ui-status-dot.mjs.map +1 -0
- package/fesm2022/skra-ui-switch.mjs +94 -0
- package/fesm2022/skra-ui-switch.mjs.map +1 -0
- package/fesm2022/skra-ui-tabs.mjs +356 -0
- package/fesm2022/skra-ui-tabs.mjs.map +1 -0
- package/fesm2022/skra-ui-textarea.mjs +81 -0
- package/fesm2022/skra-ui-textarea.mjs.map +1 -0
- package/fesm2022/skra-ui-toast.mjs +208 -0
- package/fesm2022/skra-ui-toast.mjs.map +1 -0
- package/fesm2022/skra-ui-tooltip.mjs +252 -0
- package/fesm2022/skra-ui-tooltip.mjs.map +1 -0
- package/fesm2022/skra-ui-typography.mjs +35 -0
- package/fesm2022/skra-ui-typography.mjs.map +1 -0
- package/fesm2022/skra-ui.mjs +4 -0
- package/fesm2022/skra-ui.mjs.map +1 -0
- package/package.json +175 -0
- package/types/skra-ui-accordion.d.ts +196 -0
- package/types/skra-ui-accordion.d.ts.map +1 -0
- package/types/skra-ui-alert.d.ts +81 -0
- package/types/skra-ui-alert.d.ts.map +1 -0
- package/types/skra-ui-avatar.d.ts +71 -0
- package/types/skra-ui-avatar.d.ts.map +1 -0
- package/types/skra-ui-badge.d.ts +73 -0
- package/types/skra-ui-badge.d.ts.map +1 -0
- package/types/skra-ui-button.d.ts +45 -0
- package/types/skra-ui-button.d.ts.map +1 -0
- package/types/skra-ui-checkbox.d.ts +52 -0
- package/types/skra-ui-checkbox.d.ts.map +1 -0
- package/types/skra-ui-chip.d.ts +60 -0
- package/types/skra-ui-chip.d.ts.map +1 -0
- package/types/skra-ui-combobox.d.ts +95 -0
- package/types/skra-ui-combobox.d.ts.map +1 -0
- package/types/skra-ui-core.d.ts +314 -0
- package/types/skra-ui-core.d.ts.map +1 -0
- package/types/skra-ui-counter.d.ts +33 -0
- package/types/skra-ui-counter.d.ts.map +1 -0
- package/types/skra-ui-datepicker.d.ts +164 -0
- package/types/skra-ui-datepicker.d.ts.map +1 -0
- package/types/skra-ui-dialog.d.ts +59 -0
- package/types/skra-ui-dialog.d.ts.map +1 -0
- package/types/skra-ui-field.d.ts +181 -0
- package/types/skra-ui-field.d.ts.map +1 -0
- package/types/skra-ui-icon.d.ts +38 -0
- package/types/skra-ui-icon.d.ts.map +1 -0
- package/types/skra-ui-input.d.ts +22 -0
- package/types/skra-ui-input.d.ts.map +1 -0
- package/types/skra-ui-kbd.d.ts +33 -0
- package/types/skra-ui-kbd.d.ts.map +1 -0
- package/types/skra-ui-layout.d.ts +86 -0
- package/types/skra-ui-layout.d.ts.map +1 -0
- package/types/skra-ui-link.d.ts +20 -0
- package/types/skra-ui-link.d.ts.map +1 -0
- package/types/skra-ui-loading-indicator.d.ts +9 -0
- package/types/skra-ui-loading-indicator.d.ts.map +1 -0
- package/types/skra-ui-menu.d.ts +116 -0
- package/types/skra-ui-menu.d.ts.map +1 -0
- package/types/skra-ui-multi-select.d.ts +47 -0
- package/types/skra-ui-multi-select.d.ts.map +1 -0
- package/types/skra-ui-native-select.d.ts +74 -0
- package/types/skra-ui-native-select.d.ts.map +1 -0
- package/types/skra-ui-popover.d.ts +57 -0
- package/types/skra-ui-popover.d.ts.map +1 -0
- package/types/skra-ui-progress.d.ts +41 -0
- package/types/skra-ui-progress.d.ts.map +1 -0
- package/types/skra-ui-radio.d.ts +54 -0
- package/types/skra-ui-radio.d.ts.map +1 -0
- package/types/skra-ui-rating-display.d.ts +56 -0
- package/types/skra-ui-rating-display.d.ts.map +1 -0
- package/types/skra-ui-select.d.ts +43 -0
- package/types/skra-ui-select.d.ts.map +1 -0
- package/types/skra-ui-skeleton.d.ts +42 -0
- package/types/skra-ui-skeleton.d.ts.map +1 -0
- package/types/skra-ui-star-rating.d.ts +71 -0
- package/types/skra-ui-star-rating.d.ts.map +1 -0
- package/types/skra-ui-status-dot.d.ts +62 -0
- package/types/skra-ui-status-dot.d.ts.map +1 -0
- package/types/skra-ui-switch.d.ts +54 -0
- package/types/skra-ui-switch.d.ts.map +1 -0
- package/types/skra-ui-tabs.d.ts +191 -0
- package/types/skra-ui-tabs.d.ts.map +1 -0
- package/types/skra-ui-textarea.d.ts +55 -0
- package/types/skra-ui-textarea.d.ts.map +1 -0
- package/types/skra-ui-toast.d.ts +140 -0
- package/types/skra-ui-toast.d.ts.map +1 -0
- package/types/skra-ui-tooltip.d.ts +90 -0
- package/types/skra-ui-tooltip.d.ts.map +1 -0
- package/types/skra-ui-typography.d.ts +17 -0
- package/types/skra-ui-typography.d.ts.map +1 -0
- package/types/skra-ui.d.ts +3 -0
- package/types/skra-ui.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Skra Design System
|
|
2
|
+
Copyright 2026 Bartosz Badacz
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
A copy of the License is distributed with this software in the LICENSE file
|
|
7
|
+
and is available at http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @skra/ui
|
|
2
|
+
|
|
3
|
+
> **Project status** — built primarily for the author's own applications and published
|
|
4
|
+
> quietly. No support, roadmap, or stability guarantees beyond the documented SemVer
|
|
5
|
+
> contract. Licensed under Apache-2.0 (see `LICENSE` / `NOTICE`).
|
|
6
|
+
|
|
7
|
+
Skra Design System — native Angular components (Angular 21, Signals, standalone). One
|
|
8
|
+
umbrella package with **per-component secondary entry points** (ADR 0054):
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { SkraButton } from '@skra/ui/button';
|
|
12
|
+
import { SkraSelect, SkraOption } from '@skra/ui/select'; // composite + re-exported satellite
|
|
13
|
+
import { SkraNativeSelect } from '@skra/ui/native-select'; // native-host skinning directive
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Import from the entry point, never from a deep path. The full entry-point list is the
|
|
17
|
+
`exports` map of this package.
|
|
18
|
+
|
|
19
|
+
## Companion packages (lockstep versions)
|
|
20
|
+
|
|
21
|
+
- **`@skra/tokens`** (peerDependency) — the CSS value layers and structural slices. Components
|
|
22
|
+
are unstyled without a loaded skin; install the matching version and import a skin's
|
|
23
|
+
artifacts into your global stylesheet. See that package's README for import order.
|
|
24
|
+
- **`@skra/shadow-dom-bridge`** — framework-agnostic style delivery into Shadow DOM roots.
|
|
25
|
+
|
|
26
|
+
## SemVer contract
|
|
27
|
+
|
|
28
|
+
- Symbols prefixed with `_` (e.g. `_SkraSelectBase`, `_attachPositioner`) are internal
|
|
29
|
+
machinery exported only for cross-entry-point wiring. They are **outside the SemVer
|
|
30
|
+
contract** and may change in any release (ADR 0054 R-54.5).
|
|
31
|
+
- Removing/renaming an entry point or a public symbol is a major; adding an entry point is a
|
|
32
|
+
minor (ADR 010).
|
|
33
|
+
|
|
34
|
+
## Consumer guide
|
|
35
|
+
|
|
36
|
+
The `consumer-guide/` directory inside this package is the maintained guide for teams (and
|
|
37
|
+
AI agents) building on Skra: setup and gotchas, forms and binding strategy, accessible-name
|
|
38
|
+
rules, theming/encapsulation, overlays, layout, and wrapping patterns. Start at
|
|
39
|
+
`consumer-guide/README.md`.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Consuming Skra — Agent Guide (Core)
|
|
2
|
+
|
|
3
|
+
> **DRAFT (2026-06-25).** All 7 sections drafted. Snippets are grounded in source (verified
|
|
4
|
+
> against `libs/ui/*`) + the `apps/dogfood` friction journal (`F-n`) + the Iron Boundaries.
|
|
5
|
+
> Still draft: not yet referenced from a real consumer repo, not lint-gated against ADR drift,
|
|
6
|
+
> and cross-engine/Safari caveats inherit Skra's own open item O-9.
|
|
7
|
+
|
|
8
|
+
This guide is for an **agent working inside a repository that consumes Skra** (imports
|
|
9
|
+
`@skra/*`), not for authoring Skra itself. It is written to be **copied into / referenced
|
|
10
|
+
from a consumer repo**.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## How to use this guide (read this first — it is the point)
|
|
15
|
+
|
|
16
|
+
This file is **tiered on purpose** (same model as `FORGE_ADR_SUMMARY.md`). To keep token
|
|
17
|
+
cost low:
|
|
18
|
+
|
|
19
|
+
1. **Always load this core** (it is small) — the Iron Rules + the Section Router below.
|
|
20
|
+
2. Then load **at most the ONE section** that matches your current task (the Router maps
|
|
21
|
+
task → file). Do **not** read every section "to be safe" — that defeats the design.
|
|
22
|
+
3. Open the full Skra ADR / spec only when a section explicitly points you there.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Iron Rules of Consumption (the 6 a consumer breaks on day one)
|
|
27
|
+
|
|
28
|
+
Violating these is a review blocker in a consumer repo just as inside Skra.
|
|
29
|
+
|
|
30
|
+
1. **Import only from public `@skra/ui/*` entry points** — never a deep relative `libs/...`
|
|
31
|
+
path. Skra ships as one package, `@skra/ui`, with a secondary entry point per component
|
|
32
|
+
(e.g. `@skra/ui/button`, `@skra/ui/typography`, `@skra/ui/select`); the primary
|
|
33
|
+
`@skra/ui` exports nothing. (Full entry-point list → `setup-and-gotchas.md`.)
|
|
34
|
+
2. **You own the value.** Skra form atoms do **not** implement `ControlValueAccessor` /
|
|
35
|
+
`FormValueControl` (ADR 037). Native-host atoms take `[formField]`/`[formControl]`/
|
|
36
|
+
`[(ngModel)]`; value-owned overlays need an explicit `[value]`/`(valueChange)` bridge.
|
|
37
|
+
(How → `forms-and-binding.md`.)
|
|
38
|
+
3. **Accessible name has exactly ONE path** (ADR 033). No Skra atom exposes an `ariaLabel`
|
|
39
|
+
input; never put `aria-label` next to visible text on the same host. (Paths →
|
|
40
|
+
`accessible-names.md`.)
|
|
41
|
+
4. **Inside `<skra-field>`, do not pass `id` / `for` / `aria-describedby` by hand** — the
|
|
42
|
+
DI context wires label↔control↔hint↔error automatically (ADR 013).
|
|
43
|
+
5. **Under Signal Forms, native constraint attributes go in the schema, not the template.**
|
|
44
|
+
`name` on grouped radios and `maxlength` / `min` / `pattern` on a `[formField]` host raise
|
|
45
|
+
`NG8022` — Signal Forms owns them (F-1/F-2). (Details → `forms-and-binding.md`.)
|
|
46
|
+
6. **Never theme with inline styles.** No `[style.--skra-*]` bindings or `style="…"` (breaks
|
|
47
|
+
CSP, ADR 021). Override tokens via a CSS class / `data-skra-*` scope; components are
|
|
48
|
+
`margin: 0` (ADR 022) — spacing comes from layout atoms, never a margin on the component.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Section Router — load the ONE that matches your task
|
|
53
|
+
|
|
54
|
+
| Section | File | Load when | Status |
|
|
55
|
+
| --------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- | -------- |
|
|
56
|
+
| **Setup & gotchas** | `setup-and-gotchas.md` | First integration; import fails; which `@skra/*` package exports what; boolean-attribute & theming pitfalls | ✅ draft |
|
|
57
|
+
| **Forms & value binding** | `forms-and-binding.md` | Wiring an input / select / checkbox / rating to Signal Forms, Reactive Forms, or `ngModel` | ✅ draft |
|
|
58
|
+
| **Accessible names** | `accessible-names.md` | Naming buttons, icon-only controls, overlays; using `skra-sr-only` | ✅ draft |
|
|
59
|
+
| **Theming & encapsulation** | `theming-and-encapsulation.md` | Skins, dark mode, density; mounting under Shadow DOM / a microfrontend / an iframe | ✅ draft |
|
|
60
|
+
| **Overlays** | `overlays.md` | Dialog / tooltip / popover / menu / select in the top layer; shadow & iframe limits | ✅ draft |
|
|
61
|
+
| **Layout** | `layout.md` | Spacing & composition with Stack / Box / Grid; the gap scale | ✅ draft |
|
|
62
|
+
| **Wrapping Skra** | `wrapping-patterns.md` | Building your own higher-level components over Skra atoms (simplified API) | ✅ draft |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Quick reference — task → section
|
|
67
|
+
|
|
68
|
+
| I want to… | Go to |
|
|
69
|
+
| -------------------------------------------------------------------------- | ----------------------------------------- |
|
|
70
|
+
| Add `@skra/ui/*` to a project and import an atom | `setup-and-gotchas.md` |
|
|
71
|
+
| Bind a text input / textarea to a form | `forms-and-binding.md` |
|
|
72
|
+
| Bind a `skra-select` / `skra-datepicker` / `skra-star-rating` to a form | `forms-and-binding.md` (the value bridge) |
|
|
73
|
+
| Name an icon-only button | `accessible-names.md` |
|
|
74
|
+
| Switch skin / dark mode at runtime | `theming-and-encapsulation.md` |
|
|
75
|
+
| Mount Skra inside a Web Component / microfrontend | `theming-and-encapsulation.md` |
|
|
76
|
+
| Open a dialog or tooltip | `overlays.md` |
|
|
77
|
+
| Space components apart | `layout.md` |
|
|
78
|
+
| Wrap a Skra atom in a project-specific component | `wrapping-patterns.md` |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
_Source of truth for the rules: Skra `FORGE_ADR_SUMMARY.md` + `adr/decisions/`. Real
|
|
83
|
+
consumption evidence: `apps/dogfood/FRICTION_JOURNAL.md`. This guide restates the consumer
|
|
84
|
+
slice of those — on divergence, the ADRs win._
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Accessible Names
|
|
2
|
+
|
|
3
|
+
> Load this for: naming buttons, icon-only controls, and decorative graphics; using
|
|
4
|
+
> `skra-sr-only`. Governed by ADR 033 (Accessible Name Contract) + ADR 034 (icon a11y).
|
|
5
|
+
|
|
6
|
+
## The one rule (ADR 033)
|
|
7
|
+
|
|
8
|
+
Every interactive Skra component supports **exactly ONE** accessible-name path. Two hard
|
|
9
|
+
constraints follow:
|
|
10
|
+
|
|
11
|
+
- **No Skra atom exposes an `ariaLabel` input.** Don't look for one; it isn't there by design.
|
|
12
|
+
- **`aria-label` must NOT coexist with visible `textContent`** on the same Skra host. Pick a
|
|
13
|
+
path, don't mix.
|
|
14
|
+
|
|
15
|
+
Three paths:
|
|
16
|
+
|
|
17
|
+
## Path 1 — visible text is the name (the default, ~most cases)
|
|
18
|
+
|
|
19
|
+
The rendered text content *is* the accessible name. Nothing to wire:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<button skraButton>Save changes</button>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Path 2 — visible text + a screen-reader-only extension
|
|
26
|
+
|
|
27
|
+
When the visible label is right for sighted users but a screen reader needs more context
|
|
28
|
+
(e.g. *which* item a generic "Remove" acts on). Project an extra span hidden with the
|
|
29
|
+
`skra-sr-only` utility. **Class and attribute are equivalent** — use whichever reads better:
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- a remove control whose visible glyph is an ×, named "Remove {item}" for AT -->
|
|
33
|
+
<skra-chip>
|
|
34
|
+
Marketing
|
|
35
|
+
<span skra-chip-remove-label class="skra-sr-only">Remove Marketing</span>
|
|
36
|
+
</skra-chip>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The consumer **applies the utility class** and **owns the i18n** (the interpolated item name)
|
|
40
|
+
— the atom only provides the slot. `skra-sr-only` lives in the `utilities.scss` slice, so it
|
|
41
|
+
must be loaded (and bridged into any shadow root — see `theming-and-encapsulation.md`, F-15),
|
|
42
|
+
or the text renders visibly.
|
|
43
|
+
|
|
44
|
+
> The same pattern names other built-in sr-only slots, e.g. `[skra-alert-close-label]` on
|
|
45
|
+
> `skra-alert`'s dismiss button.
|
|
46
|
+
|
|
47
|
+
## Path 3 — `aria-label` on an icon-only host
|
|
48
|
+
|
|
49
|
+
When there is **no** visible text (an icon-only control), put a **native** `aria-label`
|
|
50
|
+
directly on the host. This is the one sanctioned `aria-label` use (native-attr-first rule 2 —
|
|
51
|
+
there is no visible text to conflict with):
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<button skraButton aria-label="Close dialog">
|
|
55
|
+
<!-- icon only, no text node -->
|
|
56
|
+
…icon…
|
|
57
|
+
</button>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Decorative vs meaningful icons (ADR 034)
|
|
61
|
+
|
|
62
|
+
An icon that *is* the meaning (no adjacent text) must be exposed to AT — the icon container
|
|
63
|
+
takes `role="img"` + a label. A purely decorative icon next to visible text stays
|
|
64
|
+
`aria-hidden`. Never make an icon meaningful **and** leave it unlabelled.
|
|
65
|
+
|
|
66
|
+
## Decorative graphics — Avatar / StatusDot / RatingDisplay
|
|
67
|
+
|
|
68
|
+
These display atoms ship **two modes** (the Path-3 family, ~90% is Mode A):
|
|
69
|
+
|
|
70
|
+
- **Mode A (decorative, default):** the host is `aria-hidden="true"`; meaning is carried by
|
|
71
|
+
adjacent text. Use when the graphic sits beside a name / a "4 / 5" value. **Colour is never
|
|
72
|
+
the sole carrier of status** (WCAG 1.4.1) — a lone coloured status dot needs an adjacent text
|
|
73
|
+
label.
|
|
74
|
+
- **Mode B (standalone):** the consumer opts in with `role="img"` + `aria-label` when the
|
|
75
|
+
graphic stands alone with no adjacent text.
|
|
76
|
+
|
|
77
|
+
## Inside `<skra-field>`
|
|
78
|
+
|
|
79
|
+
A field control is named by its `<label skraLabelFor>` automatically (Path 1, via the DI
|
|
80
|
+
context) — do not add `aria-label`. See `forms-and-binding.md`.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Forms & Value Binding
|
|
2
|
+
|
|
3
|
+
> Load this for: wiring a Skra form atom to **Signal Forms**, **Reactive Forms**, or
|
|
4
|
+
> **`ngModel`**. The governing rule is ADR 037: **Skra atoms are agnostic — you own the
|
|
5
|
+
> value and pick the binding strategy.** No atom implements `ControlValueAccessor` /
|
|
6
|
+
> `FormValueControl`.
|
|
7
|
+
|
|
8
|
+
## The two classes of form atom
|
|
9
|
+
|
|
10
|
+
How you bind depends on which kind you are holding:
|
|
11
|
+
|
|
12
|
+
### A. Native-host atoms → bind directly on the native element
|
|
13
|
+
|
|
14
|
+
These are Skra directives **on a native `<input>`/`<textarea>`** (Component-on-native-host,
|
|
15
|
+
ADR 040 — there is **no** `<skra-checkbox>`/`<skra-radio>` custom element). Angular's form
|
|
16
|
+
directives attach to the same host, so `[formField]`, `[formControl]`/`formControlName`, and
|
|
17
|
+
`[(ngModel)]` all work orthogonally with the Skra directive (it only adds a11y + skin):
|
|
18
|
+
|
|
19
|
+
- `input[skraInput]`, `textarea[skraTextarea]`
|
|
20
|
+
- `input[type="checkbox"][skraCheckbox]`, `input[type="radio"][skraRadio]`
|
|
21
|
+
- `input[type="checkbox"][skraSwitch]`
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!-- text: Signal Forms / Reactive / ngModel — all valid -->
|
|
25
|
+
<input skraInput [formField]="form().email" />
|
|
26
|
+
<input skraInput [formControl]="emailCtrl" />
|
|
27
|
+
<input skraInput [(ngModel)]="email" />
|
|
28
|
+
|
|
29
|
+
<!-- checkbox / switch: native checked + change (or any form directive) -->
|
|
30
|
+
<input type="checkbox" skraCheckbox
|
|
31
|
+
[checked]="accepted()" (change)="accepted.set($any($event.target).checked)" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Radios group natively** — `<fieldset skraFieldset>` + `<legend skraLegend>`, with
|
|
35
|
+
selection coordinated through the shared `name`:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<fieldset skraFieldset>
|
|
39
|
+
<legend skraLegend>Choose plan</legend>
|
|
40
|
+
<skra-field>
|
|
41
|
+
<input type="radio" skraRadio name="plan" value="free"
|
|
42
|
+
[checked]="plan() === 'free'" (change)="plan.set('free')" />
|
|
43
|
+
<label skraLabelFor>Free</label>
|
|
44
|
+
</skra-field>
|
|
45
|
+
</fieldset>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
> Under **Signal Forms**, drop the native `name` on radios — SF derives it from the bound
|
|
49
|
+
> field and a literal `name` raises `NG8022` (F-1; see the Signal Forms section below).
|
|
50
|
+
|
|
51
|
+
### B. Value-owned overlays / composites → use the explicit value bridge
|
|
52
|
+
|
|
53
|
+
These are custom-element widgets that deliberately do **not** implement `FormValueControl`
|
|
54
|
+
(ADR 037), so `[formField]` does **not** apply. Bind value out + value in explicitly:
|
|
55
|
+
|
|
56
|
+
- `skra-select`, `skra-multi-select`, `skra-combobox`, `skra-datepicker`,
|
|
57
|
+
`skra-star-rating`
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<!-- Signal Forms: the two-binding bridge (F-3, F-23) -->
|
|
61
|
+
<skra-select
|
|
62
|
+
[value]="form().country().value()"
|
|
63
|
+
(valueChange)="form().country().value.set($event)">
|
|
64
|
+
…
|
|
65
|
+
</skra-select>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<!-- Plain signal / ngModel-style -->
|
|
70
|
+
<skra-star-rating [value]="rating()" (valueChange)="rating.set($event)" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The verbosity gap vs class A (one attribute → two) is **intended**, not a defect — it is the
|
|
74
|
+
price of the atom staying framework-agnostic. If it recurs across many fields, see
|
|
75
|
+
[Reducing the bridge boilerplate](#reducing-the-bridge-boilerplate).
|
|
76
|
+
|
|
77
|
+
> Reminder: there is **no** `<skra-checkbox>`/`<skra-radio>` element — those are the
|
|
78
|
+
> class-A native-host directives above. `skra-counter` is not an input either (see below).
|
|
79
|
+
|
|
80
|
+
## `skra-counter` — a display atom, not an input
|
|
81
|
+
|
|
82
|
+
`skra-counter` renders a live character count for a sibling control; it does **not** hold
|
|
83
|
+
the field's value (ADR 037 §3.3 forbids a value channel in the context). Feed it the current
|
|
84
|
+
string + an optional max:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<skra-field>
|
|
88
|
+
<label skraLabelFor>Bio</label>
|
|
89
|
+
<textarea skraTextarea [formField]="form().bio"></textarea>
|
|
90
|
+
<skra-counter [value]="form().bio().value()" [max]="500" />
|
|
91
|
+
</skra-field>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
It displays `{{length}}` or `{{length}}/{{max}}`. The native length cap is separate — and
|
|
95
|
+
under Signal Forms `maxlength` goes in the schema (F-2), not on the host.
|
|
96
|
+
|
|
97
|
+
## Signal Forms specifics — native constraints belong in the schema, not the template
|
|
98
|
+
|
|
99
|
+
When `[formField]` is present, **Signal Forms owns the native constraint attributes**.
|
|
100
|
+
Setting them in the template is a compile error (`NG8022`):
|
|
101
|
+
|
|
102
|
+
- ✗ `name` on grouped radios (F-1) — SF derives it from the bound field.
|
|
103
|
+
- ✗ `maxlength` / `min` / `max` / `pattern` on the host (F-2) — declare them in the schema.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// ✓ constraint in the schema
|
|
107
|
+
maxLength(p.bio, 160);
|
|
108
|
+
```
|
|
109
|
+
```html
|
|
110
|
+
<!-- ✗ NG8022 -->
|
|
111
|
+
<textarea skraTextarea [formField]="form().bio" maxlength="160"></textarea>
|
|
112
|
+
<!-- ✓ -->
|
|
113
|
+
<textarea skraTextarea [formField]="form().bio"></textarea>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
This is a Signal-Forms composition rule, not a Skra defect — but a consumer hits it on the
|
|
117
|
+
first grouped radio / length-limited field.
|
|
118
|
+
|
|
119
|
+
## A11y wiring is automatic inside `<skra-field>` (ADR 013)
|
|
120
|
+
|
|
121
|
+
Do **not** hand-wire `id`, `for`, or `aria-describedby`. Wrapping a control in
|
|
122
|
+
`<skra-field>` links label ↔ control ↔ hint ↔ error through a DI context. Just project the
|
|
123
|
+
parts:
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<skra-field>
|
|
127
|
+
<label skraLabelFor>Email</label>
|
|
128
|
+
<input skraInput [formField]="form().email" />
|
|
129
|
+
<skra-hint>We'll never share it.</skra-hint>
|
|
130
|
+
<skra-error>{{ emailError() }}</skra-error>
|
|
131
|
+
</skra-field>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> Confirmed against `component-field-spec.md`: the label is `<label skraLabelFor>`, hint is
|
|
135
|
+
> `<skra-hint>`, error is `<skra-error>`; the context publishes `id`/`for` and folds
|
|
136
|
+
> `hintId`/`errorId` into the control's `aria-describedby` (dangling refs ignored when a part
|
|
137
|
+
> is absent).
|
|
138
|
+
|
|
139
|
+
For the **accessible name** of a control (especially icon-only), see `accessible-names.md`
|
|
140
|
+
— there is exactly one valid path and no `ariaLabel` input.
|
|
141
|
+
|
|
142
|
+
## Reducing the bridge boilerplate
|
|
143
|
+
|
|
144
|
+
If class-B fields are everywhere and the two-binding bridge is noisy, the sanctioned shape is
|
|
145
|
+
a **consumer-side adapter directive** (e.g. `[skraControl]` mapping a form node ↔
|
|
146
|
+
`value`/`valueChange`) living in **your** interop layer — **never** inside the atom (that
|
|
147
|
+
would break ADR 037 / atoms-agnostic). Whether Skra should ship such an adapter as an
|
|
148
|
+
optional `@skra/angular-interop` package is an open architectural question (out of scope for
|
|
149
|
+
this guide). See also `wrapping-patterns.md`.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Layout
|
|
2
|
+
|
|
3
|
+
> Load this for: spacing and composition with Stack / Box / Grid, and the gap scale.
|
|
4
|
+
> Governed by ADR 041 (layout atoms on native hosts) + ADR 022 (layout isolation).
|
|
5
|
+
|
|
6
|
+
## The rule that makes layout necessary (ADR 022)
|
|
7
|
+
|
|
8
|
+
Skra components carry `margin: 0`. **Spacing between components is never a margin on the
|
|
9
|
+
component** — it comes from a layout primitive. There are three, and they are **directives on
|
|
10
|
+
a native host** (a bounded allowlist of `div`/`section`/`nav`/`ul`/…), **never** a
|
|
11
|
+
`<skra-stack>` custom element. Put them on the semantic element you'd use anyway:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<section skraStack gap="md">…</section> <!-- not <div><skra-stack> -->
|
|
15
|
+
<ul skraStack gap="sm">…</ul> <!-- list markers normalized, restorable -->
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Stack — 1D flex (`[skraStack]`)
|
|
19
|
+
|
|
20
|
+
Arranges children in a row or column.
|
|
21
|
+
|
|
22
|
+
| Input | Values | Default |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `direction` | `row` \| `column` | `column` |
|
|
25
|
+
| `gap` | `none` \| `sm` \| `md` \| `lg` | `md` |
|
|
26
|
+
| `align` | `start` \| `center` \| `end` \| `stretch` | `stretch` |
|
|
27
|
+
| `justify` | `start` \| `center` \| `end` \| `between` \| `around` | `start` |
|
|
28
|
+
| `wrap` | boolean | `false` |
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<div skraStack direction="row" gap="sm" wrap align="center">
|
|
32
|
+
<skra-chip>One</skra-chip>
|
|
33
|
+
<skra-chip>Two</skra-chip>
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
(`wrap` is a bare boolean attribute — every Skra boolean input carries `booleanAttribute`, so
|
|
38
|
+
the bare form works; see `setup-and-gotchas.md`.)
|
|
39
|
+
|
|
40
|
+
## Box — padding / spacing (`[skraBox]`)
|
|
41
|
+
|
|
42
|
+
A semantically-neutral padding primitive. Does **not** arrange children (no list hosts).
|
|
43
|
+
|
|
44
|
+
| Input | Values | Default |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `padding` | `none` \| `sm` \| `md` \| `lg` | `none` |
|
|
47
|
+
| `display` | `block` \| `inline-block` \| `flex` | `block` |
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<section skraBox padding="lg">…</section>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Grid — 2D (`[skraGrid]`)
|
|
54
|
+
|
|
55
|
+
Bucket-only CSS Grid. The default `columns="auto-fit"` + `min` gives an intrinsically
|
|
56
|
+
responsive card grid (column count tracks width, **no media/container queries**):
|
|
57
|
+
|
|
58
|
+
| Input | Values | Default |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `columns` | `1`…`6` \| `auto-fit` \| `auto-fill` | `auto-fit` |
|
|
61
|
+
| `min` | `sm` \| `md` \| `lg` | — |
|
|
62
|
+
| `gap` | `none` \| `sm` \| `md` \| `lg` | — |
|
|
63
|
+
| `flow` | `row` \| `column` \| `dense` | — |
|
|
64
|
+
| `align` | `start` \| `center` \| `end` \| `stretch` | — |
|
|
65
|
+
| `justifyItems` | `start` \| `center` \| `end` \| `stretch` | — |
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<div skraGrid columns="auto-fit" min="md" gap="md">
|
|
69
|
+
<!-- responsive cards, no breakpoints -->
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Arbitrary track lists, `grid-template-areas`, named lines and per-item placement are **out of
|
|
74
|
+
scope by design** (bespoke = native CSS — exposing them would force an inline-style host
|
|
75
|
+
binding, ADR 021). Drop to plain CSS Grid for those.
|
|
76
|
+
|
|
77
|
+
## The gap scale is coarse — `none | sm | md | lg` (F-4)
|
|
78
|
+
|
|
79
|
+
There is no `xs` / `xl` / numeric / arbitrary gap. When you need a tighter or larger rhythm:
|
|
80
|
+
|
|
81
|
+
- nest stacks (an outer `lg`, an inner `sm`), or
|
|
82
|
+
- lean on typography line-height for sub-`sm` text pairs, or
|
|
83
|
+
- drop to native CSS for a genuinely bespoke layout.
|
|
84
|
+
|
|
85
|
+
This is a known coarseness (a token-scale decision for the Skra side), not something to work
|
|
86
|
+
around with inline styles.
|