@base-framework/ui 1.0.1727 → 1.0.2001
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 +80 -0
- package/dist/aside-template-sUm-F2f0.js +44 -0
- package/dist/atoms.es.js +31 -30
- package/dist/{bside-template-Du2m3rsE.js → bside-template-do_hXebn.js} +1 -1
- package/dist/{buttons-Cm9etaEG.js → buttons-CHEs54Wl.js} +23 -24
- package/dist/{confirmation-BxmDhBjv.js → empty-state-BfT4MKkN.js} +721 -335
- package/dist/form-group-CJzpq9Us.js +29 -0
- package/dist/format-BLolnx9j.js +122 -0
- package/dist/icons.es.js +4 -1
- package/dist/image-scaler-1G-JzJVG.js +530 -0
- package/dist/index.es.js +170 -151
- package/dist/inputs-9udyzkHR.js +210 -0
- package/dist/{mobile-nav-wrapper-Dj67Pb8l.js → mobile-nav-wrapper-Dm9DinRD.js} +2 -2
- package/dist/molecules.es.js +46 -39
- package/dist/organisms.es.js +55 -49
- package/dist/pages.es.js +1 -1
- package/dist/range-calendar-BMWSJTE0.js +833 -0
- package/dist/{sidebar-menu-page-BVryQj2Z.js → sidebar-menu-page-D4WMgz5U.js} +6 -6
- package/dist/{signature-panel-xXbYWejE.js → signature-panel-Bq-usDxi.js} +598 -252
- package/dist/templates.es.js +2 -2
- package/dist/{tooltip-CESEqMCU.js → tooltip-PupzYM1r.js} +27 -34
- package/dist/types/components/atoms/atoms.d.ts +1 -0
- package/dist/types/components/atoms/form/form-group.d.ts +12 -0
- package/dist/types/components/atoms/form/inputs/input-classes.d.ts +2 -2
- package/dist/types/components/atoms/form/inputs/inputs.d.ts +0 -7
- package/dist/types/components/molecules/date-time/date-range-picker.d.ts +10 -0
- package/dist/types/components/molecules/empty/empty-state.d.ts +9 -0
- package/dist/types/components/molecules/files/attachment/attachment-input.d.ts +9 -0
- package/dist/types/components/molecules/files/attachment/attachment.d.ts +10 -0
- package/dist/types/components/molecules/files/attachment/orientation.d.ts +1 -0
- package/dist/types/components/molecules/files/attachment/type.d.ts +1 -0
- package/dist/types/components/molecules/form/form-card.d.ts +31 -0
- package/dist/types/components/molecules/image/image-uploader.d.ts +9 -0
- package/dist/types/components/molecules/image/logo-uploader.d.ts +9 -0
- package/dist/types/components/molecules/molecules.d.ts +5 -0
- package/dist/types/components/molecules/notifications/notification.d.ts +3 -3
- package/dist/types/components/organisms/calendar/calendar.d.ts +6 -0
- package/dist/types/components/organisms/calendar/month/calendar-header.d.ts +7 -0
- package/dist/types/components/organisms/calendar/month-selector.d.ts +5 -0
- package/dist/types/components/organisms/calendar/range/calendar-header.d.ts +7 -0
- package/dist/types/components/organisms/calendar/range/day-header.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/days-of-week-header.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/month-calendar.d.ts +17 -0
- package/dist/types/components/organisms/calendar/range/month-selector.d.ts +5 -0
- package/dist/types/components/organisms/calendar/range/navigation-button.d.ts +1 -0
- package/dist/types/components/organisms/calendar/range/range-calendar.d.ts +72 -0
- package/dist/types/components/organisms/calendar/range/range-day-cell.d.ts +10 -0
- package/dist/types/components/organisms/calendar/range/range-days-grid.d.ts +6 -0
- package/dist/types/components/organisms/calendar/range/range-toggle.d.ts +7 -0
- package/dist/types/components/organisms/calendar/range/year-selector.d.ts +4 -0
- package/dist/types/components/organisms/calendar/year-selector.d.ts +5 -0
- package/dist/types/components/organisms/lists/data-table-body.d.ts +1 -1
- package/dist/types/components/organisms/lists/data-table.d.ts +7 -0
- package/dist/types/components/organisms/lists/dynamic-data-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/dynamic-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/scrollable-data-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/scrollable-table.d.ts +2 -0
- package/dist/types/components/organisms/lists/skeleton-examples.d.ts +12 -0
- package/dist/types/components/organisms/lists/skeleton-table-row.d.ts +6 -0
- package/dist/types/components/organisms/organisms.d.ts +6 -0
- package/dist/types/components/organisms/tabs/button-tab.d.ts +2 -2
- package/dist/types/components/organisms/tabs/tab-group.d.ts +3 -3
- package/dist/types/components/organisms/tabs/tab-navigation.d.ts +2 -2
- package/dist/types/components/organisms/tabs/tab.d.ts +2 -2
- package/dist/types/components/organisms/tabs/underlined-button-tab.d.ts +60 -0
- package/dist/types/components/organisms/tabs/underlined-tab-group.d.ts +48 -0
- package/dist/types/components/organisms/tabs/underlined-tab-navigation.d.ts +63 -0
- package/dist/types/components/organisms/tabs/underlined-tab.d.ts +36 -0
- package/dist/types/demo.d.ts +0 -0
- package/dist/types/ui.d.ts +1 -0
- package/dist/types/utils/format/format.d.ts +78 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/utils.es.js +7 -1
- package/dist/veil-CqnAmj-D.js +20 -0
- package/package.json +85 -85
- package/dist/aside-template-McEj_Gxc.js +0 -35
- package/dist/calendar-DQXME-2u.js +0 -440
- package/dist/inputs-Dmu4Z-7-.js +0 -209
- package/dist/veil-D4dRxILB.js +0 -21
package/copilot.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Copilot instructions for this repo
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## How things fit together
|
|
6
|
+
- Runtime primitives come from external packages:
|
|
7
|
+
- `@base-framework/base` supplies Component, Atom, Data, Jot, Events, router, NavLink, etc.
|
|
8
|
+
- `@base-framework/atoms` supplies DOM tag helpers (Div, Button, Input, Ul, Li, etc.) and reactive helpers (On, OnState, UseParent, OnStateOpen).
|
|
9
|
+
- Local exports aggregate in `src/ui.js` and sub-entries in `vite.config.js`:
|
|
10
|
+
- `@base-framework/ui` (index) exports everything from `components/*` and `utils/*`.
|
|
11
|
+
- Subpath imports are enabled: `@base-framework/ui/atoms`, `.../icons`, `.../molecules`, `.../organisms`, `.../pages`, `.../templates`, `.../utils`.
|
|
12
|
+
- Styling is Tailwind 4 with custom CSS vars (see `tailwind.config.js`). Use existing design tokens like `text-muted-foreground`, `bg-muted/10`, `border`, `ring`.
|
|
13
|
+
|
|
14
|
+
## Build and dev workflow
|
|
15
|
+
- Install: npm i
|
|
16
|
+
- Dev: npm run dev → Vite dev server with Tailwind plugin (@tailwindcss/vite)
|
|
17
|
+
- Build: npm run build → Vite library build (ES modules only) + `tsc` to emit `.d.ts` from JS via JSDoc
|
|
18
|
+
- Preview: npm run preview
|
|
19
|
+
- Outputs land in `dist/*.es.js` and `dist/types/**`. Rollup marks `@base-framework/*` externals, so do not import those files directly.
|
|
20
|
+
|
|
21
|
+
## Authoring components (project conventions)
|
|
22
|
+
- Prefer functional atoms via `Atom((props, children) => ...)` for small UI pieces. Example: `AlertIcon`, `AlertTitle`, etc.
|
|
23
|
+
- Use `Component` subclasses for stateful or composed widgets. Provide `declareProps()` to document/public props for tooling and `render()` to return markup.
|
|
24
|
+
- Event handlers and props:
|
|
25
|
+
- Standard props merge pattern: `{ ...defaultProps, ...props, class: "base classes ${props.class || ''}" }`.
|
|
26
|
+
- For icon buttons: pass `icon` and optionally `position: 'right'`.
|
|
27
|
+
- Use `click` props for click handlers; follow patterns like back navigation in `buttons.js`.
|
|
28
|
+
- Reactive/data patterns (from Base):
|
|
29
|
+
- `Data` for mutable view-models inside Components (e.g., `DataTable`, `Calendar`).
|
|
30
|
+
- `Jot(...)` HOC to create jot components (e.g., `SearchDropdown`, `Toggle`).
|
|
31
|
+
- Bindings: use `bind: 'path'` or arrays like `bind: [state, 'key']` on atom props to two-way bind values.
|
|
32
|
+
- Lists: map/repeat with `for: ['collectionKey', (item, i) => ...]` or `map: [array, fn]`.
|
|
33
|
+
- Subscriptions: `On('key', callback)` or `OnState/Open` utilities to react to state.
|
|
34
|
+
- Parent context: `UseParent(({ state, ... }) => ...)` to access parent component refs.
|
|
35
|
+
|
|
36
|
+
## File layout to know
|
|
37
|
+
- `src/components/atoms/**`: Base-level atoms and atom variants (e.g., buttons, icons, badges, tooltips, skeleton, veil).
|
|
38
|
+
- `src/components/molecules/**`: Composition of atoms with light state (alerts, dropdowns, date/time pickers, theme toggle, counters, uploaders, etc.).
|
|
39
|
+
- `src/components/organisms/**`: Heavier components with internal `Component` state (tables, navigation, overlays, signature, tabs, calendar, lists).
|
|
40
|
+
- `src/components/pages/**`: Page/layout primitives (`Page`, `BasicPage`, `MainSection`, full-page layouts, sidebar layouts, templates).
|
|
41
|
+
- `src/utils/**`: Utilities (formatting, image-scaler with pointer/zoom/drag helpers).
|
|
42
|
+
- `src/ui.js`: Re-exports public surface used by `vite` lib entries.
|
|
43
|
+
|
|
44
|
+
## Tailwind and theming
|
|
45
|
+
- 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.
|
|
46
|
+
- Use semantic tokens configured in `tailwind.config.js`: `primary`, `secondary`, `destructive`, `warning`, `muted`, `accent`, `popover`, `card`, `border`, `foreground`, with `DEFAULT` and `foreground` pairs.
|
|
47
|
+
- Dark mode is `media`. Prefer classes already used (`data-[state=active]:...`, rounded tokens via `--radius`).
|
|
48
|
+
|
|
49
|
+
## Patterns by example
|
|
50
|
+
- Functional Atom example (from `molecules/alert.js`):
|
|
51
|
+
- Compose small atoms: `Div` containers + `I` for icons + `H5/P` for text
|
|
52
|
+
- Type variants use lookup table → apply Tailwind classes from map
|
|
53
|
+
- Variant pattern (from `atoms/buttons/buttons.js`):
|
|
54
|
+
- Define variant factories, then export a single `Button` Atom that dispatches by `props.variant`
|
|
55
|
+
- Icon handling via a shared `IconButton` Atom; support `position: 'right'`
|
|
56
|
+
- Data-driven lists (from `molecules/dropdowns/dropdown.js`):
|
|
57
|
+
- `for: ['groups', (group) => ...]` to render nested collections
|
|
58
|
+
- Stateful Component (from `organisms/panel.js`):
|
|
59
|
+
- `class Panel extends Component { declareProps() { this.class = '' } render() { return Div({ class: this.class }, this.children) } }`
|
|
60
|
+
|
|
61
|
+
## Coding rules (do/don’t)
|
|
62
|
+
- Do: import primitives from `@base-framework/atoms` and state tools from `@base-framework/base`; keep them as externals.
|
|
63
|
+
- Do: export new public pieces from the appropriate barrel files (`components/*/atoms.js`, `.../molecules.js`, `.../organisms.js`, `pages.js`, `templates.js`, `utils.js`) so they are part of the library entry.
|
|
64
|
+
- Do: keep Tailwind classes consistent with existing tokens; avoid raw hex colors.
|
|
65
|
+
- Don’t: introduce React/Vue/JSX; this project uses Base’s declarative atoms/components.
|
|
66
|
+
- Don’t: mutate DOM directly; use Atom/Component APIs and Data bindings.
|
|
67
|
+
|
|
68
|
+
## Adding a new component (checklist)
|
|
69
|
+
1) Decide Atom vs Component (stateless vs stateful/interactive)
|
|
70
|
+
2) Place file under the correct layer folder and export it from that layer’s barrel (and from `src/ui.js` if needed via existing barrels)
|
|
71
|
+
3) Use Tailwind utility classes aligned with theme tokens
|
|
72
|
+
4) If it needs data/state, use `Data`/`Jot`, `On`, `bind`, `for` as seen in existing components
|
|
73
|
+
5) Run dev server and verify render; run build to ensure types emit
|
|
74
|
+
|
|
75
|
+
## Commands reference
|
|
76
|
+
- Dev: `npm run dev`
|
|
77
|
+
- Build: `npm run build`
|
|
78
|
+
- Preview: `npm run preview`
|
|
79
|
+
|
|
80
|
+
If anything seems unclear (e.g., preferred binding patterns or where to export), ask for confirmation before large changes.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Atom as t } from "@base-framework/base";
|
|
2
|
+
import { Header as c, H1 as o } from "@base-framework/atoms";
|
|
3
|
+
const x = t((l, e) => ({
|
|
4
|
+
tag: "section",
|
|
5
|
+
...l,
|
|
6
|
+
children: e
|
|
7
|
+
})), u = t((l, e) => x({
|
|
8
|
+
class: "body full-container flex flex-auto flex-col " + l.class,
|
|
9
|
+
...l
|
|
10
|
+
}, e)), n = t((l, e) => {
|
|
11
|
+
const a = l.flex ? l.flex : "flex flex-auto flex-col lg:flex-row";
|
|
12
|
+
return l.class = "row " + a + " " + (l.class || ""), {
|
|
13
|
+
...l,
|
|
14
|
+
children: e
|
|
15
|
+
};
|
|
16
|
+
}), m = t((l, e) => c([
|
|
17
|
+
o({ watch: l.watch }, l.text)
|
|
18
|
+
], e)), f = t((l, e) => {
|
|
19
|
+
const a = l.flex ? "flex flex-none" : "flex flex-auto flex-col";
|
|
20
|
+
return l.class = "col " + a + " " + (l.class || ""), {
|
|
21
|
+
...l,
|
|
22
|
+
children: e
|
|
23
|
+
};
|
|
24
|
+
}), i = t((l, e) => x({ class: "body aside-container flex flex-auto flex-col max-w-[100vw] h-full" }, [
|
|
25
|
+
n([
|
|
26
|
+
f({
|
|
27
|
+
class: "drawer control w-full md:max-w-[320px]",
|
|
28
|
+
flex: "flex flex-none md:flex-auto flex-col"
|
|
29
|
+
}, [
|
|
30
|
+
l.left
|
|
31
|
+
]),
|
|
32
|
+
f([
|
|
33
|
+
l.right
|
|
34
|
+
])
|
|
35
|
+
])
|
|
36
|
+
]));
|
|
37
|
+
export {
|
|
38
|
+
i as A,
|
|
39
|
+
u as F,
|
|
40
|
+
f as M,
|
|
41
|
+
n as R,
|
|
42
|
+
m as T,
|
|
43
|
+
x as a
|
|
44
|
+
};
|
package/dist/atoms.es.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { B as e, C as t,
|
|
2
|
-
import { B as
|
|
3
|
-
import { C as
|
|
4
|
-
import { V as
|
|
1
|
+
import { B as e, C as t, F as o, L as r, P as n, R as p, S as u, a as I, T as i } from "./tooltip-PupzYM1r.js";
|
|
2
|
+
import { B as d, I as m, L as x } from "./buttons-CHEs54Wl.js";
|
|
3
|
+
import { C as T, F as B } from "./form-group-CJzpq9Us.js";
|
|
4
|
+
import { C as c, d as f, D as g, 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
|
+
import { V as W, a as w } from "./veil-CqnAmj-D.js";
|
|
5
6
|
export {
|
|
6
7
|
e as Badge,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
d as Button,
|
|
9
|
+
T as Card,
|
|
10
|
+
c as Checkbox,
|
|
11
|
+
t as CircleGraph,
|
|
12
|
+
f as ColorInput,
|
|
13
|
+
g as DateInput,
|
|
14
|
+
L as DateTimeInput,
|
|
15
|
+
P as EmailInput,
|
|
15
16
|
o as Fieldset,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
R as FileInput,
|
|
18
|
+
B as FormGroup,
|
|
19
|
+
S as HiddenInput,
|
|
20
|
+
m as Icon,
|
|
21
|
+
b as Input,
|
|
22
|
+
r as Legend,
|
|
23
|
+
x as LoadingButton,
|
|
24
|
+
h as MonthInput,
|
|
25
|
+
k as NumberInput,
|
|
26
|
+
D as PasswordInput,
|
|
27
|
+
n as ProgressBar,
|
|
28
|
+
V as Radio,
|
|
29
|
+
p as RangeSlider,
|
|
30
|
+
u as Select,
|
|
31
|
+
I as Skeleton,
|
|
32
|
+
E as TelInput,
|
|
33
|
+
G as Textarea,
|
|
33
34
|
H as TimeInput,
|
|
34
|
-
|
|
35
|
+
i as Tooltip,
|
|
35
36
|
M as UrlInput,
|
|
36
37
|
W as Veil,
|
|
37
38
|
w as VeilJot,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Atom as t } from "@base-framework/base";
|
|
2
|
-
import { a, R as l, M as o } from "./aside-template-
|
|
2
|
+
import { a, R as l, M as o } from "./aside-template-sUm-F2f0.js";
|
|
3
3
|
const s = t((e, r) => a({ class: "body bside-container flex flex-auto flex-col" }, [
|
|
4
4
|
l([
|
|
5
5
|
o([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as
|
|
2
|
-
import { Atom as
|
|
3
|
-
import { Icons as
|
|
4
|
-
const
|
|
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
5
|
xs: "w-4 h-4",
|
|
6
6
|
sm: "w-6 h-6",
|
|
7
7
|
md: "w-8 h-8",
|
|
@@ -9,28 +9,27 @@ const w = {
|
|
|
9
9
|
xl: "w-12 h-12",
|
|
10
10
|
"2xl": "w-14 h-14",
|
|
11
11
|
"3xl": "w-16 h-16"
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return m({
|
|
12
|
+
}, s = c((n, t) => {
|
|
13
|
+
const a = m[n.size || "sm"];
|
|
14
|
+
return u({
|
|
16
15
|
...n,
|
|
17
16
|
class: `stroke-current icon-size ${a} ${n.class || ""}`,
|
|
18
|
-
html:
|
|
17
|
+
html: t[0]?.textContent
|
|
19
18
|
});
|
|
20
|
-
}), i = (n) =>
|
|
19
|
+
}), i = (n) => c((t, a) => e({
|
|
21
20
|
...n,
|
|
22
21
|
...t,
|
|
23
22
|
class: `bttn ${n.class} ${t.class || ""}`
|
|
24
|
-
}, a)), h =
|
|
25
|
-
(n, t) =>
|
|
23
|
+
}, a)), h = c(
|
|
24
|
+
(n, t) => e({
|
|
26
25
|
...n,
|
|
27
26
|
class: n.class
|
|
28
27
|
}, [
|
|
29
|
-
n.icon && n.position !== "right" ?
|
|
28
|
+
n.icon && n.position !== "right" ? s({ size: "sm", class: n.animation ?? null }, n.icon) : null,
|
|
30
29
|
...t || [],
|
|
31
|
-
n.icon && n.position === "right" ?
|
|
30
|
+
n.icon && n.position === "right" ? s({ size: "sm", class: n.animation ?? null }, n.icon) : null
|
|
32
31
|
])
|
|
33
|
-
),
|
|
32
|
+
), l = (n) => c((t, a) => h({
|
|
34
33
|
...n,
|
|
35
34
|
...t,
|
|
36
35
|
class: `bttn ${n.class} ${t.class || ""}`
|
|
@@ -40,10 +39,10 @@ const w = {
|
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
41
|
n.backUrl && app.navigate(n.backUrl);
|
|
43
|
-
},
|
|
42
|
+
}, w = (n) => c((t, a) => (t.icon = t.icon || r.chevron.single.left, t.click = t.click || g(t), h({
|
|
44
43
|
...n,
|
|
45
44
|
...t
|
|
46
|
-
}, a))),
|
|
45
|
+
}, a))), o = {
|
|
47
46
|
primary: i({ class: "primary" }),
|
|
48
47
|
secondary: i({ class: "secondary" }),
|
|
49
48
|
destructive: i({ class: "destructive" }),
|
|
@@ -51,12 +50,12 @@ const w = {
|
|
|
51
50
|
outline: i({ class: "outline" }),
|
|
52
51
|
ghost: i({ class: "ghost" }),
|
|
53
52
|
link: i({ class: "link" }),
|
|
54
|
-
icon:
|
|
55
|
-
withIcon:
|
|
56
|
-
back:
|
|
57
|
-
},
|
|
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));
|
|
58
57
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
k as B,
|
|
59
|
+
s as I,
|
|
60
|
+
y as L
|
|
62
61
|
};
|