tutuca 0.11.2 → 0.12.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/dist/tutuca-cli.js +130 -104
- package/dist/tutuca-dev.ext.js +121 -90
- package/dist/tutuca-dev.js +121 -90
- package/dist/tutuca-dev.min.js +3 -3
- package/dist/tutuca-extra.ext.js +116 -59
- package/dist/tutuca-extra.js +116 -59
- package/dist/tutuca-extra.min.js +2 -2
- package/dist/tutuca-storybook.js +3 -3
- package/dist/tutuca.ext.js +116 -59
- package/dist/tutuca.js +116 -59
- package/dist/tutuca.min.js +2 -2
- package/package.json +1 -1
- package/skill/margaui/SKILL.md +105 -0
- package/skill/margaui/components/accordion.md +127 -0
- package/skill/margaui/components/alert.md +174 -0
- package/skill/margaui/components/aura.md +97 -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/megamenu.md +131 -0
- package/skill/margaui/components/menu.md +887 -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 +196 -0
- package/skill/margaui/components/navbar.md +282 -0
- package/skill/margaui/components/otp.md +171 -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/tutuca/SKILL.md +56 -0
- package/skill/tutuca/advanced.md +212 -0
- package/skill/tutuca/cli.md +239 -0
- package/skill/tutuca/component-design.md +168 -0
- package/skill/tutuca/core.md +918 -0
- package/skill/tutuca/iteration.md +207 -0
- package/skill/tutuca/macros.md +86 -0
- package/skill/tutuca/margaui.md +175 -0
- package/skill/tutuca/messages-and-intents.md +399 -0
- package/skill/tutuca/patterns/README.md +48 -0
- package/skill/tutuca/patterns/add-a-story.md +26 -0
- package/skill/tutuca/patterns/bind-text-and-attributes.md +30 -0
- package/skill/tutuca/patterns/conditional-attribute-value.md +29 -0
- package/skill/tutuca/patterns/coordinate-components.md +54 -0
- package/skill/tutuca/patterns/edit-through-a-dynamic-target.md +27 -0
- package/skill/tutuca/patterns/enrich-each-item.md +25 -0
- package/skill/tutuca/patterns/file-input.md +39 -0
- package/skill/tutuca/patterns/filter-a-list.md +25 -0
- package/skill/tutuca/patterns/filter-and-paginate.md +60 -0
- package/skill/tutuca/patterns/handle-events.md +44 -0
- package/skill/tutuca/patterns/iterate-a-list.md +18 -0
- package/skill/tutuca/patterns/paginate-a-list.md +29 -0
- package/skill/tutuca/patterns/render-a-child-component.md +21 -0
- package/skill/tutuca/patterns/reuse-markup-with-macros.md +36 -0
- package/skill/tutuca/patterns/share-state-across-the-tree.md +38 -0
- package/skill/tutuca/patterns/show-or-hide-content.md +23 -0
- package/skill/tutuca/patterns/switch-between-views.md +30 -0
- package/skill/tutuca/patterns/tabbed-interface.md +43 -0
- package/skill/tutuca/semantics.md +195 -0
- package/skill/tutuca/storybook.md +270 -0
- package/skill/tutuca/styles.md +48 -0
- package/skill/tutuca/testing.md +345 -0
- package/skill/tutuca-source/SKILL.md +33 -0
- package/skill/tutuca-source/tutuca.ext.js +4301 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# toast
|
|
2
|
+
|
|
3
|
+
_fixed-position notification stack (corner overlays)_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Fixed-position container for transient notifications. Position via `toast-start|center|end` × `toast-top|middle|bottom`.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Transient feedback ("saved", "copied", "error sending").
|
|
12
|
+
- For inline persistent feedback, use **alert**.
|
|
13
|
+
|
|
14
|
+
## Core classes
|
|
15
|
+
|
|
16
|
+
`toast`; horizontal `toast-start|center|end`; vertical `toast-top|middle|bottom`. Typically wraps **alert** children.
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Toast center toast bottom default
|
|
21
|
+
|
|
22
|
+
Source: `playground/components/toast/toast-center-toast-bottom-default.html`
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div class="toast toast-center">
|
|
26
|
+
<div class="alert alert-info">
|
|
27
|
+
<span>New mail arrived.</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="alert alert-success">
|
|
30
|
+
<span>Message sent successfully.</span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Toast center toast middle
|
|
36
|
+
|
|
37
|
+
Source: `playground/components/toast/toast-center-toast-middle.html`
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<div class="toast toast-center toast-middle">
|
|
41
|
+
<div class="alert alert-info">
|
|
42
|
+
<span>New mail arrived.</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="alert alert-success">
|
|
45
|
+
<span>Message sent successfully.</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Toast end default toast bottom default
|
|
51
|
+
|
|
52
|
+
Source: `playground/components/toast/toast-end-default-toast-bottom-default.html`
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div class="toast toast-end">
|
|
56
|
+
<div class="alert alert-info">
|
|
57
|
+
<span>New mail arrived.</span>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="alert alert-success">
|
|
60
|
+
<span>Message sent successfully.</span>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Toast end toast middle
|
|
66
|
+
|
|
67
|
+
Source: `playground/components/toast/toast-end-toast-middle.html`
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<div class="toast toast-end toast-middle">
|
|
71
|
+
<div class="alert alert-info">
|
|
72
|
+
<span>New mail arrived.</span>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="alert alert-success">
|
|
75
|
+
<span>Message sent successfully.</span>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Toast start toast bottom default
|
|
81
|
+
|
|
82
|
+
Source: `playground/components/toast/toast-start-toast-bottom-default.html`
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<div class="toast toast-start">
|
|
86
|
+
<div class="alert alert-info">
|
|
87
|
+
<span>New mail arrived.</span>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="alert alert-success">
|
|
90
|
+
<span>Message sent successfully.</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Toast start toast middle
|
|
96
|
+
|
|
97
|
+
Source: `playground/components/toast/toast-start-toast-middle.html`
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<div class="toast toast-start toast-middle">
|
|
101
|
+
<div class="alert alert-info">
|
|
102
|
+
<span>New mail arrived.</span>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="alert alert-success">
|
|
105
|
+
<span>Message sent successfully.</span>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Toast top toast center
|
|
111
|
+
|
|
112
|
+
Source: `playground/components/toast/toast-top-toast-center.html`
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<div class="toast toast-top toast-center">
|
|
116
|
+
<div class="alert alert-info">
|
|
117
|
+
<span>New mail arrived.</span>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="alert alert-success">
|
|
120
|
+
<span>Message sent successfully.</span>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Toast top toast end
|
|
126
|
+
|
|
127
|
+
Source: `playground/components/toast/toast-top-toast-end.html`
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<div class="toast toast-top toast-end">
|
|
131
|
+
<div class="alert alert-info">
|
|
132
|
+
<span>New mail arrived.</span>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="alert alert-success">
|
|
135
|
+
<span>Message sent successfully.</span>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Toast top toast start
|
|
141
|
+
|
|
142
|
+
Source: `playground/components/toast/toast-top-toast-start.html`
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<div class="toast toast-top toast-start">
|
|
146
|
+
<div class="alert alert-info">
|
|
147
|
+
<span>New mail arrived.</span>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="alert alert-success">
|
|
150
|
+
<span>Message sent successfully.</span>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Toast with alert inside
|
|
156
|
+
|
|
157
|
+
Source: `playground/components/toast/toast-with-alert-inside.html`
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<div class="toast">
|
|
161
|
+
<div class="alert alert-info">
|
|
162
|
+
<span>New message arrived.</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# toggle
|
|
2
|
+
|
|
3
|
+
_on/off switch (styled checkbox)_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Sliding on/off switch — a styled `<input type="checkbox">`.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Boolean settings where switch metaphor fits.
|
|
12
|
+
- For multi-select lists, use **checkbox**.
|
|
13
|
+
|
|
14
|
+
## Core classes
|
|
15
|
+
|
|
16
|
+
`toggle`; color `toggle-primary|secondary|accent|info|success|warning|error|neutral`; size `toggle-xs|sm|md|lg|xl`.
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Colors
|
|
21
|
+
|
|
22
|
+
Source: `playground/components/toggle/colors.html`
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<input type="checkbox" checked="checked" class="toggle toggle-primary" />
|
|
26
|
+
<input type="checkbox" checked="checked" class="toggle toggle-secondary" />
|
|
27
|
+
<input type="checkbox" checked="checked" class="toggle toggle-accent" />
|
|
28
|
+
<input type="checkbox" checked="checked" class="toggle toggle-neutral" />
|
|
29
|
+
|
|
30
|
+
<input type="checkbox" checked="checked" class="toggle toggle-info" />
|
|
31
|
+
<input type="checkbox" checked="checked" class="toggle toggle-success" />
|
|
32
|
+
<input type="checkbox" checked="checked" class="toggle toggle-warning" />
|
|
33
|
+
<input type="checkbox" checked="checked" class="toggle toggle-error" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Disabled
|
|
37
|
+
|
|
38
|
+
Source: `playground/components/toggle/disabled.html`
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<input type="checkbox" class="toggle" disabled />
|
|
42
|
+
<input type="checkbox" class="toggle" disabled checked="checked" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Indeterminate
|
|
46
|
+
|
|
47
|
+
Source: `playground/components/toggle/indeterminate.html`
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<!-- You can make a checkbox indeterminate using JS -->
|
|
51
|
+
<script>
|
|
52
|
+
document.getElementById("my-toggle").indeterminate = true
|
|
53
|
+
</script>
|
|
54
|
+
<input type="checkbox" class="toggle" id="my-toggle" />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Sizes
|
|
58
|
+
|
|
59
|
+
Source: `playground/components/toggle/sizes.html`
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<input type="checkbox" checked="checked" class="toggle toggle-xs" />
|
|
63
|
+
<input type="checkbox" checked="checked" class="toggle toggle-sm" />
|
|
64
|
+
<input type="checkbox" checked="checked" class="toggle toggle-md" />
|
|
65
|
+
<input type="checkbox" checked="checked" class="toggle toggle-lg" />
|
|
66
|
+
<input type="checkbox" checked="checked" class="toggle toggle-xl" />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Toggle switch
|
|
70
|
+
|
|
71
|
+
Source: `playground/components/toggle/toggle-switch.html`
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<input type="checkbox" checked="checked" class="toggle" />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Toggle with custom colors
|
|
78
|
+
|
|
79
|
+
Source: `playground/components/toggle/toggle-with-custom-colors.html`
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<input
|
|
83
|
+
type="checkbox"
|
|
84
|
+
checked="checked"
|
|
85
|
+
class="toggle border-indigo-600 bg-indigo-500 checked:border-orange-500 checked:bg-orange-400 checked:text-orange-800"
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Toggle with icons inside
|
|
90
|
+
|
|
91
|
+
Source: `playground/components/toggle/toggle-with-icons-inside.html`
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<label class="toggle text-base-content">
|
|
95
|
+
<input type="checkbox" />
|
|
96
|
+
<svg aria-label="enabled" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
97
|
+
<g
|
|
98
|
+
stroke-linejoin="round"
|
|
99
|
+
stroke-linecap="round"
|
|
100
|
+
stroke-width="4"
|
|
101
|
+
fill="none"
|
|
102
|
+
stroke="currentColor"
|
|
103
|
+
>
|
|
104
|
+
<path d="M20 6 9 17l-5-5"></path>
|
|
105
|
+
</g>
|
|
106
|
+
</svg>
|
|
107
|
+
<svg
|
|
108
|
+
aria-label="disabled"
|
|
109
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
110
|
+
viewBox="0 0 24 24"
|
|
111
|
+
fill="none"
|
|
112
|
+
stroke="currentColor"
|
|
113
|
+
stroke-width="4"
|
|
114
|
+
stroke-linecap="round"
|
|
115
|
+
stroke-linejoin="round"
|
|
116
|
+
>
|
|
117
|
+
<path d="M18 6 6 18" />
|
|
118
|
+
<path d="m6 6 12 12" />
|
|
119
|
+
</svg>
|
|
120
|
+
</label>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### With fieldset and label
|
|
124
|
+
|
|
125
|
+
Source: `playground/components/toggle/with-fieldset-and-label.html`
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<fieldset class="fieldset bg-base-100 border-base-300 rounded-box w-64 border p-4">
|
|
129
|
+
<legend class="fieldset-legend">Login options</legend>
|
|
130
|
+
<label class="label">
|
|
131
|
+
<input type="checkbox" checked="checked" class="toggle" />
|
|
132
|
+
Remember me
|
|
133
|
+
</label>
|
|
134
|
+
</fieldset>
|
|
135
|
+
```
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# tooltip
|
|
2
|
+
|
|
3
|
+
_hover/focus tooltip on any element_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Hover/focus tooltip; content from `data-tip` or a child `tooltip-content` element.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Short hints on icon-only buttons or controls.
|
|
12
|
+
- For longer content panels, use **dropdown**.
|
|
13
|
+
|
|
14
|
+
## Core classes
|
|
15
|
+
|
|
16
|
+
`tooltip`; position `tooltip-top|bottom|left|right`; align `tooltip-start|center|end`; color `tooltip-primary|…`; modifier `tooltip-open` to force-show; `data-tip="…"` for text content.
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
### Tooltip
|
|
21
|
+
|
|
22
|
+
Source: `playground/components/tooltip/tooltip.html`
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div class="tooltip" data-tip="hello">
|
|
26
|
+
<button class="btn">Hover me</button>
|
|
27
|
+
</div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Accent color
|
|
31
|
+
|
|
32
|
+
Source: `playground/components/tooltip/accent-color.html`
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<div class="tooltip tooltip-open tooltip-accent" data-tip="accent">
|
|
36
|
+
<button class="btn btn-accent">accent</button>
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Bottom
|
|
41
|
+
|
|
42
|
+
Source: `playground/components/tooltip/bottom.html`
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<div class="tooltip tooltip-open tooltip-bottom" data-tip="hello">
|
|
46
|
+
<button class="btn">Bottom</button>
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Error color
|
|
51
|
+
|
|
52
|
+
Source: `playground/components/tooltip/error-color.html`
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div class="tooltip tooltip-open tooltip-error" data-tip="error">
|
|
56
|
+
<button class="btn btn-error">error</button>
|
|
57
|
+
</div>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Force open
|
|
61
|
+
|
|
62
|
+
Source: `playground/components/tooltip/force-open.html`
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<div class="tooltip tooltip-open" data-tip="hello">
|
|
66
|
+
<button class="btn">Force open</button>
|
|
67
|
+
</div>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Info color
|
|
71
|
+
|
|
72
|
+
Source: `playground/components/tooltip/info-color.html`
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<div class="tooltip tooltip-open tooltip-info" data-tip="info">
|
|
76
|
+
<button class="btn btn-info">info</button>
|
|
77
|
+
</div>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Left
|
|
81
|
+
|
|
82
|
+
Source: `playground/components/tooltip/left.html`
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<div class="tooltip tooltip-open tooltip-left" data-tip="hello">
|
|
86
|
+
<button class="btn">Left</button>
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Neutral color
|
|
91
|
+
|
|
92
|
+
Source: `playground/components/tooltip/neutral-color.html`
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<div class="tooltip tooltip-open tooltip-neutral" data-tip="neutral">
|
|
96
|
+
<button class="btn btn-neutral">neutral</button>
|
|
97
|
+
</div>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Primary color
|
|
101
|
+
|
|
102
|
+
Source: `playground/components/tooltip/primary-color.html`
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<div class="tooltip tooltip-open tooltip-primary" data-tip="primary">
|
|
106
|
+
<button class="btn btn-primary">primary</button>
|
|
107
|
+
</div>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Responsive tooltip only show for large screen
|
|
111
|
+
|
|
112
|
+
Source: `playground/components/tooltip/responsive-tooltip-only-show-for-large-screen.html`
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<div class="lg:tooltip" data-tip="hello">
|
|
116
|
+
<button class="btn">Hover me</button>
|
|
117
|
+
</div>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Right
|
|
121
|
+
|
|
122
|
+
Source: `playground/components/tooltip/right.html`
|
|
123
|
+
|
|
124
|
+
```html
|
|
125
|
+
<div class="tooltip tooltip-open tooltip-right" data-tip="hello">
|
|
126
|
+
<button class="btn">Right</button>
|
|
127
|
+
</div>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Secondary color
|
|
131
|
+
|
|
132
|
+
Source: `playground/components/tooltip/secondary-color.html`
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<div class="tooltip tooltip-open tooltip-secondary" data-tip="secondary">
|
|
136
|
+
<button class="btn btn-secondary">secondary</button>
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Success color
|
|
141
|
+
|
|
142
|
+
Source: `playground/components/tooltip/success-color.html`
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<div class="tooltip tooltip-open tooltip-success" data-tip="success">
|
|
146
|
+
<button class="btn btn-success">success</button>
|
|
147
|
+
</div>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Tooltip with tooltip content
|
|
151
|
+
|
|
152
|
+
Source: `playground/components/tooltip/tooltip-with-tooltip-content.html`
|
|
153
|
+
|
|
154
|
+
```html
|
|
155
|
+
<div class="tooltip">
|
|
156
|
+
<div class="tooltip-content">
|
|
157
|
+
<div class="animate-bounce text-orange-400 -rotate-10 text-2xl font-black">Wow!</div>
|
|
158
|
+
</div>
|
|
159
|
+
<button class="btn">Hover me</button>
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Top
|
|
164
|
+
|
|
165
|
+
Source: `playground/components/tooltip/top.html`
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<div class="tooltip tooltip-open tooltip-top" data-tip="hello">
|
|
169
|
+
<button class="btn">Top</button>
|
|
170
|
+
</div>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Warning color
|
|
174
|
+
|
|
175
|
+
Source: `playground/components/tooltip/warning-color.html`
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
<div class="tooltip tooltip-open tooltip-warning" data-tip="warning">
|
|
179
|
+
<button class="btn btn-warning">warning</button>
|
|
180
|
+
</div>
|
|
181
|
+
```
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# validator
|
|
2
|
+
|
|
3
|
+
_show validation message tied to a form input_
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Companion to **input** / **select** / **textarea** that styles the input based on `:invalid` and shows a `validator-hint` message.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- Inline form-field validation feedback driven by native HTML constraints.
|
|
12
|
+
|
|
13
|
+
## Core classes
|
|
14
|
+
|
|
15
|
+
`validator` on the input; `validator-hint` on the message element.
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
### Validator
|
|
20
|
+
|
|
21
|
+
Source: `playground/components/validator/validator.html`
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<input class="input validator" type="email" required placeholder="mail@site.com" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Checkbox requirement validator
|
|
28
|
+
|
|
29
|
+
Source: `playground/components/validator/checkbox-requirement-validator.html`
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<input type="checkbox" class="checkbox validator" required title="Required" />
|
|
33
|
+
<p class="validator-hint">Required</p>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Date input requirement validator
|
|
37
|
+
|
|
38
|
+
Source: `playground/components/validator/date-input-requirement-validator.html`
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<input type="date" class="input validator" required placeholder="Pick a date in 2025"
|
|
42
|
+
min="2025-01-01" max="2025-12-31"
|
|
43
|
+
title="Must be valid URL" />
|
|
44
|
+
<p class="validator-hint">Must be 2025</p>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Form requirement validator
|
|
48
|
+
|
|
49
|
+
Source: `playground/components/validator/form-requirement-validator.html`
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<form class="fieldset bg-base-200 border-base-300 rounded-box w-xs border p-4">
|
|
53
|
+
<fieldset class="fieldset">
|
|
54
|
+
<label class="label">Email</label>
|
|
55
|
+
<input type="email" class="input validator" placeholder="Email" required />
|
|
56
|
+
<p class="validator-hint hidden">Required</p>
|
|
57
|
+
</fieldset>
|
|
58
|
+
|
|
59
|
+
<label class="fieldset">
|
|
60
|
+
<span class="label">Password</span>
|
|
61
|
+
<input type="password" class="input validator" placeholder="Password" required />
|
|
62
|
+
<span class="validator-hint hidden">Required</span>
|
|
63
|
+
</label>
|
|
64
|
+
|
|
65
|
+
<button class="btn btn-neutral mt-4" type="submit">Login</button>
|
|
66
|
+
<button class="btn btn-ghost mt-1" type="reset">Reset</button>
|
|
67
|
+
</form>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Number input requirement validator
|
|
71
|
+
|
|
72
|
+
Source: `playground/components/validator/number-input-requirement-validator.html`
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<input type="number" class="input validator" required placeholder="Type a number between 1 to 10"
|
|
76
|
+
min="1" max="10"
|
|
77
|
+
title="Must be between be 1 to 10" />
|
|
78
|
+
<p class="validator-hint">Must be between be 1 to 10</p>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Password requirement validator
|
|
82
|
+
|
|
83
|
+
Source: `playground/components/validator/password-requirement-validator.html`
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<input type="password" class="input validator" required placeholder="Password" minlength="8"
|
|
87
|
+
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
|
|
88
|
+
title="Must be more than 8 characters, including number, lowercase letter, uppercase letter" />
|
|
89
|
+
<p class="validator-hint">
|
|
90
|
+
Must be more than 8 characters, including
|
|
91
|
+
<br/>At least one number
|
|
92
|
+
<br/>At least one lowercase letter
|
|
93
|
+
<br/>At least one uppercase letter
|
|
94
|
+
</p>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Phone number requirement validator
|
|
98
|
+
|
|
99
|
+
Source: `playground/components/validator/phone-number-requirement-validator.html`
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<input type="tel" class="input validator tabular-nums" required placeholder="Phone"
|
|
103
|
+
pattern="[0-9]*" minlength="10" maxlength="10" title="Must be 10 digits" />
|
|
104
|
+
<p class="validator-hint">Must be 10 digits</p>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Select requirement validator
|
|
108
|
+
|
|
109
|
+
Source: `playground/components/validator/select-requirement-validator.html`
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<form>
|
|
113
|
+
<select class="select validator" required>
|
|
114
|
+
<option disabled selected value="">Choose:</option>
|
|
115
|
+
<option>Tabs</option>
|
|
116
|
+
<option>Spaces</option>
|
|
117
|
+
</select>
|
|
118
|
+
<p class="validator-hint">Required</p>
|
|
119
|
+
<button class="btn" type="submit">Submit form</button>
|
|
120
|
+
</form>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Toggle requirement validator
|
|
124
|
+
|
|
125
|
+
Source: `playground/components/validator/toggle-requirement-validator.html`
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<input type="checkbox" class="toggle validator" required title="Required" />
|
|
129
|
+
<p class="validator-hint">Required</p>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Url input requirement validator
|
|
133
|
+
|
|
134
|
+
Source: `playground/components/validator/url-input-requirement-validator.html`
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<input type="url" class="input validator" required placeholder="https://" value="https://"
|
|
138
|
+
pattern="^(https?://)?([a-zA-Z0-9]([a-zA-Z0-9-].*[a-zA-Z0-9])?.)+[a-zA-Z].*$"
|
|
139
|
+
title="Must be valid URL" />
|
|
140
|
+
<p class="validator-hint">Must be valid URL</p>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Username requirement validator
|
|
144
|
+
|
|
145
|
+
Source: `playground/components/validator/username-requirement-validator.html`
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<input type="text" class="input validator" required placeholder="Username"
|
|
149
|
+
pattern="[A-Za-z][A-Za-z0-9\-]*" minlength="3" maxlength="30" title="Only letters, numbers or dash" />
|
|
150
|
+
<p class="validator-hint">
|
|
151
|
+
Must be 3 to 30 characters
|
|
152
|
+
<br/>containing only letters, numbers or dash
|
|
153
|
+
</p>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Validator and validator hint
|
|
157
|
+
|
|
158
|
+
Source: `playground/components/validator/validator-and-validator-hint.html`
|
|
159
|
+
|
|
160
|
+
```html
|
|
161
|
+
<input class="input validator" type="email" required placeholder="mail@site.com" />
|
|
162
|
+
<div class="validator-hint">Enter valid email address</div>
|
|
163
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tutuca
|
|
3
|
+
description: Use when authoring or reviewing tutuca modules — `component({...})` definitions, `html`...`` views, `@`-directives, `receive` / `intent` / `alter` handlers, macros, or `getTests` exports — or when running the `tutuca` CLI (`lint` / `test` / `render` / `show`). Covers the post-edit `tutuca lint <module>` → `test` → `render --title "<example>"` verification recipe.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Source of truth: docs/skill/. The skill/tutuca/ copy is generated by scripts/build-skill.js — edit docs/skill/, not skill/. -->
|
|
7
|
+
|
|
8
|
+
# Tutuca
|
|
9
|
+
|
|
10
|
+
Tutuca is an immutable-state SPA framework. Read [core.md](./core.md)
|
|
11
|
+
first for the framework primer.
|
|
12
|
+
|
|
13
|
+
## Verifying changes
|
|
14
|
+
|
|
15
|
+
After editing a tutuca module, run these before declaring the edit done:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
tutuca lint <module> # undefined fields/handlers/macros (exit 2 on errors)
|
|
19
|
+
tutuca test <module> # getTests() behavior checks (exit 4 on failures)
|
|
20
|
+
tutuca render <module> --title "<example>" # mount the example covering the change (exit 3 on crash)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Full recipe — when to skip `test`, adding a covering example, the
|
|
24
|
+
project-wide `storybook --dry-run` smoke test — in
|
|
25
|
+
[core.md](./core.md#verifying-changes).
|
|
26
|
+
|
|
27
|
+
## Companion skills
|
|
28
|
+
|
|
29
|
+
When authoring tutuca code, also load these if available:
|
|
30
|
+
|
|
31
|
+
- **margaui** — the Tailwind v4 / daisyUI-compatible class library.
|
|
32
|
+
Reach for it when the project uses MargaUI / Tailwind class lists in
|
|
33
|
+
`class=` / `:class=`. See [margaui.md](./margaui.md) to set it up in a
|
|
34
|
+
project and wire it into tutuca.
|
|
35
|
+
|
|
36
|
+
## Routing
|
|
37
|
+
|
|
38
|
+
| Task | File |
|
|
39
|
+
| ---------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
40
|
+
| Authoring `component({...})`, `html`...`` views, fields, events, conditional display | [core.md](./core.md) |
|
|
41
|
+
| Iterating lists — `@each` / `render-each`, `@when` filtering, `@enrich-with`, `@loop-with` pagination | [iteration.md](./iteration.md) |
|
|
42
|
+
| Macros — `macro({...}, html)` definitions, `<x:name>` calls, slots, registration | [macros.md](./macros.md) |
|
|
43
|
+
| Component CSS — `style` / `commonStyle` / `globalStyle` scoping and pitfalls | [styles.md](./styles.md) |
|
|
44
|
+
| Designing components — responsibilities, state ownership, channel choice, do's & don'ts | [component-design.md](./component-design.md) |
|
|
45
|
+
| CLI commands, flags, exit codes, full linter rule list | [cli.md](./cli.md) |
|
|
46
|
+
| Authoring `*.dev.js` story modules, `getExamples()` sections, per-example intent-handler mocking, running `tutuca storybook` | [storybook.md](./storybook.md) |
|
|
47
|
+
| Addressed `send`/`receive` vs routed `intent` (routes, `reply`/`fail`/`forward`/`stop`, the three outcomes), `$unknown`, intent-handler registration | [messages-and-intents.md](./messages-and-intents.md) |
|
|
48
|
+
| Drag & drop, dynamic bindings (`*x`), pseudo-`x`, custom seq types | [advanced.md](./advanced.md) |
|
|
49
|
+
| Setting up MargaUI styling — install (CDN / npm / vendoring), theme CSS, and the `compileClassesToStyleText` wiring | [margaui.md](./margaui.md) |
|
|
50
|
+
| Runtime semantics — path steps, transaction lifecycle, dyn-var teleporting, async key pinning (`livePath`) | [semantics.md](./semantics.md) |
|
|
51
|
+
| Authoring tests — `getTests` shape, calling methods / receive / intent / alter handlers, designing handlers for testability | [testing.md](./testing.md) |
|
|
52
|
+
| Task-oriented recipes — iteration, filtering, conditional content, conditional attributes, dynamic vars, composition, events | [patterns/README.md](./patterns/README.md) |
|
|
53
|
+
|
|
54
|
+
Read `core.md` first. Reach for the others only when the task touches
|
|
55
|
+
them — each is referenced inline from `core.md` so you'll be pointed
|
|
56
|
+
there when relevant.
|