@base-framework/ui 1.0.2030 → 1.0.2032
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/copilot.md +388 -223
- package/dist/atoms.es.js +1 -1
- package/dist/buttons-uRdH6CMH.js +94 -0
- package/dist/{empty-state-BbkagIqj.js → empty-state-C1cQharY.js} +2 -2
- package/dist/index.es.js +6 -6
- package/dist/{mobile-nav-wrapper-Dm9DinRD.js → mobile-nav-wrapper-v-WRf__8.js} +1 -1
- package/dist/molecules.es.js +2 -2
- package/dist/organisms.es.js +3 -3
- package/dist/pages.es.js +1 -1
- package/dist/{range-calendar-6CLMTieN.js → range-calendar-BfGmjXMP.js} +1 -1
- package/dist/{sidebar-menu-page-D4WMgz5U.js → sidebar-menu-page-ClbFsXDG.js} +1 -1
- package/dist/{signature-panel-JSfsTsVc.js → signature-panel-9qDKGR9E.js} +2 -2
- package/package.json +1 -1
- package/dist/buttons-CHEs54Wl.js +0 -61
package/copilot.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This repo is a UI component library for the Base Framework, organized with Atomic Design (atoms → molecules → organisms → pages/templates) and styled with Tailwind CSS v4. It builds to multiple entry points via Vite.
|
|
4
4
|
|
|
5
|
+
**📚 Full documentation available in `ui.wiki/` folder - refer to it for comprehensive guides.**
|
|
6
|
+
|
|
7
|
+
## CRITICAL: Before You Start
|
|
8
|
+
This is NOT React, Vue, or standard JSX. This uses Base Framework's declarative atoms/components with specific syntax patterns. **Read the documentation in base.wiki/ and the icon/children sections below carefully to avoid common mistakes.**
|
|
9
|
+
|
|
10
|
+
### Key Differences from React/Vue
|
|
11
|
+
1. **Children as second argument** - NEVER in props
|
|
12
|
+
2. **Icons passed as children** - Not as icon prop in Icon component
|
|
13
|
+
3. **Lists use map/for props** - Not regular .map()
|
|
14
|
+
4. **Data binding with bind** - Not value + onChange
|
|
15
|
+
5. **Reactive Data object** - Not useState
|
|
16
|
+
|
|
5
17
|
## How things fit together
|
|
6
18
|
- Runtime primitives come from external packages:
|
|
7
19
|
- `@base-framework/base` supplies Component, Atom, Data, Jot, Events, router, NavLink, etc.
|
|
@@ -34,15 +46,210 @@ This repo is a UI component library for the Base Framework, organized with Atomi
|
|
|
34
46
|
- Subscriptions: `On('key', callback)` or `OnState/Open` utilities to react to state.
|
|
35
47
|
- Parent context: `UseParent(({ state, ... }) => ...)` to access parent component refs.
|
|
36
48
|
|
|
37
|
-
###
|
|
38
|
-
Atoms
|
|
49
|
+
### CRITICAL: Atom argument patterns
|
|
50
|
+
Atoms support flexible argument patterns. Children MUST be passed as second argument when it's an array:
|
|
39
51
|
- **Props only**: `Div({ class: 'text' })`
|
|
40
52
|
- **Text child only**: `Div('test')`
|
|
41
53
|
- **Array children only**: `Div([Div('test')])`
|
|
42
54
|
- **Props and text**: `Div({ class: 'text' }, 'test')`
|
|
43
|
-
- **Props and array children**: `Div({ class: 'text' }, [Div('test')])`
|
|
55
|
+
- **Props and array children**: `Div({ class: 'text' }, [Div('test'), Div('test2')])`
|
|
56
|
+
|
|
57
|
+
❌ WRONG: `Div({ class: 'text', children: [...] })` - Never pass children in props
|
|
58
|
+
✅ CORRECT: `Div({ class: 'text' }, [...])`
|
|
59
|
+
|
|
60
|
+
## Component Types and When to Use
|
|
61
|
+
|
|
62
|
+
### Use Atom for:
|
|
63
|
+
- Stateless UI elements (buttons, badges, icons, labels)
|
|
64
|
+
- Simple compositions of other atoms
|
|
65
|
+
- Variants of existing atoms
|
|
66
|
+
- Visual-only components without internal state
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
export const Badge = Atom((props, children) => (
|
|
70
|
+
Span({
|
|
71
|
+
...props,
|
|
72
|
+
class: `inline-flex rounded-full px-2.5 py-0.5 ${props.class || ''}`
|
|
73
|
+
}, children)
|
|
74
|
+
));
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Use Component for:
|
|
78
|
+
- Components with internal state (Data or setupStates)
|
|
79
|
+
- Components that need lifecycle methods
|
|
80
|
+
- Complex interactions requiring methods
|
|
81
|
+
- Organisms like DataTable, Calendar, TabGroup
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
export class Counter extends Component {
|
|
85
|
+
setData() {
|
|
86
|
+
return new Data({ count: 0 });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
increment() {
|
|
90
|
+
this.data.count++;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
render() {
|
|
94
|
+
return Div([
|
|
95
|
+
Button({ click: () => this.increment() }, '+'),
|
|
96
|
+
Span([On('count', (count) => count)])
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Use Jot for:
|
|
103
|
+
- Components with external two-way binding
|
|
104
|
+
- Reusable inputs/controls with value/change pattern
|
|
105
|
+
- Searchable dropdowns, toggles, custom inputs
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
const Toggle = Jot((checked, setChecked) => (
|
|
109
|
+
Button({
|
|
110
|
+
click: () => setChecked(!checked),
|
|
111
|
+
class: checked ? 'bg-primary' : 'bg-muted'
|
|
112
|
+
}, checked ? 'ON' : 'OFF')
|
|
113
|
+
));
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Data Management Patterns
|
|
117
|
+
|
|
118
|
+
### Reactive Data (setData)
|
|
119
|
+
Use for dynamic values that need reactivity:
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
setData() {
|
|
123
|
+
return new Data({
|
|
124
|
+
// Simple values
|
|
125
|
+
name: '',
|
|
126
|
+
count: 0,
|
|
127
|
+
|
|
128
|
+
// Arrays (use for dynamic lists)
|
|
129
|
+
items: [],
|
|
130
|
+
selectedIds: [],
|
|
131
|
+
|
|
132
|
+
// Objects
|
|
133
|
+
user: { name: '', email: '' }
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Updating data triggers re-render
|
|
138
|
+
this.data.count = 5;
|
|
139
|
+
this.data.items.push(newItem);
|
|
140
|
+
this.data.user.name = 'John';
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Component States (setupStates)
|
|
144
|
+
Use for discrete state values (modes, flags):
|
|
145
|
+
|
|
146
|
+
```javascript
|
|
147
|
+
setupStates() {
|
|
148
|
+
return {
|
|
149
|
+
isOpen: false, // Boolean flags
|
|
150
|
+
view: 'list', // String modes: 'list' | 'grid' | 'table'
|
|
151
|
+
tab: 'overview' // Tab selection
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Toggle state
|
|
156
|
+
this.state.isOpen = !this.state.isOpen;
|
|
157
|
+
```
|
|
44
158
|
|
|
45
|
-
|
|
159
|
+
### Two-Way Binding
|
|
160
|
+
```javascript
|
|
161
|
+
// Simple binding to data
|
|
162
|
+
Input({ bind: 'username' })
|
|
163
|
+
Input({ bind: 'user.email' })
|
|
164
|
+
|
|
165
|
+
// Binding to external state
|
|
166
|
+
const state = new Data({ value: '' });
|
|
167
|
+
Input({ bind: [state, 'value'] })
|
|
168
|
+
|
|
169
|
+
// Binding with select
|
|
170
|
+
Select({ bind: 'country', options: countries })
|
|
171
|
+
|
|
172
|
+
// Binding with checkbox
|
|
173
|
+
Input({ bind: 'accepted', type: 'checkbox' })
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Dynamic Lists
|
|
177
|
+
```javascript
|
|
178
|
+
// map prop - for static/external arrays
|
|
179
|
+
Ul({
|
|
180
|
+
map: [items, (item) => Li(item.name)]
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
// for prop - for component data (reactive)
|
|
184
|
+
Div({
|
|
185
|
+
for: ['items', (item, index) => (
|
|
186
|
+
ItemCard({ item, index })
|
|
187
|
+
)]
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
// NEVER use regular JavaScript .map() for reactive lists
|
|
191
|
+
// ❌ WRONG: Ul([items.map(item => Li(item))])
|
|
192
|
+
// ✅ CORRECT: Ul({ map: [items, (item) => Li(item)] })
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Watchers and Subscriptions
|
|
196
|
+
|
|
197
|
+
### On - Watch Data Changes
|
|
198
|
+
```javascript
|
|
199
|
+
render() {
|
|
200
|
+
return Div([
|
|
201
|
+
// Watch single property
|
|
202
|
+
On('count', (value) => {
|
|
203
|
+
console.log('Count changed:', value);
|
|
204
|
+
}),
|
|
205
|
+
|
|
206
|
+
// Watch nested property
|
|
207
|
+
On('user.name', (name) => {
|
|
208
|
+
this.updateProfile(name);
|
|
209
|
+
}),
|
|
210
|
+
|
|
211
|
+
// Display watched value
|
|
212
|
+
Span({ onState: ['count', (count) => `Count: ${count}`] })
|
|
213
|
+
]);
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### OnState - Watch State Changes
|
|
218
|
+
```javascript
|
|
219
|
+
render() {
|
|
220
|
+
return Div([
|
|
221
|
+
OnState('isOpen', (isOpen) => {
|
|
222
|
+
if (isOpen) {
|
|
223
|
+
this.loadContent();
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
]);
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### OnStateOpen - Run Once When State Becomes True
|
|
231
|
+
```javascript
|
|
232
|
+
render() {
|
|
233
|
+
return Div([
|
|
234
|
+
OnStateOpen('isVisible', () => {
|
|
235
|
+
this.startAnimation();
|
|
236
|
+
})
|
|
237
|
+
]);
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### UseParent - Access Parent Component
|
|
242
|
+
```javascript
|
|
243
|
+
const ChildAtom = Atom((props) => (
|
|
244
|
+
Div([
|
|
245
|
+
UseParent(({ data, state, panel }) => {
|
|
246
|
+
// Access parent's data/state
|
|
247
|
+
panel.selectItem(props.id);
|
|
248
|
+
return null;
|
|
249
|
+
})
|
|
250
|
+
])
|
|
251
|
+
));
|
|
252
|
+
```
|
|
46
253
|
|
|
47
254
|
## File layout to know
|
|
48
255
|
- `src/components/atoms/**`: Base-level atoms and atom variants (e.g., buttons, icons, badges, tooltips, skeleton, veil).
|
|
@@ -52,156 +259,115 @@ CRITICAL: When children is an array, pass it as the SECOND argument after props,
|
|
|
52
259
|
- `src/utils/**`: Utilities (formatting, image-scaler with pointer/zoom/drag helpers).
|
|
53
260
|
- `src/ui.js`: Re-exports public surface used by `vite` lib entries.
|
|
54
261
|
|
|
55
|
-
##
|
|
262
|
+
## Tailwind and theming
|
|
263
|
+
- Tailwind scans `./src/ui.js` and `./src/**/*.{js,ts,jsx,tsx}`. If you add files, keep them under `src` and referenced by exports for purge to include classes.
|
|
264
|
+
- Use semantic tokens configured in `tailwind.config.js`: `primary`, `secondary`, `destructive`, `warning`, `muted`, `accent`, `popover`, `card`, `border`, `foreground`, with `DEFAULT` and `foreground` pairs.
|
|
265
|
+
- Dark mode is `media`. Prefer classes already used (`data-[state=active]:...`, rounded tokens via `--radius`).
|
|
56
266
|
|
|
57
|
-
|
|
267
|
+
## Working with Icons (READ THIS - Most Common Mistake Area)
|
|
58
268
|
|
|
59
|
-
### Icon
|
|
60
|
-
|
|
61
|
-
- Each icon is a raw SVG string with Heroicon styling
|
|
269
|
+
### Icon Basics
|
|
270
|
+
Icons come from [src/components/icons/icons.js](../src/components/icons/icons.js) (Heroicons library). They're SVG strings organized hierarchically. See [base.wiki/02-Icons.md](../base.wiki/02-Icons.md) for complete guide.
|
|
62
271
|
|
|
63
|
-
###
|
|
272
|
+
### Three Ways to Use Icons
|
|
64
273
|
|
|
65
|
-
|
|
274
|
+
**Method 1: Icon atom (RECOMMENDED)**
|
|
66
275
|
```javascript
|
|
67
276
|
import { Icon } from '@base-framework/ui/atoms';
|
|
68
277
|
import { Icons } from '@base-framework/ui/icons';
|
|
69
278
|
|
|
70
|
-
|
|
71
|
-
Icon({ size: '
|
|
72
|
-
Icon({ size: 'md' }, Icons.chat.default)
|
|
73
|
-
Icon({ size: 'lg' }, Icons.arrows.left)
|
|
74
|
-
|
|
75
|
-
// Sizes: xs, sm, md, lg, xl, 2xl, 3xl (default: sm)
|
|
279
|
+
Icon({ size: 'sm' }, Icons.home) // SVG string as CHILD, not in props
|
|
280
|
+
Icon({ size: 'md', class: 'text-blue-500' }, Icons.chat.default)
|
|
76
281
|
```
|
|
77
282
|
|
|
78
|
-
|
|
283
|
+
**Method 2: Raw I element**
|
|
79
284
|
```javascript
|
|
80
285
|
import { I } from '@base-framework/atoms';
|
|
81
286
|
import { Icons } from '@base-framework/ui/icons';
|
|
82
287
|
|
|
83
|
-
// Use html prop
|
|
84
|
-
I({ html: Icons.home, class: 'w-6 h-6' })
|
|
85
|
-
I({ html: Icons.chat.dots })
|
|
288
|
+
I({ html: Icons.home, class: 'w-6 h-6' }) // Use html prop
|
|
86
289
|
```
|
|
87
290
|
|
|
88
|
-
|
|
291
|
+
**Method 3: In Button**
|
|
89
292
|
```javascript
|
|
90
293
|
import { Button } from '@base-framework/ui/atoms';
|
|
91
294
|
import { Icons } from '@base-framework/ui/icons';
|
|
92
295
|
|
|
93
|
-
|
|
94
|
-
Button({ variant: 'withIcon', icon: Icons.plus }, 'Add Item')
|
|
95
|
-
|
|
96
|
-
// Icon on right
|
|
296
|
+
Button({ variant: 'withIcon', icon: Icons.plus }, 'Add')
|
|
97
297
|
Button({ variant: 'withIcon', icon: Icons.arrows.right, position: 'right' }, 'Next')
|
|
98
298
|
```
|
|
99
299
|
|
|
100
|
-
### Common Icon
|
|
300
|
+
### Common Icon Paths
|
|
101
301
|
```javascript
|
|
102
|
-
// Simple
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// Nested icons (use dot notation)
|
|
106
|
-
Icons.chat.default, Icons.chat.text, Icons.chat.dots
|
|
107
|
-
Icons.arrows.left, Icons.arrows.right, Icons.arrows.upDown
|
|
108
|
-
Icons.adjustments.vertical, Icons.adjustments.horizontal
|
|
109
|
-
|
|
110
|
-
// Icons with states
|
|
111
|
-
Icons.locked, Icons.unlocked
|
|
112
|
-
Icons.play, Icons.stop, Icons.playing
|
|
302
|
+
// Simple: Icons.home, Icons.star, Icons.help, Icons.plus
|
|
303
|
+
// Nested: Icons.chat.default, Icons.arrows.left, Icons.adjustments.vertical
|
|
113
304
|
```
|
|
114
305
|
|
|
115
|
-
### CRITICAL
|
|
116
|
-
❌
|
|
117
|
-
❌
|
|
118
|
-
❌
|
|
119
|
-
❌
|
|
120
|
-
❌ **WRONG**: `Icons.chat` - Incomplete path for nested icons
|
|
306
|
+
### CRITICAL Icon Mistakes
|
|
307
|
+
❌ `Icon(Icons.home)` - Missing props object
|
|
308
|
+
❌ `Icon({ icon: Icons.home })` - Wrong prop name, pass as child
|
|
309
|
+
❌ `I(Icons.home)` - Must use html prop
|
|
310
|
+
❌ `Icons['home']` - Use dot notation
|
|
121
311
|
|
|
122
|
-
✅
|
|
123
|
-
✅
|
|
124
|
-
✅
|
|
125
|
-
|
|
126
|
-
## Tailwind and theming
|
|
127
|
-
- Tailwind scans `./src/ui.js` and `./src/**/*.{js,ts,jsx,tsx}`. If you add files, keep them under `src` and referenced by exports for purge to include classes.
|
|
128
|
-
- Use semantic tokens configured in `tailwind.config.js`: `primary`, `secondary`, `destructive`, `warning`, `muted`, `accent`, `popover`, `card`, `border`, `foreground`, with `DEFAULT` and `foreground` pairs.
|
|
129
|
-
- Dark mode is `media`. Prefer classes already used (`data-[state=active]:...`, rounded tokens via `--radius`).
|
|
312
|
+
✅ `Icon({ size: 'sm' }, Icons.home)`
|
|
313
|
+
✅ `I({ html: Icons.home })`
|
|
314
|
+
✅ `Button({ icon: Icons.plus }, 'Text')`
|
|
130
315
|
|
|
131
316
|
## Patterns by example
|
|
132
317
|
|
|
133
|
-
###
|
|
134
|
-
Compose small atoms: `Div` containers + `I` for icons + `H5/P` for text. Type variants use lookup table → apply Tailwind classes from map.
|
|
135
|
-
|
|
318
|
+
### Alert Component (Functional Atom)
|
|
136
319
|
```javascript
|
|
137
320
|
import { Div, H5, I, P } from '@base-framework/atoms';
|
|
138
321
|
import { Atom } from '@base-framework/base';
|
|
139
322
|
|
|
140
323
|
const AlertIcon = (icon, iconColor) => (
|
|
141
|
-
Div({ class: `flex
|
|
142
|
-
I({ html: icon })
|
|
324
|
+
Div({ class: `flex h-6 w-6 mr-3 ${iconColor}` }, [
|
|
325
|
+
I({ html: icon }) // Icon as SVG string
|
|
143
326
|
])
|
|
144
327
|
);
|
|
145
328
|
|
|
146
329
|
export const Alert = Atom(({ title, description, icon, type = 'default' }) => {
|
|
147
|
-
const
|
|
148
|
-
return Div({ class: `flex
|
|
149
|
-
icon && AlertIcon(icon, iconColor),
|
|
330
|
+
const styles = typeStyles[type];
|
|
331
|
+
return Div({ class: `flex p-4 border rounded-lg ${styles.bgColor}` }, [
|
|
332
|
+
icon && AlertIcon(icon, styles.iconColor),
|
|
150
333
|
Div({ class: 'flex flex-col' }, [
|
|
151
334
|
H5({ class: 'font-semibold' }, title),
|
|
152
|
-
P({ class: 'text-sm
|
|
335
|
+
P({ class: 'text-sm' }, description)
|
|
153
336
|
])
|
|
154
337
|
]);
|
|
155
338
|
});
|
|
156
339
|
```
|
|
157
340
|
|
|
158
|
-
###
|
|
159
|
-
Define variant factories, then export a single `Button` Atom that dispatches by `props.variant`. Icon handling via a shared `IconButton` Atom; support `position: 'right'`.
|
|
160
|
-
|
|
341
|
+
### Button with Icon (Variant Pattern)
|
|
161
342
|
```javascript
|
|
162
343
|
import { Button as BaseButton } from '@base-framework/atoms';
|
|
163
344
|
import { Atom } from '@base-framework/base';
|
|
164
345
|
import { Icon } from '../icon.js';
|
|
165
346
|
|
|
166
347
|
const IconButton = Atom((props, children) => (
|
|
167
|
-
BaseButton({
|
|
168
|
-
...props,
|
|
169
|
-
class: props.class
|
|
170
|
-
}, [
|
|
348
|
+
BaseButton({ ...props }, [
|
|
171
349
|
props.icon && props.position !== 'right' ? Icon({ size: 'sm' }, props.icon) : null,
|
|
172
350
|
...(children || []),
|
|
173
351
|
props.icon && props.position === 'right' ? Icon({ size: 'sm' }, props.icon) : null
|
|
174
352
|
])
|
|
175
353
|
));
|
|
176
354
|
|
|
177
|
-
const BUTTON_VARIANTS = {
|
|
178
|
-
primary: DefaultVariant({ class: 'primary' }),
|
|
179
|
-
withIcon: WithIconVariant({ class: 'with-icon' })
|
|
180
|
-
};
|
|
181
|
-
|
|
182
355
|
export const Button = Atom((props, children) => {
|
|
183
356
|
const VariantButton = BUTTON_VARIANTS[props.variant] || BUTTON_VARIANTS.primary;
|
|
184
357
|
return VariantButton(props, children);
|
|
185
358
|
});
|
|
186
359
|
```
|
|
187
360
|
|
|
188
|
-
### Data-
|
|
189
|
-
Use `for: ['collectionKey', (item) => ...]` to render nested collections from component state.
|
|
190
|
-
|
|
361
|
+
### Data-Driven Lists
|
|
191
362
|
```javascript
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Div({
|
|
195
|
-
class: 'max-h-60 border rounded-md',
|
|
196
|
-
for: ['groups', (group) => Group(group, onSelect)]
|
|
197
|
-
})
|
|
198
|
-
])
|
|
199
|
-
);
|
|
200
|
-
```
|
|
363
|
+
// Using map prop
|
|
364
|
+
Ul({ map: [items, (item) => Li(item.name)] })
|
|
201
365
|
|
|
202
|
-
|
|
203
|
-
|
|
366
|
+
// Using for with state
|
|
367
|
+
Div({ for: ['groups', (group) => Group(group)] })
|
|
368
|
+
```
|
|
204
369
|
|
|
370
|
+
### Stateful Component
|
|
205
371
|
```javascript
|
|
206
372
|
import { Component, Data } from '@base-framework/base';
|
|
207
373
|
|
|
@@ -214,77 +380,95 @@ export class DataTable extends Component {
|
|
|
214
380
|
setData() {
|
|
215
381
|
return new Data({
|
|
216
382
|
selectedRows: [],
|
|
217
|
-
hasItems: this.rows
|
|
383
|
+
hasItems: this.rows?.length > 0
|
|
218
384
|
});
|
|
219
385
|
}
|
|
220
386
|
|
|
221
387
|
render() {
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
DataTableBody({ rows: this.rows })
|
|
226
|
-
])
|
|
388
|
+
return Table([
|
|
389
|
+
TableHeader({ headers: this.headers }),
|
|
390
|
+
DataTableBody({ rows: this.rows })
|
|
227
391
|
]);
|
|
228
392
|
}
|
|
229
393
|
}
|
|
230
394
|
```
|
|
231
395
|
|
|
232
|
-
## Import Patterns
|
|
396
|
+
## Import Patterns
|
|
233
397
|
|
|
234
|
-
### External
|
|
398
|
+
### From External Packages
|
|
235
399
|
```javascript
|
|
236
|
-
// DOM elements
|
|
237
|
-
import { Div, Button, Input, I, Ul, Li, H5, P } from '@base-framework/atoms';
|
|
238
|
-
import { On, OnState, UseParent } from '@base-framework/atoms';
|
|
400
|
+
// DOM elements
|
|
401
|
+
import { Div, Button, Input, I, Ul, Li, H5, P, Table } from '@base-framework/atoms';
|
|
239
402
|
|
|
240
|
-
//
|
|
403
|
+
// Reactive utilities
|
|
404
|
+
import { On, OnState, OnStateOpen, UseParent } from '@base-framework/atoms';
|
|
405
|
+
|
|
406
|
+
// Framework core
|
|
241
407
|
import { Atom, Component, Data, Jot } from '@base-framework/base';
|
|
408
|
+
|
|
409
|
+
// Routing
|
|
410
|
+
import { router, NavLink } from '@base-framework/base';
|
|
242
411
|
```
|
|
243
412
|
|
|
244
|
-
###
|
|
413
|
+
### From This Library
|
|
245
414
|
```javascript
|
|
246
|
-
// Icons (
|
|
415
|
+
// Icons (ALWAYS import both)
|
|
247
416
|
import { Icons } from '@base-framework/ui/icons';
|
|
248
417
|
import { Icon } from '@base-framework/ui/atoms';
|
|
249
418
|
|
|
250
|
-
//
|
|
251
|
-
import { Button, Alert } from '@base-framework/ui/atoms';
|
|
252
|
-
|
|
253
|
-
|
|
419
|
+
// Atoms
|
|
420
|
+
import { Button, Badge, Alert } from '@base-framework/ui/atoms';
|
|
421
|
+
|
|
422
|
+
// Molecules
|
|
423
|
+
import { Form, Dropdown, Modal, DatePicker } from '@base-framework/ui/molecules';
|
|
424
|
+
|
|
425
|
+
// Organisms
|
|
426
|
+
import { DataTable, Calendar, TabGroup } from '@base-framework/ui/organisms';
|
|
427
|
+
|
|
428
|
+
// Pages
|
|
429
|
+
import { Page, BasicPage, SidebarMenuPage } from '@base-framework/ui/pages';
|
|
430
|
+
|
|
431
|
+
// Utils
|
|
432
|
+
import { Format, DateTime, ImageScaler } from '@base-framework/ui/utils';
|
|
254
433
|
```
|
|
255
434
|
|
|
256
|
-
### Relative
|
|
435
|
+
### Relative (when authoring in this repo)
|
|
257
436
|
```javascript
|
|
258
|
-
// From within src/components/
|
|
259
437
|
import { Icons } from '../../icons/icons.js';
|
|
260
438
|
import { Icon } from '../icon.js';
|
|
261
|
-
import { Button as BaseButton } from '@base-framework/atoms';
|
|
262
439
|
```
|
|
263
440
|
|
|
264
441
|
## Coding rules (do/don't)
|
|
265
442
|
|
|
266
|
-
### DO:
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
443
|
+
### ✅ DO:
|
|
444
|
+
- Import DOM elements from `@base-framework/atoms`
|
|
445
|
+
- Import Atom, Component, Data from `@base-framework/base`
|
|
446
|
+
- Pass children as SECOND argument: `Div({ class: 'x' }, [children])`
|
|
447
|
+
- Use Icons object: `import { Icons } from '@base-framework/ui/icons'`
|
|
448
|
+
- Use Icon atom: `Icon({ size: 'sm' }, Icons.home)`
|
|
449
|
+
- Use I element for icons: `I({ html: Icons.home })`
|
|
450
|
+
- Spread props: `{ ...defaultProps, ...props }`
|
|
451
|
+
- Use Tailwind semantic tokens (primary, secondary, destructive, warning, muted, accent)
|
|
452
|
+
- Use `map` or `for` for lists: `Ul({ map: [items, fn] })` or `Div({ for: ['items', fn] })`
|
|
453
|
+
- Use `bind` for two-way binding: `Input({ bind: 'username' })`
|
|
454
|
+
- Use `On` for data watchers: `On('count', (val) => ...)`
|
|
455
|
+
- Use `OnState` for state watchers: `OnState('isOpen', (val) => ...)`
|
|
456
|
+
- Use Data for reactive values: `new Data({ count: 0 })`
|
|
457
|
+
- Use setupStates for discrete states: `setupStates() { return { isOpen: false } }`
|
|
458
|
+
- Read documentation in `base.wiki/` for detailed patterns
|
|
459
|
+
|
|
460
|
+
### ❌ DON'T:
|
|
461
|
+
- Pass children in props: `Div({ children: [...] })`
|
|
462
|
+
- Use icon prop on Icon: `Icon({ icon: Icons.home })`
|
|
463
|
+
- Pass icon without props: `Icon(Icons.home)`
|
|
464
|
+
- Use React/Vue/JSX patterns
|
|
465
|
+
- Mutate DOM directly
|
|
466
|
+
- Use raw hex colors (use Tailwind tokens)
|
|
467
|
+
- Import Icons from wrong path
|
|
468
|
+
- Use regular JS map for reactive lists: `[items.map(...)]`
|
|
469
|
+
- Use value + onChange: use `bind` instead
|
|
470
|
+
- Use plain objects for reactive data: use `Data` instead
|
|
471
|
+
- Use useState hooks: use `Data` and `setupStates` instead
|
|
288
472
|
|
|
289
473
|
## Adding a new component (checklist)
|
|
290
474
|
1) Decide Atom vs Component (stateless vs stateful/interactive)
|
|
@@ -293,131 +477,112 @@ import { Button as BaseButton } from '@base-framework/atoms';
|
|
|
293
477
|
4) If it needs data/state, use `Data`/`Jot`, `On`, `bind`, `for` as seen in existing components
|
|
294
478
|
5) Run dev server and verify render; run build to ensure types emit
|
|
295
479
|
|
|
296
|
-
## Common Mistakes &
|
|
297
|
-
|
|
298
|
-
### Issue: Icons not rendering
|
|
299
|
-
**Symptoms**: Icons appear as blank or broken
|
|
300
|
-
**Causes**:
|
|
301
|
-
1. Wrong import path for Icons
|
|
302
|
-
2. Incorrect Icon usage syntax
|
|
303
|
-
3. Missing `html` prop on I element
|
|
480
|
+
## Common Mistakes & Quick Fixes
|
|
304
481
|
|
|
305
|
-
|
|
482
|
+
### Icons Not Rendering
|
|
306
483
|
```javascript
|
|
307
|
-
//
|
|
308
|
-
|
|
484
|
+
// ❌ Wrong
|
|
485
|
+
Icon(Icons.home) // Missing props object
|
|
486
|
+
Icon({ icon: Icons.home }) // Wrong prop name, pass as child
|
|
487
|
+
I(Icons.home) // Must use html prop
|
|
488
|
+
Button({ icon: Icons.home }) // Missing variant: 'withIcon'
|
|
489
|
+
|
|
490
|
+
// ✅ Correct
|
|
309
491
|
Icon({ size: 'sm' }, Icons.home)
|
|
310
492
|
I({ html: Icons.home })
|
|
311
|
-
|
|
312
|
-
// ❌ Wrong ways
|
|
313
|
-
Icon(Icons.home) // Missing props object
|
|
314
|
-
Icon({ icon: Icons.home }) // Wrong prop name
|
|
315
|
-
I(Icons.home) // Missing html prop
|
|
493
|
+
Button({ variant: 'withIcon', icon: Icons.plus }, 'Text')
|
|
316
494
|
```
|
|
317
495
|
|
|
318
|
-
###
|
|
319
|
-
**Symptoms**: Child components/text not appearing
|
|
320
|
-
**Cause**: Passing children in props object instead of as second argument
|
|
321
|
-
|
|
322
|
-
**Solution**:
|
|
496
|
+
### Children Not Appearing
|
|
323
497
|
```javascript
|
|
498
|
+
// ❌ Wrong
|
|
499
|
+
Div({ class: 'wrapper', children: [Div('test')] }) // children in props
|
|
500
|
+
Div({ class: 'wrapper' }, Div('test')) // Single child must be array or string
|
|
501
|
+
|
|
324
502
|
// ✅ Correct
|
|
325
|
-
Div({ class: 'wrapper' }, [
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
])
|
|
503
|
+
Div({ class: 'wrapper' }, [Div('test')]) // Array of children
|
|
504
|
+
Div({ class: 'wrapper' }, 'text only') // Single text child
|
|
505
|
+
```
|
|
329
506
|
|
|
507
|
+
### Lists Not Rendering
|
|
508
|
+
```javascript
|
|
330
509
|
// ❌ Wrong
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
children: [Div('child')]
|
|
334
|
-
})
|
|
335
|
-
```
|
|
510
|
+
Ul([items.map(item => Li(item.name))]) // Regular JS map doesn't track reactivity
|
|
511
|
+
Div(items.map(item => ItemCard(item))) // Missing props object, not reactive
|
|
336
512
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
513
|
+
// ✅ Correct
|
|
514
|
+
Ul({ map: [items, (item) => Li(item.name)] }) // Static/external arrays
|
|
515
|
+
Div({ for: ['items', (item) => ItemComponent(item)] }) // Component data (reactive)
|
|
516
|
+
```
|
|
340
517
|
|
|
341
|
-
|
|
518
|
+
### Not Reactive
|
|
342
519
|
```javascript
|
|
343
|
-
//
|
|
520
|
+
// ❌ Wrong (plain object)
|
|
521
|
+
this.state = { count: 0 };
|
|
522
|
+
this.state.count++; // Doesn't trigger re-render
|
|
523
|
+
|
|
524
|
+
// ✅ Correct (use Data)
|
|
344
525
|
setData() {
|
|
345
526
|
return new Data({ count: 0 });
|
|
346
527
|
}
|
|
347
|
-
|
|
348
|
-
//
|
|
349
|
-
Input({ bind: 'username' })
|
|
350
|
-
Input({ bind: [externalState, 'email'] })
|
|
528
|
+
// In method:
|
|
529
|
+
this.data.count++; // Triggers re-render
|
|
351
530
|
```
|
|
352
531
|
|
|
353
|
-
###
|
|
354
|
-
**Symptoms**: Array of items not displaying
|
|
355
|
-
**Cause**: Using regular map instead of Base's reactive patterns
|
|
356
|
-
|
|
357
|
-
**Solution**:
|
|
532
|
+
### Binding Issues
|
|
358
533
|
```javascript
|
|
359
|
-
//
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
// ✅ Use for with state key
|
|
363
|
-
Div({ for: ['items', (item) => ItemComponent(item)] })
|
|
534
|
+
// ❌ Wrong
|
|
535
|
+
Input({ value: name, change: (e) => setName(e.target.value) }) // React pattern
|
|
536
|
+
Input({ value: this.data.username }) // One-way only, not reactive
|
|
364
537
|
|
|
365
|
-
//
|
|
366
|
-
|
|
538
|
+
// ✅ Correct
|
|
539
|
+
Input({ bind: 'username' }) // Two-way binding to component data
|
|
540
|
+
Input({ bind: [state, 'email'] }) // Two-way binding to external state
|
|
367
541
|
```
|
|
368
542
|
|
|
369
|
-
|
|
370
|
-
- Dev: `npm run dev`
|
|
371
|
-
- Build: `npm run build`
|
|
372
|
-
- Preview: `npm run preview`
|
|
373
|
-
|
|
374
|
-
## Quick Reference Card
|
|
375
|
-
|
|
376
|
-
### Component Creation
|
|
543
|
+
### Event Handling
|
|
377
544
|
```javascript
|
|
378
|
-
//
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
));
|
|
382
|
-
|
|
383
|
-
// Component (stateful)
|
|
384
|
-
export class MyComponent extends Component {
|
|
385
|
-
declareProps() {
|
|
386
|
-
this.items = [];
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
setData() {
|
|
390
|
-
return new Data({ selected: null });
|
|
391
|
-
}
|
|
545
|
+
// ❌ Wrong
|
|
546
|
+
Button({ onClick: () => this.submit() }) // React pattern
|
|
547
|
+
Button({ onclick: () => this.submit() }) // Wrong casing
|
|
392
548
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
}
|
|
549
|
+
// ✅ Correct
|
|
550
|
+
Button({ click: () => this.submit() }) // Use 'click' not 'onClick'
|
|
397
551
|
```
|
|
398
552
|
|
|
399
|
-
###
|
|
553
|
+
### State Management
|
|
400
554
|
```javascript
|
|
401
|
-
//
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
// Standalone
|
|
405
|
-
Icon({ size: 'md', class: 'text-primary' }, Icons.home)
|
|
555
|
+
// ❌ Wrong
|
|
556
|
+
const [isOpen, setIsOpen] = useState(false); // React hooks
|
|
557
|
+
this.isOpen = false; // Plain property
|
|
406
558
|
|
|
407
|
-
//
|
|
408
|
-
|
|
559
|
+
// ✅ Correct
|
|
560
|
+
setupStates() {
|
|
561
|
+
return { isOpen: false };
|
|
562
|
+
}
|
|
563
|
+
// Toggle:
|
|
564
|
+
this.state.isOpen = !this.state.isOpen;
|
|
409
565
|
```
|
|
410
566
|
|
|
411
|
-
###
|
|
567
|
+
### Watchers
|
|
412
568
|
```javascript
|
|
413
|
-
//
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
// Submit (in Form)
|
|
417
|
-
Form({ submit: (e, parent) => handleSubmit(e) }, [...])
|
|
569
|
+
// ❌ Wrong
|
|
570
|
+
useEffect(() => { ... }, [count]); // React pattern
|
|
571
|
+
this.data.count.subscribe(val => ...); // No such method
|
|
418
572
|
|
|
419
|
-
//
|
|
420
|
-
|
|
573
|
+
// ✅ Correct
|
|
574
|
+
render() {
|
|
575
|
+
return Div([
|
|
576
|
+
On('count', (value) => {
|
|
577
|
+
console.log('Count changed:', value);
|
|
578
|
+
})
|
|
579
|
+
]);
|
|
580
|
+
}
|
|
421
581
|
```
|
|
422
582
|
|
|
583
|
+
## Commands reference
|
|
584
|
+
- Dev: `npm run dev`
|
|
585
|
+
- Build: `npm run build`
|
|
586
|
+
- Preview: `npm run preview`
|
|
587
|
+
|
|
423
588
|
If anything seems unclear (e.g., preferred binding patterns or where to export), ask for confirmation before large changes.
|
package/dist/atoms.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { B as e, C as t, F as o, L as r, P as n, R as p, S as I, a as u, T as i } from "./tooltip-Czvqmxt3.js";
|
|
2
|
-
import { B as d, I as m, L as x } from "./buttons-
|
|
2
|
+
import { B as d, I as m, L as x } from "./buttons-uRdH6CMH.js";
|
|
3
3
|
import { C as T, F as g } from "./form-group-BB7dLJir.js";
|
|
4
4
|
import { C as F, d as c, D as f, c as L, E as P, F as R, H as S, I as b, M as h, N as k, P as D, R as V, T as E, a as G, b as H, U as M, W as N } from "./inputs-9udyzkHR.js";
|
|
5
5
|
import { I as W, V as w, a as J } from "./image-BB__4s0g.js";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { I as u, Button as r } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as a, Component as g } from "@base-framework/base";
|
|
3
|
+
import { Icons as e } from "./icons.es.js";
|
|
4
|
+
const m = {
|
|
5
|
+
xs: "w-4 h-4",
|
|
6
|
+
sm: "w-6 h-6",
|
|
7
|
+
md: "w-8 h-8",
|
|
8
|
+
lg: "w-10 h-10",
|
|
9
|
+
xl: "w-12 h-12",
|
|
10
|
+
"2xl": "w-14 h-14",
|
|
11
|
+
"3xl": "w-16 h-16"
|
|
12
|
+
}, c = a((t, s) => {
|
|
13
|
+
const n = m[t.size || "sm"];
|
|
14
|
+
return u({
|
|
15
|
+
...t,
|
|
16
|
+
class: `stroke-current icon-size ${n} ${t.class || ""}`,
|
|
17
|
+
html: s[0]?.textContent
|
|
18
|
+
});
|
|
19
|
+
}), i = (t) => a((s, n) => r({
|
|
20
|
+
...t,
|
|
21
|
+
...s,
|
|
22
|
+
class: `bttn ${t.class} ${s.class || ""}`
|
|
23
|
+
}, n)), h = a(
|
|
24
|
+
(t, s) => r({
|
|
25
|
+
...t,
|
|
26
|
+
class: t.class
|
|
27
|
+
}, [
|
|
28
|
+
t.icon && t.position !== "right" ? c({ size: "sm", class: t.animation ?? null }, t.icon) : null,
|
|
29
|
+
...s || [],
|
|
30
|
+
t.icon && t.position === "right" ? c({ size: "sm", class: t.animation ?? null }, t.icon) : null
|
|
31
|
+
])
|
|
32
|
+
), o = (t) => a((s, n) => h({
|
|
33
|
+
...t,
|
|
34
|
+
...s,
|
|
35
|
+
class: `bttn ${t.class} ${s.class || ""}`
|
|
36
|
+
}, n));
|
|
37
|
+
class b extends g {
|
|
38
|
+
/**
|
|
39
|
+
* This will set the start history length.
|
|
40
|
+
*
|
|
41
|
+
* @param {object} props
|
|
42
|
+
* @param {array} children
|
|
43
|
+
*/
|
|
44
|
+
constructor(s, n) {
|
|
45
|
+
super(s, n), this.startHistoryLength = globalThis.history.length;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* This will handle the click event.
|
|
49
|
+
*
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
goBack() {
|
|
53
|
+
if (this.props.allowHistory === !0 && globalThis.history.length > 1) {
|
|
54
|
+
const s = globalThis.history.length, n = this.startHistoryLength - s - 1;
|
|
55
|
+
if (n < -1) {
|
|
56
|
+
globalThis.history.go(n);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
globalThis.history.back();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (this.props.backUrl) {
|
|
63
|
+
app.navigate(this.props.backUrl);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
globalThis.history.back();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This will render the component.
|
|
70
|
+
*
|
|
71
|
+
* @returns {object}
|
|
72
|
+
*/
|
|
73
|
+
render() {
|
|
74
|
+
const s = { ...this };
|
|
75
|
+
return s.icon = s.icon || e.chevron.single.left, s.click = s.click || (() => this.goBack()), h(s, this.children);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const k = (t) => ((s, n) => new b({ ...t, ...s }, n)), l = {
|
|
79
|
+
primary: i({ class: "primary" }),
|
|
80
|
+
secondary: i({ class: "secondary" }),
|
|
81
|
+
destructive: i({ class: "destructive" }),
|
|
82
|
+
warning: i({ class: "warning" }),
|
|
83
|
+
outline: i({ class: "outline" }),
|
|
84
|
+
ghost: i({ class: "ghost" }),
|
|
85
|
+
link: i({ class: "link" }),
|
|
86
|
+
icon: o({ class: "icon" }),
|
|
87
|
+
withIcon: o({ class: "with-icon" }),
|
|
88
|
+
back: k({ class: "with-icon back-button" })
|
|
89
|
+
}, w = a((t, s) => (l[t.variant] || l.primary)(t, s)), I = a((t, s) => w({ ...t, variant: "withIcon", icon: e.loading, animation: "animate-spin" }, s));
|
|
90
|
+
export {
|
|
91
|
+
w as B,
|
|
92
|
+
c as I,
|
|
93
|
+
I as L
|
|
94
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Div as n, H5 as Z, P as b, I as x, Li as H, Span as a, Ul as q, Button as f, OnState as T, Label as P, H2 as S, Form as tt, Header as I, Footer as L, A as V, H3 as et, Checkbox as st, Input as m, Img as G, Nav as ot, UseParent as W, OnStateOpen as O, Time as nt, Dialog as rt } from "@base-framework/atoms";
|
|
2
2
|
import { Atom as c, Component as w, Html as A, Dom as it, base as lt, Data as B, Builder as _, Jot as C, Events as p, DateTime as M } from "@base-framework/base";
|
|
3
|
-
import { P as D, b as at, R as ct } from "./range-calendar-
|
|
3
|
+
import { P as D, b as at, R as ct } from "./range-calendar-BfGmjXMP.js";
|
|
4
4
|
import { C as dt, F as ut } from "./form-group-BB7dLJir.js";
|
|
5
|
-
import { B as h, I as g } from "./buttons-
|
|
5
|
+
import { B as h, I as g } from "./buttons-uRdH6CMH.js";
|
|
6
6
|
import { Icons as u } from "./icons.es.js";
|
|
7
7
|
import { Timer as ht, List as mt, DynamicTime as ft } from "@base-framework/organisms";
|
|
8
8
|
import { a as v } from "./image-BB__4s0g.js";
|
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { B as s, C as o, F as t, L as r, P as n, R as l, S as i, a as p, T as m } from "./tooltip-Czvqmxt3.js";
|
|
2
|
-
import { B as u, I as g, L as C } from "./buttons-
|
|
2
|
+
import { B as u, I as g, L as C } from "./buttons-uRdH6CMH.js";
|
|
3
3
|
import { C as T, F as b } from "./form-group-BB7dLJir.js";
|
|
4
4
|
import { C as D, d as S, D as F, c as B, E as P, F as k, H as M, I as x, M as f, N as v, P as N, R as y, T as h, a as U, b as L, U as W, W as w } from "./inputs-9udyzkHR.js";
|
|
5
5
|
import { I as R, V as A, a as G } from "./image-BB__4s0g.js";
|
|
6
6
|
import { Icons as E } from "./icons.es.js";
|
|
7
|
-
import { A as j, B as q, C as J, x as z, O as K, z as Q, E as _, G as X, H as Y, D as Z, m as $, n as aa, R as ea, Q as sa, w as oa, o as ta, c as ra, a as na, b as la, U as ia, l as pa, g as ma, i as da, h as ua, j as ga, e as Ca, k as ca, F as Ta, d as ba, f as Ia, I as Da, L as Sa, y as Fa, M as Ba, p as Pa, N as ka, P as Ma, t as xa, u as fa, S as va, r as Na, s as ya, T as ha, J as Ua, K as La, q as Wa, v as wa } from "./empty-state-
|
|
8
|
-
import { A as Ra, b as Aa, C as Ga, D as Oa, a as Ea, F as Va, M as ja, P as qa, R as Ja, c as za, g as Ka, p as Qa } from "./range-calendar-
|
|
9
|
-
import { B as Xa, p as Ya, C as Za, j as $a, D as ae, m as ee, k as se, H as oe, I as te, N as re, O as ne, P as le, S as ie, n as pe, o as me, x as de, s as ue, q as ge, r as Ce, T as ce, t as Te, w as be, u as Ie, v as De, l as Se, U as Fe, W as Be, f as Pe, h as ke, i as Me, c as xe, d as fe, b as ve, e as Ne, a as ye, g as he } from "./signature-panel-
|
|
10
|
-
import { B as Le, I as We, M as we, d as He, e as Re, g as Ae, N as Ge, b as Oe, a as Ee, f as Ve, P as je, c as qe, S as Je, T as ze } from "./mobile-nav-wrapper-
|
|
11
|
-
import { B as Qe, a as _e, C as Xe, F as Ye, b as Ze, c as $e, M as as, P as es, S as ss } from "./sidebar-menu-page-
|
|
7
|
+
import { A as j, B as q, C as J, x as z, O as K, z as Q, E as _, G as X, H as Y, D as Z, m as $, n as aa, R as ea, Q as sa, w as oa, o as ta, c as ra, a as na, b as la, U as ia, l as pa, g as ma, i as da, h as ua, j as ga, e as Ca, k as ca, F as Ta, d as ba, f as Ia, I as Da, L as Sa, y as Fa, M as Ba, p as Pa, N as ka, P as Ma, t as xa, u as fa, S as va, r as Na, s as ya, T as ha, J as Ua, K as La, q as Wa, v as wa } from "./empty-state-C1cQharY.js";
|
|
8
|
+
import { A as Ra, b as Aa, C as Ga, D as Oa, a as Ea, F as Va, M as ja, P as qa, R as Ja, c as za, g as Ka, p as Qa } from "./range-calendar-BfGmjXMP.js";
|
|
9
|
+
import { B as Xa, p as Ya, C as Za, j as $a, D as ae, m as ee, k as se, H as oe, I as te, N as re, O as ne, P as le, S as ie, n as pe, o as me, x as de, s as ue, q as ge, r as Ce, T as ce, t as Te, w as be, u as Ie, v as De, l as Se, U as Fe, W as Be, f as Pe, h as ke, i as Me, c as xe, d as fe, b as ve, e as Ne, a as ye, g as he } from "./signature-panel-9qDKGR9E.js";
|
|
10
|
+
import { B as Le, I as We, M as we, d as He, e as Re, g as Ae, N as Ge, b as Oe, a as Ee, f as Ve, P as je, c as qe, S as Je, T as ze } from "./mobile-nav-wrapper-v-WRf__8.js";
|
|
11
|
+
import { B as Qe, a as _e, C as Xe, F as Ye, b as Ze, c as $e, M as as, P as es, S as ss } from "./sidebar-menu-page-ClbFsXDG.js";
|
|
12
12
|
import { A as ts, F as rs, M as ns, a as ls, T as is } from "./aside-template-sUm-F2f0.js";
|
|
13
13
|
import { B as ms } from "./bside-template-do_hXebn.js";
|
|
14
14
|
import { F as us, c as gs } from "./format-BmrNQptv.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button as S, I as B, Label as N, Span as L, Ul as o, H4 as C, Nav as p, Div as l, Header as y, H1 as P, H3 as h, OnState as I, UseParent as $ } from "@base-framework/atoms";
|
|
2
2
|
import { Component as n, Atom as i, NavLink as H, router as d } from "@base-framework/base";
|
|
3
|
-
import { I as f, B as x } from "./buttons-
|
|
3
|
+
import { I as f, B as x } from "./buttons-uRdH6CMH.js";
|
|
4
4
|
import { Icons as r } from "./icons.es.js";
|
|
5
5
|
class M extends n {
|
|
6
6
|
/**
|
package/dist/molecules.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as s, B as t, C as r, x as e, O as i, z as n, E as m, G as l, H as d, D as C, m as p, n as D, R as S, Q as g, w as u, o as c, c as F, a as T, b as P, U as w, l as A, g as I, i as f, h as b, j as y, e as B, k as M, F as U, d as k, f as x, I as L, L as R, y as v, M as E, p as N, N as h, P as G, t as O, u as j, S as q, r as z, s as H, T as J, J as K, K as Q, q as _, v as V } from "./empty-state-
|
|
2
|
-
import { A as X, P as Y, g as Z } from "./range-calendar-
|
|
1
|
+
import { A as s, B as t, C as r, x as e, O as i, z as n, E as m, G as l, H as d, D as C, m as p, n as D, R as S, Q as g, w as u, o as c, c as F, a as T, b as P, U as w, l as A, g as I, i as f, h as b, j as y, e as B, k as M, F as U, d as k, f as x, I as L, L as R, y as v, M as E, p as N, N as h, P as G, t as O, u as j, S as q, r as z, s as H, T as J, J as K, K as Q, q as _, v as V } from "./empty-state-C1cQharY.js";
|
|
2
|
+
import { A as X, P as Y, g as Z } from "./range-calendar-BfGmjXMP.js";
|
|
3
3
|
export {
|
|
4
4
|
s as Alert,
|
|
5
5
|
X as Avatar,
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as s, p as n, C as t, j as o, D as r, m as l, k as i, H as d, I as b, N as u, O as v, P as g, S as p, n as T, o as D, x as N, s as k, q as C, r as c, T as B, t as M, w as m, u as y, v as W, l as h, U as S, W as H, f as P, h as U, i as x, c as I, d as f, b as L, e as O, a as F, g as G } from "./signature-panel-
|
|
2
|
-
import { b as R, C as j, D as q, a as z, F as A, M as E, R as J, c as K, p as Q } from "./range-calendar-
|
|
3
|
-
import { B as X, I as Y, M as Z, d as _, e as $, g as aa, N as ea, b as sa, a as na, f as ta, P as oa, c as ra, S as la, T as ia } from "./mobile-nav-wrapper-
|
|
1
|
+
import { B as s, p as n, C as t, j as o, D as r, m as l, k as i, H as d, I as b, N as u, O as v, P as g, S as p, n as T, o as D, x as N, s as k, q as C, r as c, T as B, t as M, w as m, u as y, v as W, l as h, U as S, W as H, f as P, h as U, i as x, c as I, d as f, b as L, e as O, a as F, g as G } from "./signature-panel-9qDKGR9E.js";
|
|
2
|
+
import { b as R, C as j, D as q, a as z, F as A, M as E, R as J, c as K, p as Q } from "./range-calendar-BfGmjXMP.js";
|
|
3
|
+
import { B as X, I as Y, M as Z, d as _, e as $, g as aa, N as ea, b as sa, a as na, f as ta, P as oa, c as ra, S as la, T as ia } from "./mobile-nav-wrapper-v-WRf__8.js";
|
|
4
4
|
export {
|
|
5
5
|
s as BackButton,
|
|
6
6
|
X as Backdrop,
|
package/dist/pages.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, a as P, C as g, F as n, b as l, c as i, M as r, P as c, S as o } from "./sidebar-menu-page-
|
|
1
|
+
import { B as s, a as P, C as g, F as n, b as l, c as i, M as r, P as c, S as o } from "./sidebar-menu-page-ClbFsXDG.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BasicPage,
|
|
4
4
|
P as BlankPage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Div as h, Span as H, Button as _, OnState as J, On as z } from "@base-framework/atoms";
|
|
2
2
|
import { Component as Y, Data as B, Atom as j, DateTime as T } from "@base-framework/base";
|
|
3
3
|
import { I as L } from "./image-BB__4s0g.js";
|
|
4
|
-
import { B as f } from "./buttons-
|
|
4
|
+
import { B as f } from "./buttons-uRdH6CMH.js";
|
|
5
5
|
import { Icons as P } from "./icons.es.js";
|
|
6
6
|
const U = (e, t) => {
|
|
7
7
|
const n = e ? e.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, a = t.getBoundingClientRect(), s = 10, r = globalThis.scrollX, l = globalThis.scrollY;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Div as t, Header as n, H1 as d, P as o } from "@base-framework/atoms";
|
|
2
2
|
import { F as l, A as x } from "./aside-template-sUm-F2f0.js";
|
|
3
3
|
import { Component as h, Atom as i } from "@base-framework/base";
|
|
4
|
-
import { c as u, e as p } from "./mobile-nav-wrapper-
|
|
4
|
+
import { c as u, e as p } from "./mobile-nav-wrapper-v-WRf__8.js";
|
|
5
5
|
class c extends h {
|
|
6
6
|
/**
|
|
7
7
|
* This will declare the props for the compiler.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Button as w, Div as o, On as C, Span as L, Th as N, UseParent as E, I as Q, Thead as V, Tr as G, Table as B, P as v, Li as y, Time as X, Nav as m, Ul as f, Section as I, Canvas as q } from "@base-framework/atoms";
|
|
2
2
|
import { Atom as d, Component as p, Data as T, DateTime as K, router as k, NavLink as M, DataTracker as U, Jot as _, base as O, Dom as W } from "@base-framework/base";
|
|
3
|
-
import { B as P, I as J } from "./buttons-
|
|
3
|
+
import { B as P, I as J } from "./buttons-uRdH6CMH.js";
|
|
4
4
|
import { Icons as S } from "./icons.es.js";
|
|
5
5
|
import { TableBody as Z, DataTableBody as ee, ScrollableTableBody as te, List as se, IntervalTimer as ae } from "@base-framework/organisms";
|
|
6
6
|
import { C as ie, I as ne, H as oe } from "./inputs-9udyzkHR.js";
|
|
7
|
-
import { A as le, P as re } from "./range-calendar-
|
|
7
|
+
import { A as le, P as re } from "./range-calendar-BfGmjXMP.js";
|
|
8
8
|
import { V as g } from "./image-BB__4s0g.js";
|
|
9
9
|
d((t, e) => ({
|
|
10
10
|
class: "flex items-center px-4 py-2",
|
package/package.json
CHANGED
package/dist/buttons-CHEs54Wl.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { I as u, Button as e } from "@base-framework/atoms";
|
|
2
|
-
import { Atom as c } from "@base-framework/base";
|
|
3
|
-
import { Icons as r } from "./icons.es.js";
|
|
4
|
-
const m = {
|
|
5
|
-
xs: "w-4 h-4",
|
|
6
|
-
sm: "w-6 h-6",
|
|
7
|
-
md: "w-8 h-8",
|
|
8
|
-
lg: "w-10 h-10",
|
|
9
|
-
xl: "w-12 h-12",
|
|
10
|
-
"2xl": "w-14 h-14",
|
|
11
|
-
"3xl": "w-16 h-16"
|
|
12
|
-
}, s = c((n, t) => {
|
|
13
|
-
const a = m[n.size || "sm"];
|
|
14
|
-
return u({
|
|
15
|
-
...n,
|
|
16
|
-
class: `stroke-current icon-size ${a} ${n.class || ""}`,
|
|
17
|
-
html: t[0]?.textContent
|
|
18
|
-
});
|
|
19
|
-
}), i = (n) => c((t, a) => e({
|
|
20
|
-
...n,
|
|
21
|
-
...t,
|
|
22
|
-
class: `bttn ${n.class} ${t.class || ""}`
|
|
23
|
-
}, a)), h = c(
|
|
24
|
-
(n, t) => e({
|
|
25
|
-
...n,
|
|
26
|
-
class: n.class
|
|
27
|
-
}, [
|
|
28
|
-
n.icon && n.position !== "right" ? s({ size: "sm", class: n.animation ?? null }, n.icon) : null,
|
|
29
|
-
...t || [],
|
|
30
|
-
n.icon && n.position === "right" ? s({ size: "sm", class: n.animation ?? null }, n.icon) : null
|
|
31
|
-
])
|
|
32
|
-
), l = (n) => c((t, a) => h({
|
|
33
|
-
...n,
|
|
34
|
-
...t,
|
|
35
|
-
class: `bttn ${n.class} ${t.class || ""}`
|
|
36
|
-
}, a)), g = (n) => () => {
|
|
37
|
-
if (n.allowHistory === !0 && globalThis.history.length > 2) {
|
|
38
|
-
globalThis.history.back();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
n.backUrl && app.navigate(n.backUrl);
|
|
42
|
-
}, w = (n) => c((t, a) => (t.icon = t.icon || r.chevron.single.left, t.click = t.click || g(t), h({
|
|
43
|
-
...n,
|
|
44
|
-
...t
|
|
45
|
-
}, a))), o = {
|
|
46
|
-
primary: i({ class: "primary" }),
|
|
47
|
-
secondary: i({ class: "secondary" }),
|
|
48
|
-
destructive: i({ class: "destructive" }),
|
|
49
|
-
warning: i({ class: "warning" }),
|
|
50
|
-
outline: i({ class: "outline" }),
|
|
51
|
-
ghost: i({ class: "ghost" }),
|
|
52
|
-
link: i({ class: "link" }),
|
|
53
|
-
icon: l({ class: "icon" }),
|
|
54
|
-
withIcon: l({ class: "with-icon" }),
|
|
55
|
-
back: w({ class: "with-icon back-button" })
|
|
56
|
-
}, k = c((n, t) => (o[n.variant] || o.primary)(n, t)), y = c((n, t) => k({ ...n, variant: "withIcon", icon: r.loading, animation: "animate-spin" }, t));
|
|
57
|
-
export {
|
|
58
|
-
k as B,
|
|
59
|
-
s as I,
|
|
60
|
-
y as L
|
|
61
|
-
};
|