@ponchia/ui 0.3.4 → 0.3.5
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/README.md +108 -176
- package/behaviors/index.d.ts +16 -0
- package/behaviors/index.js +196 -0
- package/classes/index.d.ts +39 -0
- package/classes/index.js +39 -0
- package/css/disclosure.css +180 -0
- package/css/feedback.css +111 -0
- package/css/forms.css +44 -0
- package/css/overlay.css +48 -0
- package/css/primitives.css +60 -0
- package/css/site.css +33 -0
- package/dist/bronto.css +1 -1
- package/dist/css/disclosure.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/forms.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/primitives.css +1 -1
- package/dist/css/site.css +1 -1
- package/docs/reference.md +71 -1
- package/docs/usage.md +52 -0
- package/fonts/OFL.txt +93 -0
- package/package.json +17 -2
package/docs/reference.md
CHANGED
|
@@ -9,7 +9,7 @@ rendering of every class is the kitchen-sink demo:
|
|
|
9
9
|
**<https://ponchia.github.io/bronto-ui/>**. Theming knobs and the token
|
|
10
10
|
contract: [docs/theming.md](theming.md).
|
|
11
11
|
|
|
12
|
-
-
|
|
12
|
+
- 260 classes across 109 component groups
|
|
13
13
|
- Import the typed registry: `import { cls, ui, cx } from '@ponchia/ui/classes'`
|
|
14
14
|
- Tokens as data: `import { cssVars, tokens, themeColor } from '@ponchia/ui/tokens'`
|
|
15
15
|
|
|
@@ -206,6 +206,20 @@ each one matches a real selector in the stylesheet.
|
|
|
206
206
|
| --- | --- | --- |
|
|
207
207
|
| `cls.caret` | `ui-caret` | base |
|
|
208
208
|
|
|
209
|
+
### `.ui-carousel`
|
|
210
|
+
|
|
211
|
+
| Registry key | Class | Kind |
|
|
212
|
+
| --- | --- | --- |
|
|
213
|
+
| `cls.carousel` | `ui-carousel` | base |
|
|
214
|
+
| `cls.carouselNext` | `ui-carousel__next` | part |
|
|
215
|
+
| `cls.carouselPrev` | `ui-carousel__prev` | part |
|
|
216
|
+
| `cls.carouselSlide` | `ui-carousel__slide` | part |
|
|
217
|
+
| `cls.carouselStage` | `ui-carousel__stage` | part |
|
|
218
|
+
| `cls.carouselStatus` | `ui-carousel__status` | part |
|
|
219
|
+
| `cls.carouselThumb` | `ui-carousel__thumb` | part |
|
|
220
|
+
| `cls.carouselThumbs` | `ui-carousel__thumbs` | part |
|
|
221
|
+
| `cls.carouselViewport` | `ui-carousel__viewport` | part |
|
|
222
|
+
|
|
209
223
|
### `.ui-center`
|
|
210
224
|
|
|
211
225
|
| Registry key | Class | Kind |
|
|
@@ -390,6 +404,20 @@ each one matches a real selector in the stylesheet.
|
|
|
390
404
|
| `cls.inputGroup` | `ui-input-group` | base |
|
|
391
405
|
| `cls.inputGroupAddon` | `ui-input-group__addon` | part |
|
|
392
406
|
|
|
407
|
+
### `.ui-input-icon`
|
|
408
|
+
|
|
409
|
+
| Registry key | Class | Kind |
|
|
410
|
+
| --- | --- | --- |
|
|
411
|
+
| `cls.inputIcon` | `ui-input-icon` | base |
|
|
412
|
+
| `cls.inputIconSlot` | `ui-input-icon__icon` | part |
|
|
413
|
+
| `cls.inputIconEnd` | `ui-input-icon--end` | modifier |
|
|
414
|
+
|
|
415
|
+
### `.ui-kbd`
|
|
416
|
+
|
|
417
|
+
| Registry key | Class | Kind |
|
|
418
|
+
| --- | --- | --- |
|
|
419
|
+
| `cls.kbd` | `ui-kbd` | base |
|
|
420
|
+
|
|
393
421
|
### `.ui-key-value`
|
|
394
422
|
|
|
395
423
|
| Registry key | Class | Kind |
|
|
@@ -402,6 +430,13 @@ each one matches a real selector in the stylesheet.
|
|
|
402
430
|
| --- | --- | --- |
|
|
403
431
|
| `cls.label` | `ui-label` | base |
|
|
404
432
|
|
|
433
|
+
### `.ui-lightbox`
|
|
434
|
+
|
|
435
|
+
| Registry key | Class | Kind |
|
|
436
|
+
| --- | --- | --- |
|
|
437
|
+
| `cls.lightbox` | `ui-lightbox` | base |
|
|
438
|
+
| `cls.lightboxClose` | `ui-lightbox__close` | part |
|
|
439
|
+
|
|
405
440
|
### `.ui-link`
|
|
406
441
|
|
|
407
442
|
| Registry key | Class | Kind |
|
|
@@ -438,6 +473,17 @@ each one matches a real selector in the stylesheet.
|
|
|
438
473
|
| `cls.meta` | `ui-meta` | base |
|
|
439
474
|
| `cls.metaItem` | `ui-meta__item` | part |
|
|
440
475
|
|
|
476
|
+
### `.ui-meter`
|
|
477
|
+
|
|
478
|
+
| Registry key | Class | Kind |
|
|
479
|
+
| --- | --- | --- |
|
|
480
|
+
| `cls.meter` | `ui-meter` | base |
|
|
481
|
+
| `cls.meterFill` | `ui-meter__fill` | part |
|
|
482
|
+
| `cls.meterAccent` | `ui-meter--accent` | modifier |
|
|
483
|
+
| `cls.meterDanger` | `ui-meter--danger` | modifier |
|
|
484
|
+
| `cls.meterSuccess` | `ui-meter--success` | modifier |
|
|
485
|
+
| `cls.meterWarning` | `ui-meter--warning` | modifier |
|
|
486
|
+
|
|
441
487
|
### `.ui-modal`
|
|
442
488
|
|
|
443
489
|
| Registry key | Class | Kind |
|
|
@@ -471,6 +517,14 @@ each one matches a real selector in the stylesheet.
|
|
|
471
517
|
| `cls.numNeg` | `ui-num--neg` | modifier |
|
|
472
518
|
| `cls.numPos` | `ui-num--pos` | modifier |
|
|
473
519
|
|
|
520
|
+
### `.ui-pagehead`
|
|
521
|
+
|
|
522
|
+
| Registry key | Class | Kind |
|
|
523
|
+
| --- | --- | --- |
|
|
524
|
+
| `cls.pagehead` | `ui-pagehead` | base |
|
|
525
|
+
| `cls.pageheadActions` | `ui-pagehead__actions` | part |
|
|
526
|
+
| `cls.pageheadTitle` | `ui-pagehead__title` | part |
|
|
527
|
+
|
|
474
528
|
### `.ui-pagination`
|
|
475
529
|
|
|
476
530
|
| Registry key | Class | Kind |
|
|
@@ -637,6 +691,14 @@ each one matches a real selector in the stylesheet.
|
|
|
637
691
|
| --- | --- | --- |
|
|
638
692
|
| `cls.status` | `ui-status` | base |
|
|
639
693
|
|
|
694
|
+
### `.ui-steps`
|
|
695
|
+
|
|
696
|
+
| Registry key | Class | Kind |
|
|
697
|
+
| --- | --- | --- |
|
|
698
|
+
| `cls.steps` | `ui-steps` | base |
|
|
699
|
+
| `cls.stepsItem` | `ui-steps__item` | part |
|
|
700
|
+
| `cls.stepsItemDone` | `ui-steps__item--done` | modifier |
|
|
701
|
+
|
|
640
702
|
### `.ui-surface`
|
|
641
703
|
|
|
642
704
|
| Registry key | Class | Kind |
|
|
@@ -721,6 +783,14 @@ each one matches a real selector in the stylesheet.
|
|
|
721
783
|
| `cls.themetoggleThumb` | `ui-themetoggle__thumb` | part |
|
|
722
784
|
| `cls.themetoggleTrack` | `ui-themetoggle__track` | part |
|
|
723
785
|
|
|
786
|
+
### `.ui-timeline`
|
|
787
|
+
|
|
788
|
+
| Registry key | Class | Kind |
|
|
789
|
+
| --- | --- | --- |
|
|
790
|
+
| `cls.timeline` | `ui-timeline` | base |
|
|
791
|
+
| `cls.timelineItem` | `ui-timeline__item` | part |
|
|
792
|
+
| `cls.timelineTime` | `ui-timeline__time` | part |
|
|
793
|
+
|
|
724
794
|
### `.ui-toast`
|
|
725
795
|
|
|
726
796
|
| Registry key | Class | Kind |
|
package/docs/usage.md
CHANGED
|
@@ -86,6 +86,39 @@ destructive action).
|
|
|
86
86
|
| toast | transient, out-of-flow, system-initiated. Danger toasts route to an assertive live region; everything else polite. |
|
|
87
87
|
| tooltip | supplemental, hover/focus, never essential info (it's not announced reliably; don't hide required content in it). |
|
|
88
88
|
|
|
89
|
+
## Meter vs progress
|
|
90
|
+
|
|
91
|
+
Both are a thin horizontal bar; they mean different things.
|
|
92
|
+
|
|
93
|
+
- **`ui-progress`** — *task* progress: how far an operation has run. Can be
|
|
94
|
+
indeterminate (`ui-progress--indeterminate`). The fill is always accent.
|
|
95
|
+
- **`ui-meter`** — a *measured static value*: coverage, disk, capacity, a
|
|
96
|
+
KPI against a target. Never indeterminate. Tone the fill by threshold
|
|
97
|
+
(`ui.meter({ tone })` → accent/success/warning/danger); the unset
|
|
98
|
+
default is neutral. Drive the width with the shared `--value` knob
|
|
99
|
+
(`style="--value: 72"`, 0–100) and author `role="meter"` +
|
|
100
|
+
`aria-valuenow/min/max` for AT.
|
|
101
|
+
|
|
102
|
+
Rule of thumb: *something is happening* → progress; *something measures
|
|
103
|
+
this much* → meter.
|
|
104
|
+
|
|
105
|
+
## Steps, timeline, kbd, input icons
|
|
106
|
+
|
|
107
|
+
- **`ui-steps`** — a stepper for a multi-step flow. Use an `<ol>`. State is
|
|
108
|
+
ARIA-driven (the framework rule): the active step is `aria-current="step"`
|
|
109
|
+
(no class); completed steps take `ui-steps__item--done`. Markers are
|
|
110
|
+
auto-numbered by CSS counter.
|
|
111
|
+
- **`ui-timeline`** — a vertical event list on a hairline spine (`<ol>` of
|
|
112
|
+
`ui-timeline__item`, optional `ui-timeline__time`). `aria-current` on an
|
|
113
|
+
item marks the live/most-recent event.
|
|
114
|
+
- **`ui-kbd`** — an inline keyboard-key glyph. Wrap a `<kbd>`; for a
|
|
115
|
+
shortcut, use one per key (`<kbd>⌘</kbd> <kbd>K</kbd>`).
|
|
116
|
+
- **`ui-input-icon`** — a leading (or `--end` trailing) icon *inside* one
|
|
117
|
+
control. This is distinct from `ui-input-group`, whose addon sits
|
|
118
|
+
*adjacent* to the control. Wrap the input; the icon is decorative
|
|
119
|
+
(`aria-hidden`) and the input keeps its full width. Don't hand-roll an
|
|
120
|
+
absolute overlay.
|
|
121
|
+
|
|
89
122
|
## Modal: native `<dialog>` vs `is-open`
|
|
90
123
|
|
|
91
124
|
Prefer the **native `<dialog>`** path — you get top-layer, backdrop and
|
|
@@ -94,6 +127,25 @@ when a portal/React modal genuinely can't be a `<dialog>`; then the
|
|
|
94
127
|
backdrop and focus-trap are **yours** to provide. A drawer is a modal
|
|
95
128
|
that enters from an edge — same rule.
|
|
96
129
|
|
|
130
|
+
## Carousel & lightbox: one primitive, two skins
|
|
131
|
+
|
|
132
|
+
`ui-carousel` is a scroll-snap track of `__slide`s wired by `initCarousel`
|
|
133
|
+
(prev/next, keyboard, a `__thumb` strip, the `__status` counter, ARIA).
|
|
134
|
+
Because the track is **native horizontal scroll**, touch and trackpad
|
|
135
|
+
swipe — with momentum — are the browser's; the behavior only keeps the JS
|
|
136
|
+
index in sync with the scroll both ways. Add `data-bronto-carousel-loop`
|
|
137
|
+
to wrap at the ends.
|
|
138
|
+
|
|
139
|
+
A **lightbox is the same carousel inside a native
|
|
140
|
+
`<dialog class="ui-lightbox">`**, opened with `data-bronto-open` (wired by
|
|
141
|
+
`initDialog`). Do **not** hand-roll an overlay: the `<dialog>` gives the
|
|
142
|
+
top layer, the backdrop, the focus-trap, Escape, and focus-return for
|
|
143
|
+
free — exactly the parts a from-scratch lightbox gets wrong. The inline
|
|
144
|
+
carousel crops (`cover`); the lightbox shows the whole image (`contain`).
|
|
145
|
+
|
|
146
|
+
This is deliberately *not* an auto-playing marketing slider (no timers, no
|
|
147
|
+
infinite-clone track). It's a gallery: the user drives it.
|
|
148
|
+
|
|
97
149
|
## When to add a behavior
|
|
98
150
|
|
|
99
151
|
The CSS is the framework; `@ponchia/ui/behaviors` is the *sanctioned*
|
package/fonts/OFL.txt
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2024 The Doto Project Authors (https://github.com/oliverlalan/Doto)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://openfontlicense.org
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ponchia/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Nothing-inspired, CSS-first UI framework — monochrome design tokens, one rationed accent, dot-matrix motifs, zero runtime dependencies, framework-agnostic.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"css",
|
|
8
|
+
"ui",
|
|
9
|
+
"ui-framework",
|
|
10
|
+
"design-system",
|
|
11
|
+
"design-tokens",
|
|
12
|
+
"cascade-layers",
|
|
13
|
+
"css-layers",
|
|
14
|
+
"nothing",
|
|
15
|
+
"monochrome",
|
|
16
|
+
"framework-agnostic",
|
|
17
|
+
"zero-dependencies",
|
|
18
|
+
"dark-mode",
|
|
19
|
+
"accessibility"
|
|
20
|
+
],
|
|
6
21
|
"license": "MIT",
|
|
7
22
|
"repository": {
|
|
8
23
|
"type": "git",
|