tutuca 0.9.39 → 0.9.41
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/dist/tutuca-cli.js +92 -39
- package/dist/tutuca-dev.js +18 -0
- package/dist/tutuca-dev.min.js +1 -1
- package/package.json +6 -7
- package/skill/immutable-js/SKILL.md +79 -0
- package/skill/immutable-js/references/collection.md +346 -0
- package/skill/immutable-js/references/conversions.md +99 -0
- package/skill/immutable-js/references/deep-updates.md +172 -0
- package/skill/immutable-js/references/equality.md +95 -0
- package/skill/immutable-js/references/list.md +266 -0
- package/skill/immutable-js/references/map.md +300 -0
- package/skill/immutable-js/references/predicates.md +93 -0
- package/skill/immutable-js/references/range-repeat.md +55 -0
- package/skill/immutable-js/references/record.md +196 -0
- package/skill/immutable-js/references/seq.md +248 -0
- package/skill/immutable-js/references/set.md +270 -0
- package/skill/immutable-js/references/shallow-functional.md +99 -0
- package/skill/immutable-js/references/stack.md +210 -0
- package/skill/margaui/SKILL.md +101 -0
- package/skill/margaui/components/accordion.md +127 -0
- package/skill/margaui/components/alert.md +174 -0
- package/skill/margaui/components/avatar.md +220 -0
- package/skill/margaui/components/badge.md +193 -0
- package/skill/margaui/components/breadcrumbs.md +103 -0
- package/skill/margaui/components/button.md +322 -0
- package/skill/margaui/components/calendar.md +67 -0
- package/skill/margaui/components/card.md +373 -0
- package/skill/margaui/components/carousel.md +387 -0
- package/skill/margaui/components/chat.md +171 -0
- package/skill/margaui/components/checkbox.md +101 -0
- package/skill/margaui/components/collapse.md +172 -0
- package/skill/margaui/components/countdown.md +165 -0
- package/skill/margaui/components/diff.md +53 -0
- package/skill/margaui/components/divider.md +107 -0
- package/skill/margaui/components/dock.md +173 -0
- package/skill/margaui/components/drawer.md +184 -0
- package/skill/margaui/components/dropdown.md +388 -0
- package/skill/margaui/components/fab.md +346 -0
- package/skill/margaui/components/fieldset.md +88 -0
- package/skill/margaui/components/file-input.md +84 -0
- package/skill/margaui/components/filter.md +52 -0
- package/skill/margaui/components/footer.md +583 -0
- package/skill/margaui/components/hero.md +135 -0
- package/skill/margaui/components/hover-3d.md +129 -0
- package/skill/margaui/components/hover-gallery.md +49 -0
- package/skill/margaui/components/indicator.md +265 -0
- package/skill/margaui/components/input.md +389 -0
- package/skill/margaui/components/join.md +100 -0
- package/skill/margaui/components/kbd.md +127 -0
- package/skill/margaui/components/label.md +102 -0
- package/skill/margaui/components/link.md +96 -0
- package/skill/margaui/components/list.md +182 -0
- package/skill/margaui/components/loading.md +105 -0
- package/skill/margaui/components/mask.md +168 -0
- package/skill/margaui/components/menu.md +856 -0
- package/skill/margaui/components/mockup-browser.md +39 -0
- package/skill/margaui/components/mockup-code.md +81 -0
- package/skill/margaui/components/mockup-phone.md +39 -0
- package/skill/margaui/components/mockup-window.md +33 -0
- package/skill/margaui/components/modal.md +178 -0
- package/skill/margaui/components/navbar.md +282 -0
- package/skill/margaui/components/pagination.md +122 -0
- package/skill/margaui/components/progress.md +135 -0
- package/skill/margaui/components/radial-progress.md +67 -0
- package/skill/margaui/components/radio.md +133 -0
- package/skill/margaui/components/range.md +134 -0
- package/skill/margaui/components/rating.md +170 -0
- package/skill/margaui/components/select.md +225 -0
- package/skill/margaui/components/skeleton.md +64 -0
- package/skill/margaui/components/stack.md +142 -0
- package/skill/margaui/components/stat.md +254 -0
- package/skill/margaui/components/status.md +73 -0
- package/skill/margaui/components/steps.md +138 -0
- package/skill/margaui/components/swap.md +152 -0
- package/skill/margaui/components/tab.md +248 -0
- package/skill/margaui/components/table.md +1018 -0
- package/skill/margaui/components/text-rotate.md +91 -0
- package/skill/margaui/components/textarea.md +85 -0
- package/skill/margaui/components/theme-controller.md +266 -0
- package/skill/margaui/components/timeline.md +1356 -0
- package/skill/margaui/components/toast.md +165 -0
- package/skill/margaui/components/toggle.md +135 -0
- package/skill/margaui/components/tooltip.md +181 -0
- package/skill/margaui/components/validator.md +163 -0
- package/skill/{advanced.md → tutuca/advanced.md} +5 -0
- package/skill/{cli.md → tutuca/cli.md} +17 -0
- package/skill/{core.md → tutuca/core.md} +5 -0
- /package/skill/{SKILL.md → tutuca/SKILL.md} +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
`Stack` is an `Collection.Indexed` optimized for LIFO operations at the FRONT (index 0). Unlike `List` and the JavaScript `Array`, `push` and `pop` operate on the head of the collection, not the tail: `push(v)` is an alias for `unshift(v)` and `pop()` is an alias for `shift()`. Both are `O(1)` because Stack is implemented as a singly-linked list. Reach for `Stack` whenever the workload is dominated by head insertion/removal (parser/eval stacks, undo histories, DFS frontiers); reach for `List` when you need fast tail operations or random access. Reverse traversals (`reverse`, `reduceRight`, `lastIndexOf`, etc.) are not efficient on Stack.
|
|
2
|
+
|
|
3
|
+
## Construction
|
|
4
|
+
|
|
5
|
+
### Stack
|
|
6
|
+
```ts
|
|
7
|
+
Stack<T>(collection?: Iterable<T> | ArrayLike<T>): Stack<T>
|
|
8
|
+
```
|
|
9
|
+
Factory function (no `new`). Iteration order of the input is preserved; the first item of the input becomes the head (index 0).
|
|
10
|
+
|
|
11
|
+
### Stack.of
|
|
12
|
+
```ts
|
|
13
|
+
Stack.of<T>(...values: Array<T>): Stack<T>
|
|
14
|
+
```
|
|
15
|
+
Creates a Stack with the given values; the first argument becomes the head.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { Stack } from 'immutable';
|
|
19
|
+
Stack.of(1, 2, 3); // => Stack [ 1, 2, 3 ] (head is 1)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Reading
|
|
23
|
+
|
|
24
|
+
### peek
|
|
25
|
+
```ts
|
|
26
|
+
peek(): T | undefined
|
|
27
|
+
```
|
|
28
|
+
Alias for `first()`; returns the value at the head without removing it.
|
|
29
|
+
|
|
30
|
+
### first
|
|
31
|
+
```ts
|
|
32
|
+
first(): T | undefined
|
|
33
|
+
```
|
|
34
|
+
Returns the value at index 0 (the head).
|
|
35
|
+
|
|
36
|
+
### last
|
|
37
|
+
```ts
|
|
38
|
+
last(): T | undefined
|
|
39
|
+
```
|
|
40
|
+
Returns the value at the tail. `O(n)` — Stack is singly-linked.
|
|
41
|
+
|
|
42
|
+
### get
|
|
43
|
+
```ts
|
|
44
|
+
get(key: number): T | undefined
|
|
45
|
+
get<NSV>(key: number, notSetValue: NSV): T | NSV
|
|
46
|
+
```
|
|
47
|
+
Index-based access; `O(n)` traversal from the head.
|
|
48
|
+
|
|
49
|
+
### size
|
|
50
|
+
```ts
|
|
51
|
+
readonly size: number
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### includes / has / indexOf / lastIndexOf / find / findIndex
|
|
55
|
+
```ts
|
|
56
|
+
includes(value: T): boolean
|
|
57
|
+
has(key: number): boolean
|
|
58
|
+
indexOf(searchValue: T): number
|
|
59
|
+
lastIndexOf(searchValue: T): number
|
|
60
|
+
find(predicate, context?, notSetValue?): T | undefined
|
|
61
|
+
findIndex(predicate, context?): number
|
|
62
|
+
```
|
|
63
|
+
Equality uses `Immutable.is`. `lastIndexOf` and `findLast*` walk the entire stack in reverse and are not efficient. `findEntry`, `findKey`, `keyOf`, `lastKeyOf`, `findLast`, `findLastIndex` are inherited from `Collection.Indexed`.
|
|
64
|
+
|
|
65
|
+
## Persistent changes (head)
|
|
66
|
+
|
|
67
|
+
All mutating operations target the FRONT of the Stack. This is the key behavioral difference from `List`/`Array`.
|
|
68
|
+
|
|
69
|
+
### push / unshift
|
|
70
|
+
```ts
|
|
71
|
+
push(...values: Array<T>): Stack<T>
|
|
72
|
+
unshift(...values: Array<T>): Stack<T>
|
|
73
|
+
```
|
|
74
|
+
Both prepend `values` to the FRONT (`push` is an alias for `unshift`), shifting existing values to higher indices. NOT equivalent to `List#push` / `Array#push`, which append to the tail. `O(1)` per value.
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
Stack.of(1, 2).push(0); // => Stack [ 0, 1, 2 ]
|
|
78
|
+
Stack.of(1, 2).push(9, 8); // => Stack [ 9, 8, 1, 2 ]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### pushAll / unshiftAll
|
|
82
|
+
```ts
|
|
83
|
+
pushAll(iter: Iterable<T>): Stack<T>
|
|
84
|
+
unshiftAll(iter: Iterable<T>): Stack<T>
|
|
85
|
+
```
|
|
86
|
+
Iterable-accepting variants; both prepend to the FRONT. `pushAll` is an alias for `unshiftAll`.
|
|
87
|
+
|
|
88
|
+
### pop / shift
|
|
89
|
+
```ts
|
|
90
|
+
pop(): Stack<T>
|
|
91
|
+
shift(): Stack<T>
|
|
92
|
+
```
|
|
93
|
+
Both remove the value at the FRONT (`pop` is an alias for `shift`). NOT equivalent to `List#pop` / `Array#pop`. Returns the new Stack, NOT the removed value — use `peek()`/`first()` to read the head before popping. Differs from `Array#shift` for the same reason.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
Stack.of(1, 2, 3).pop(); // => Stack [ 2, 3 ]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### clear
|
|
100
|
+
```ts
|
|
101
|
+
clear(): Stack<T>
|
|
102
|
+
```
|
|
103
|
+
Returns an empty Stack.
|
|
104
|
+
|
|
105
|
+
All of `push`, `pushAll`, `pop`, `unshift`, `unshiftAll`, `shift`, `clear` are safe inside `withMutations`.
|
|
106
|
+
|
|
107
|
+
## Sequence algorithms
|
|
108
|
+
|
|
109
|
+
### map / flatMap / filter / filterNot
|
|
110
|
+
```ts
|
|
111
|
+
map<M>(mapper: (value: T, key: number, iter: this) => M, context?: unknown): Stack<M>
|
|
112
|
+
flatMap<M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: unknown): Stack<M>
|
|
113
|
+
filter<F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: unknown): Set<F>
|
|
114
|
+
filter(predicate: (value: T, index: number, iter: this) => unknown, context?: unknown): this
|
|
115
|
+
filterNot(predicate: (value: T, index: number, iter: this) => boolean, context?: unknown): this
|
|
116
|
+
```
|
|
117
|
+
Each returns a new Stack instance (or refined `Set` for the type-guard `filter` overload).
|
|
118
|
+
|
|
119
|
+
### concat
|
|
120
|
+
```ts
|
|
121
|
+
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Stack<T | C>
|
|
122
|
+
```
|
|
123
|
+
Concatenates onto the END of this Stack (after the existing tail).
|
|
124
|
+
|
|
125
|
+
### reverse
|
|
126
|
+
```ts
|
|
127
|
+
reverse(): this
|
|
128
|
+
```
|
|
129
|
+
Eager and `O(n)` — Stack is singly-linked, so reverse traversal is not efficient.
|
|
130
|
+
|
|
131
|
+
### slice
|
|
132
|
+
```ts
|
|
133
|
+
slice(begin?: number, end?: number): this
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### sort / sortBy
|
|
137
|
+
```ts
|
|
138
|
+
sort(comparator?: Comparator<T>): this
|
|
139
|
+
sortBy<C>(comparatorValueMapper: (value: T, key: number, iter: this) => C, comparator?: Comparator<C>): this
|
|
140
|
+
```
|
|
141
|
+
Stable, eager. Default comparator uses `<`/`>`; comparator may also return a `PairSorting` enum value.
|
|
142
|
+
|
|
143
|
+
### groupBy
|
|
144
|
+
```ts
|
|
145
|
+
groupBy<G>(grouper: (value: T, key: number, iter: this) => G, context?: unknown): Map<G, Stack<T>>
|
|
146
|
+
```
|
|
147
|
+
Eager; returns a `Map<G, Stack<T>>`.
|
|
148
|
+
|
|
149
|
+
### partition
|
|
150
|
+
```ts
|
|
151
|
+
partition<F extends T, C>(predicate: (this: C, value: T, index: number, iter: this) => value is F, context?: C): [Stack<T>, Stack<F>]
|
|
152
|
+
partition<C>(predicate: (this: C, value: T, index: number, iter: this) => unknown, context?: C): [this, this]
|
|
153
|
+
```
|
|
154
|
+
Returns `[falseMatches, trueMatches]`.
|
|
155
|
+
|
|
156
|
+
### zip / zipAll / zipWith
|
|
157
|
+
```ts
|
|
158
|
+
zip<U>(other: Collection<unknown, U>): Stack<[T, U]>
|
|
159
|
+
zipAll<U>(other: Collection<unknown, U>): Stack<[T, U]>
|
|
160
|
+
zipWith<U, Z>(zipper: (value: T, otherValue: U) => Z, other: Collection<unknown, U>): Stack<Z>
|
|
161
|
+
```
|
|
162
|
+
`zip` stops at the shortest input; `zipAll` continues to the longest, padding with `undefined`.
|
|
163
|
+
|
|
164
|
+
## Conversion
|
|
165
|
+
|
|
166
|
+
### toArray / toJS / toJSON
|
|
167
|
+
```ts
|
|
168
|
+
toArray(): Array<T> // shallow; head becomes index 0
|
|
169
|
+
toJS(): Array<DeepCopy<T>> // deep
|
|
170
|
+
toJSON(): Array<T> // shallow (used by JSON.stringify)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### toSeq
|
|
174
|
+
```ts
|
|
175
|
+
toSeq(): Seq.Indexed<T>
|
|
176
|
+
```
|
|
177
|
+
Lazy `Seq.Indexed` view; also `toIndexedSeq()`, `toKeyedSeq()`, `toSetSeq()`.
|
|
178
|
+
|
|
179
|
+
### asMutable / asImmutable
|
|
180
|
+
```ts
|
|
181
|
+
asMutable(): this
|
|
182
|
+
asImmutable(): this
|
|
183
|
+
```
|
|
184
|
+
Manual transient pair; prefer `withMutations` for scoped batches.
|
|
185
|
+
|
|
186
|
+
## Mutation batching
|
|
187
|
+
|
|
188
|
+
### withMutations
|
|
189
|
+
```ts
|
|
190
|
+
withMutations(mutator: (mutable: this) => unknown): this
|
|
191
|
+
```
|
|
192
|
+
Apply a batch of head-mutations efficiently. Only methods documented as safe in `withMutations` may be used inside (`push`, `pushAll`, `pop`, `unshift`, `unshiftAll`, `shift`, `clear`).
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
Stack.of(1, 2).withMutations(s => {
|
|
196
|
+
s.push(0).push(-1).pop();
|
|
197
|
+
}); // => Stack [ 0, 1, 2 ]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### wasAltered
|
|
201
|
+
```ts
|
|
202
|
+
wasAltered(): boolean
|
|
203
|
+
```
|
|
204
|
+
True if the most recent operation produced a structurally different Stack.
|
|
205
|
+
|
|
206
|
+
## See also
|
|
207
|
+
|
|
208
|
+
- `collection.md` — `Collection.Indexed` superclass methods Stack inherits.
|
|
209
|
+
- `list.md` — when you need fast TAIL operations, random access, or `Array`-like `push`/`pop` semantics.
|
|
210
|
+
- `predicates.md` — `Stack.isStack(value)`.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: margaui
|
|
3
|
+
description: Use when writing HTML/CSS that uses the margaui component library — Tailwind v4 utility classes like `btn`, `card`, `alert`, `modal`, `navbar`, `dropdown`, `toast`, themes via `data-theme`. margaui is API-compatible with daisyUI, so this skill also applies when working with daisyUI markup. Provides per-component usage notes and copy-paste examples.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# margaui
|
|
7
|
+
|
|
8
|
+
margaui is a Tailwind v4–native CSS component library: 65 components defined as Tailwind v4 `@utility` classes, plus 35 themes selected via `data-theme` on any ancestor element.
|
|
9
|
+
|
|
10
|
+
## Relationship to daisyUI
|
|
11
|
+
|
|
12
|
+
margaui is **API-compatible with [daisyUI](https://daisyui.com/)**. The class names (`btn`, `btn-primary`, `card`, `card-body`, `alert-info`, `modal-box`, `dropdown-content`, …), modifier vocabulary, and DOM structure mirror daisyUI. Differences are implementation-level (Tailwind v4 native, in-browser compiler, `@supports` fallbacks for `color-mix`), not API-level.
|
|
13
|
+
|
|
14
|
+
Practical implication: **daisyUI documentation and examples are valid references** when this skill doesn't cover something. If a component is documented for daisyUI, the same markup works in margaui.
|
|
15
|
+
|
|
16
|
+
## Themes
|
|
17
|
+
|
|
18
|
+
Set on any element (most often `<html>` or `<body>`):
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<html data-theme="dracula">
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`light` is the default — applied via `:root` and `:host`, so pages work without an explicit `data-theme`. 35 themes available: `abyss`, `acid`, `aqua`, `autumn`, `black`, `bumblebee`, `business`, `caramellatte`, `cmyk`, `coffee`, `corporate`, `cupcake`, `cyberpunk`, `dark`, `dim`, `dracula`, `emerald`, `fantasy`, `forest`, `garden`, `halloween`, `lemonade`, `light`, `lofi`, `luxury`, `night`, `nord`, `pastel`, `retro`, `silk`, `sunset`, `synthwave`, `valentine`, `winter`, `wireframe`.
|
|
25
|
+
|
|
26
|
+
## Conventions across components
|
|
27
|
+
|
|
28
|
+
- **Theme-driven colors.** Use semantic color utilities (`bg-base-100`, `bg-base-200`, `text-base-content`, `text-primary`, `bg-primary`, `text-primary-content`, etc.) rather than hard-coded palette colors — this keeps components correct across all 35 themes.
|
|
29
|
+
- **Modifier suffixes are consistent.** Most components share the same vocabulary: color (`-primary`, `-secondary`, `-accent`, `-info`, `-success`, `-warning`, `-error`, `-neutral`, `-ghost`), style (`-outline`, `-soft`, `-dash`), size (`-xs`, `-sm`, `-md`, `-lg`, `-xl`), state (`-active`, `-disabled`).
|
|
30
|
+
- **Tailwind utilities work normally.** Responsive prefixes (`sm:`, `md:`, …), state variants (`hover:`, `focus:`, …), and arbitrary values all compose with margaui classes.
|
|
31
|
+
- **`@utility` classes, not `@apply`.** Internally components are defined with Tailwind v4's `@utility` directive, so they tree-shake on demand and can be combined freely.
|
|
32
|
+
|
|
33
|
+
## Component index
|
|
34
|
+
|
|
35
|
+
Read the linked file when the user's task involves that component. Each file has _What it does_, _When to use_, _Core classes_, and copy-paste HTML examples drawn from `playground/components/<name>/`.
|
|
36
|
+
|
|
37
|
+
- [accordion](components/accordion.md) — collapsible sections (single-open via radio, free via details)
|
|
38
|
+
- [alert](components/alert.md) — inline notification box (info / success / warning / error)
|
|
39
|
+
- [avatar](components/avatar.md) — user picture / placeholder, with optional ring, mask, presence
|
|
40
|
+
- [badge](components/badge.md) — small label / counter chip
|
|
41
|
+
- [breadcrumbs](components/breadcrumbs.md) — path-style navigation trail
|
|
42
|
+
- [button](components/button.md) — `btn` with color / size / shape / style modifiers
|
|
43
|
+
- [calendar](components/calendar.md) — date picker (uses external Cally web component)
|
|
44
|
+
- [card](components/card.md) — container with figure, body, title, actions
|
|
45
|
+
- [carousel](components/carousel.md) — horizontal/vertical scroll-snap slideshow
|
|
46
|
+
- [chat](components/chat.md) — chat bubble (start/end alignment)
|
|
47
|
+
- [checkbox](components/checkbox.md) — styled `<input type="checkbox">`
|
|
48
|
+
- [collapse](components/collapse.md) — single show/hide region (details/summary or checkbox)
|
|
49
|
+
- [countdown](components/countdown.md) — animated digit transitions for timers / clocks
|
|
50
|
+
- [diff](components/diff.md) — side-by-side image/text comparison with draggable handle
|
|
51
|
+
- [divider](components/divider.md) — horizontal / vertical separator with optional label
|
|
52
|
+
- [dock](components/dock.md) — bottom navigation bar (mobile-style)
|
|
53
|
+
- [drawer](components/drawer.md) — off-canvas sidebar (toggle via checkbox)
|
|
54
|
+
- [dropdown](components/dropdown.md) — click/hover/focus menu attached to a trigger
|
|
55
|
+
- [fab](components/fab.md) — floating action button (single or speed-dial)
|
|
56
|
+
- [fieldset](components/fieldset.md) — themed `<fieldset>` group with legend + label slots
|
|
57
|
+
- [file-input](components/file-input.md) — styled file picker
|
|
58
|
+
- [filter](components/filter.md) — radio-button filter group (with reset)
|
|
59
|
+
- [footer](components/footer.md) — page footer with column groupings
|
|
60
|
+
- [hero](components/hero.md) — full-width banner section (centered or with figure)
|
|
61
|
+
- [hover-3d](components/hover-3d.md) — 3D tilt effect on hover (cards / images)
|
|
62
|
+
- [hover-gallery](components/hover-gallery.md) — swap images by hovering across regions
|
|
63
|
+
- [indicator](components/indicator.md) — wrap an element to overlay a badge / status / button at a corner
|
|
64
|
+
- [input](components/input.md) — themed text-style input wrapper
|
|
65
|
+
- [join](components/join.md) — group adjacent items so borders/radii merge
|
|
66
|
+
- [kbd](components/kbd.md) — keyboard-key visual
|
|
67
|
+
- [label](components/label.md) — input label (inline or floating)
|
|
68
|
+
- [link](components/link.md) — themed `<a>`
|
|
69
|
+
- [list](components/list.md) — vertical list with grid-style columns
|
|
70
|
+
- [loading](components/loading.md) — loading spinner / dots / bars / ring / ball / infinity
|
|
71
|
+
- [mask](components/mask.md) — clip an element to a shape (circle, hex, star, …)
|
|
72
|
+
- [menu](components/menu.md) — vertical/horizontal nav list (sidebar, sub-menus)
|
|
73
|
+
- [mockup-browser](components/mockup-browser.md) — browser-window chrome wrapper for screenshots
|
|
74
|
+
- [mockup-code](components/mockup-code.md) — terminal/code-block visual
|
|
75
|
+
- [mockup-phone](components/mockup-phone.md) — phone-frame wrapper for screenshots
|
|
76
|
+
- [mockup-window](components/mockup-window.md) — OS-window chrome wrapper for screenshots
|
|
77
|
+
- [modal](components/modal.md) — dialog / pop-up (native `<dialog>` or checkbox-driven)
|
|
78
|
+
- [navbar](components/navbar.md) — top navigation bar with start/center/end slots
|
|
79
|
+
- [pagination](components/pagination.md) — paged-navigation button row
|
|
80
|
+
- [progress](components/progress.md) — linear progress bar (`<progress>`)
|
|
81
|
+
- [radial-progress](components/radial-progress.md) — circular progress indicator
|
|
82
|
+
- [radio](components/radio.md) — styled `<input type="radio">`
|
|
83
|
+
- [range](components/range.md) — styled `<input type="range">` slider
|
|
84
|
+
- [rating](components/rating.md) — star / heart rating (radio inputs + masks)
|
|
85
|
+
- [select](components/select.md) — styled `<select>`
|
|
86
|
+
- [skeleton](components/skeleton.md) — shimmering placeholder for loading content
|
|
87
|
+
- [stack](components/stack.md) — stack children (Z-axis)
|
|
88
|
+
- [stat](components/stat.md) — KPI / metric tile (title + value + desc)
|
|
89
|
+
- [status](components/status.md) — small colored status dot
|
|
90
|
+
- [steps](components/steps.md) — multi-step progress indicator
|
|
91
|
+
- [swap](components/swap.md) — toggle between two children (icon swap, hamburger)
|
|
92
|
+
- [tab](components/tab.md) — tabbed content (radio inputs or anchors)
|
|
93
|
+
- [table](components/table.md) — themed `<table>` (zebra, hover, pinned rows/cols, sizes)
|
|
94
|
+
- [text-rotate](components/text-rotate.md) — cycle through words in place (CSS animation)
|
|
95
|
+
- [textarea](components/textarea.md) — styled `<textarea>`
|
|
96
|
+
- [theme-controller](components/theme-controller.md) — checkbox / radio / dropdown that switches `data-theme`
|
|
97
|
+
- [timeline](components/timeline.md) — vertical or horizontal event timeline
|
|
98
|
+
- [toast](components/toast.md) — fixed-position notification stack (corner overlays)
|
|
99
|
+
- [toggle](components/toggle.md) — on/off switch (styled checkbox)
|
|
100
|
+
- [tooltip](components/tooltip.md) — hover/focus tooltip on any element
|
|
101
|
+
- [validator](components/validator.md) — show validation message tied to a form input
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# accordion
|
|
2
|
+
|
|
3
|
+
_collapsible sections (single-open via radio, free via details)_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Vertically stacked, expandable sections that show one panel of content at a time.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Grouped FAQ-style content where most items stay collapsed.
|
|
12
|
+
- For a single show/hide region without grouping, use **collapse** instead.
|
|
13
|
+
|
|
14
|
+
## Core classes
|
|
15
|
+
|
|
16
|
+
`collapse` on each item, all sharing the same `name="…"` (radio inputs) for single-open behavior; modifiers `collapse-arrow`, `collapse-plus`, `join-item` when wrapped in `join`.
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Accordion using details
|
|
21
|
+
|
|
22
|
+
Source: `playground/components/accordion/accordion-using-details.html`
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<details class="collapse bg-base-100 border border-base-300" name="my-accordion-det-1" open>
|
|
26
|
+
<summary class="collapse-title font-semibold">How do I create an account?</summary>
|
|
27
|
+
<div class="collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
|
|
28
|
+
</details>
|
|
29
|
+
<details class="collapse bg-base-100 border border-base-300" name="my-accordion-det-1">
|
|
30
|
+
<summary class="collapse-title font-semibold">I forgot my password. What should I do?</summary>
|
|
31
|
+
<div class="collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
|
|
32
|
+
</details>
|
|
33
|
+
<details class="collapse bg-base-100 border border-base-300" name="my-accordion-det-1">
|
|
34
|
+
<summary class="collapse-title font-semibold">How do I update my profile information?</summary>
|
|
35
|
+
<div class="collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
|
|
36
|
+
</details>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Accordion using radio inputs
|
|
40
|
+
|
|
41
|
+
Source: `playground/components/accordion/accordion-using-radio-inputs.html`
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<div class="collapse bg-base-100 border border-base-300">
|
|
45
|
+
<input type="radio" name="my-accordion-1" checked="checked" />
|
|
46
|
+
<div class="collapse-title font-semibold">How do I create an account?</div>
|
|
47
|
+
<div class="collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="collapse bg-base-100 border border-base-300">
|
|
50
|
+
<input type="radio" name="my-accordion-1" />
|
|
51
|
+
<div class="collapse-title font-semibold">I forgot my password. What should I do?</div>
|
|
52
|
+
<div class="collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="collapse bg-base-100 border border-base-300">
|
|
55
|
+
<input type="radio" name="my-accordion-1" />
|
|
56
|
+
<div class="collapse-title font-semibold">How do I update my profile information?</div>
|
|
57
|
+
<div class="collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Accordion with arrow icon
|
|
62
|
+
|
|
63
|
+
Source: `playground/components/accordion/accordion-with-arrow-icon.html`
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div class="collapse collapse-arrow bg-base-100 border border-base-300">
|
|
67
|
+
<input type="radio" name="my-accordion-2" checked="checked" />
|
|
68
|
+
<div class="collapse-title font-semibold">How do I create an account?</div>
|
|
69
|
+
<div class="collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="collapse collapse-arrow bg-base-100 border border-base-300">
|
|
72
|
+
<input type="radio" name="my-accordion-2" />
|
|
73
|
+
<div class="collapse-title font-semibold">I forgot my password. What should I do?</div>
|
|
74
|
+
<div class="collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="collapse collapse-arrow bg-base-100 border border-base-300">
|
|
77
|
+
<input type="radio" name="my-accordion-2" />
|
|
78
|
+
<div class="collapse-title font-semibold">How do I update my profile information?</div>
|
|
79
|
+
<div class="collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
|
|
80
|
+
</div>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Accordion with plusminus icon
|
|
84
|
+
|
|
85
|
+
Source: `playground/components/accordion/accordion-with-plusminus-icon.html`
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<div class="collapse collapse-plus bg-base-100 border border-base-300">
|
|
89
|
+
<input type="radio" name="my-accordion-3" checked="checked" />
|
|
90
|
+
<div class="collapse-title font-semibold">How do I create an account?</div>
|
|
91
|
+
<div class="collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="collapse collapse-plus bg-base-100 border border-base-300">
|
|
94
|
+
<input type="radio" name="my-accordion-3" />
|
|
95
|
+
<div class="collapse-title font-semibold">I forgot my password. What should I do?</div>
|
|
96
|
+
<div class="collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="collapse collapse-plus bg-base-100 border border-base-300">
|
|
99
|
+
<input type="radio" name="my-accordion-3" />
|
|
100
|
+
<div class="collapse-title font-semibold">How do I update my profile information?</div>
|
|
101
|
+
<div class="collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
|
|
102
|
+
</div>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Using accordion and join together
|
|
106
|
+
|
|
107
|
+
Source: `playground/components/accordion/using-accordion-and-join-together.html`
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<div class="join join-vertical bg-base-100">
|
|
111
|
+
<div class="collapse collapse-arrow join-item border-base-300 border">
|
|
112
|
+
<input type="radio" name="my-accordion-4" checked="checked" />
|
|
113
|
+
<div class="collapse-title font-semibold">How do I create an account?</div>
|
|
114
|
+
<div class="collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="collapse collapse-arrow join-item border-base-300 border">
|
|
117
|
+
<input type="radio" name="my-accordion-4" />
|
|
118
|
+
<div class="collapse-title font-semibold">I forgot my password. What should I do?</div>
|
|
119
|
+
<div class="collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="collapse collapse-arrow join-item border-base-300 border">
|
|
122
|
+
<input type="radio" name="my-accordion-4" />
|
|
123
|
+
<div class="collapse-title font-semibold">How do I update my profile information?</div>
|
|
124
|
+
<div class="collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
```
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# alert
|
|
2
|
+
|
|
3
|
+
_inline notification box (info / success / warning / error)_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Inline, non-blocking notification box with an icon and message, optionally with action buttons.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Persistent feedback inline with content (form errors, status banners).
|
|
12
|
+
- For transient pop-ups that auto-dismiss, use **toast** instead.
|
|
13
|
+
|
|
14
|
+
## Core classes
|
|
15
|
+
|
|
16
|
+
`alert`; color `alert-info|success|warning|error`; style `alert-outline|dash|soft`; usually paired with `role="alert"`.
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Alert
|
|
21
|
+
|
|
22
|
+
Source: `playground/components/alert/alert.html`
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div role="alert" class="alert">
|
|
26
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 shrink-0">
|
|
27
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
28
|
+
</svg>
|
|
29
|
+
<span>12 unread messages. Tap to see.</span>
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Alert dash style
|
|
34
|
+
|
|
35
|
+
Source: `playground/components/alert/alert-dash-style.html`
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<div role="alert" class="alert alert-info alert-dash">
|
|
39
|
+
<span>12 unread messages. Tap to see.</span>
|
|
40
|
+
</div>
|
|
41
|
+
<div role="alert" class="alert alert-success alert-dash">
|
|
42
|
+
<span>Your purchase has been confirmed!</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div role="alert" class="alert alert-warning alert-dash">
|
|
45
|
+
<span>Warning: Invalid email address!</span>
|
|
46
|
+
</div>
|
|
47
|
+
<div role="alert" class="alert alert-error alert-dash">
|
|
48
|
+
<span>Error! Task failed successfully.</span>
|
|
49
|
+
</div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Alert outline style
|
|
53
|
+
|
|
54
|
+
Source: `playground/components/alert/alert-outline-style.html`
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div role="alert" class="alert alert-info alert-outline">
|
|
58
|
+
<span>12 unread messages. Tap to see.</span>
|
|
59
|
+
</div>
|
|
60
|
+
<div role="alert" class="alert alert-success alert-outline">
|
|
61
|
+
<span>Your purchase has been confirmed!</span>
|
|
62
|
+
</div>
|
|
63
|
+
<div role="alert" class="alert alert-warning alert-outline">
|
|
64
|
+
<span>Warning: Invalid email address!</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div role="alert" class="alert alert-error alert-outline">
|
|
67
|
+
<span>Error! Task failed successfully.</span>
|
|
68
|
+
</div>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Alert soft style
|
|
72
|
+
|
|
73
|
+
Source: `playground/components/alert/alert-soft-style.html`
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<div role="alert" class="alert alert-info alert-soft">
|
|
77
|
+
<span>12 unread messages. Tap to see.</span>
|
|
78
|
+
</div>
|
|
79
|
+
<div role="alert" class="alert alert-success alert-soft">
|
|
80
|
+
<span>Your purchase has been confirmed!</span>
|
|
81
|
+
</div>
|
|
82
|
+
<div role="alert" class="alert alert-warning alert-soft">
|
|
83
|
+
<span>Warning: Invalid email address!</span>
|
|
84
|
+
</div>
|
|
85
|
+
<div role="alert" class="alert alert-error alert-soft">
|
|
86
|
+
<span>Error! Task failed successfully.</span>
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Alert with buttons — responsive
|
|
91
|
+
|
|
92
|
+
Source: `playground/components/alert/alert-with-buttons--responsive.html`
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<div role="alert" class="alert alert-vertical sm:alert-horizontal">
|
|
96
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 shrink-0">
|
|
97
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
98
|
+
</svg>
|
|
99
|
+
<span>we use cookies for no reason.</span>
|
|
100
|
+
<div>
|
|
101
|
+
<button class="btn btn-sm">Deny</button>
|
|
102
|
+
<button class="btn btn-sm btn-primary">Accept</button>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Alert with title and description
|
|
108
|
+
|
|
109
|
+
Source: `playground/components/alert/alert-with-title-and-description.html`
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<div role="alert" class="alert alert-vertical sm:alert-horizontal">
|
|
113
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 shrink-0">
|
|
114
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
115
|
+
</svg>
|
|
116
|
+
<div>
|
|
117
|
+
<h3 class="font-bold">New message!</h3>
|
|
118
|
+
<div class="text-xs">You have 1 unread message</div>
|
|
119
|
+
</div>
|
|
120
|
+
<button class="btn btn-sm">See</button>
|
|
121
|
+
</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Error color
|
|
125
|
+
|
|
126
|
+
Source: `playground/components/alert/error-color.html`
|
|
127
|
+
|
|
128
|
+
```html
|
|
129
|
+
<div role="alert" class="alert alert-error">
|
|
130
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
|
131
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
132
|
+
</svg>
|
|
133
|
+
<span>Error! Task failed successfully.</span>
|
|
134
|
+
</div>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Info color
|
|
138
|
+
|
|
139
|
+
Source: `playground/components/alert/info-color.html`
|
|
140
|
+
|
|
141
|
+
```html
|
|
142
|
+
<div role="alert" class="alert alert-info">
|
|
143
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="h-6 w-6 shrink-0 stroke-current">
|
|
144
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
145
|
+
</svg>
|
|
146
|
+
<span>New software update available.</span>
|
|
147
|
+
</div>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Success color
|
|
151
|
+
|
|
152
|
+
Source: `playground/components/alert/success-color.html`
|
|
153
|
+
|
|
154
|
+
```html
|
|
155
|
+
<div role="alert" class="alert alert-success">
|
|
156
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
|
157
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
158
|
+
</svg>
|
|
159
|
+
<span>Your purchase has been confirmed!</span>
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Warning color
|
|
164
|
+
|
|
165
|
+
Source: `playground/components/alert/warning-color.html`
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<div role="alert" class="alert alert-warning">
|
|
169
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
|
170
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
|
171
|
+
</svg>
|
|
172
|
+
<span>Warning: Invalid email address!</span>
|
|
173
|
+
</div>
|
|
174
|
+
```
|