@api7/ui-components 0.5.0 → 0.6.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/README.md +46 -1
- package/dist/components/alert/alert.d.ts +0 -2
- package/dist/components/alert/alert.js +1 -2
- package/dist/components/avatar/avatar.d.ts +0 -2
- package/dist/components/avatar/avatar.js +1 -2
- package/dist/components/badge/badge.d.ts +0 -2
- package/dist/components/badge/badge.js +1 -2
- package/dist/components/button/button.d.ts +0 -2
- package/dist/components/button/button.js +1 -2
- package/dist/components/calendar/calendar.d.ts +0 -2
- package/dist/components/calendar/calendar.js +1 -2
- package/dist/components/checkbox/checkbox.d.ts +0 -2
- package/dist/components/checkbox/checkbox.js +1 -2
- package/dist/components/combobox/combobox.d.ts +0 -2
- package/dist/components/combobox/combobox.js +1 -2
- package/dist/components/data-table/data-table.d.ts +0 -2
- package/dist/components/data-table/data-table.js +1 -2
- package/dist/components/data-table/filter-header.d.ts +1 -3
- package/dist/components/data-table/filter-header.js +1 -2
- package/dist/components/data-table/sort-header.js +1 -2
- package/dist/components/date-picker/date-picker.d.ts +0 -2
- package/dist/components/date-picker/date-picker.js +1 -2
- package/dist/components/description-list/description-list.d.ts +0 -2
- package/dist/components/description-list/description-list.js +1 -2
- package/dist/components/dialog/dialog.d.ts +0 -2
- package/dist/components/dialog/dialog.js +1 -2
- package/dist/components/drawer/drawer.d.ts +0 -2
- package/dist/components/drawer/drawer.js +1 -2
- package/dist/components/empty/empty.d.ts +0 -2
- package/dist/components/empty/empty.js +1 -2
- package/dist/components/field/field.d.ts +0 -2
- package/dist/components/field/field.js +1 -2
- package/dist/components/field/labeled-field.d.ts +33 -0
- package/dist/components/field/labeled-field.js +67 -0
- package/dist/components/form/choice-fields.d.ts +1 -3
- package/dist/components/form/choice-fields.js +1 -2
- package/dist/components/form/date-fields.d.ts +0 -2
- package/dist/components/form/date-fields.js +1 -2
- package/dist/components/form/errors.d.ts +1 -3
- package/dist/components/form/errors.js +1 -2
- package/dist/components/form/form-context.d.ts +1 -3
- package/dist/components/form/form-context.js +1 -2
- package/dist/components/form/form-item.d.ts +6 -17
- package/dist/components/form/form-item.js +9 -58
- package/dist/components/form/form.d.ts +1 -3
- package/dist/components/form/form.js +1 -2
- package/dist/components/form/lazy-field-components.js +1 -2
- package/dist/components/form/submit-button.d.ts +1 -3
- package/dist/components/form/submit-button.js +1 -2
- package/dist/components/form/text-field.d.ts +1 -3
- package/dist/components/form/text-field.js +1 -2
- package/dist/components/form/toggle-fields.d.ts +1 -3
- package/dist/components/form/toggle-fields.js +30 -46
- package/dist/components/input/input.d.ts +0 -2
- package/dist/components/input/input.js +1 -2
- package/dist/components/input-group/input-group.d.ts +0 -2
- package/dist/components/input-group/input-group.js +1 -2
- package/dist/components/menu/menu.d.ts +14 -4
- package/dist/components/menu/menu.js +34 -24
- package/dist/components/number-field/number-field.d.ts +0 -2
- package/dist/components/number-field/number-field.js +1 -2
- package/dist/components/pagination/pagination.d.ts +1 -3
- package/dist/components/pagination/pagination.js +1 -2
- package/dist/components/popover/popover.d.ts +3 -3
- package/dist/components/popover/popover.js +9 -3
- package/dist/components/progress/progress.d.ts +0 -2
- package/dist/components/progress/progress.js +1 -2
- package/dist/components/radio-group/radio-group.d.ts +0 -2
- package/dist/components/radio-group/radio-group.js +1 -2
- package/dist/components/select/select.d.ts +0 -2
- package/dist/components/select/select.js +1 -2
- package/dist/components/separator/separator.d.ts +0 -2
- package/dist/components/separator/separator.js +1 -2
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sidebar/sidebar.js +2 -3
- package/dist/components/skeleton/skeleton.d.ts +0 -2
- package/dist/components/skeleton/skeleton.js +1 -2
- package/dist/components/spinner/spinner.d.ts +0 -2
- package/dist/components/spinner/spinner.js +1 -2
- package/dist/components/switch/switch.d.ts +0 -2
- package/dist/components/switch/switch.js +1 -2
- package/dist/components/table/table.d.ts +0 -2
- package/dist/components/table/table.js +1 -2
- package/dist/components/tabs/tabs.d.ts +0 -2
- package/dist/components/tabs/tabs.js +1 -2
- package/dist/components/textarea/textarea.d.ts +0 -2
- package/dist/components/textarea/textarea.js +1 -2
- package/dist/components/toast/toast.d.ts +0 -2
- package/dist/components/toast/toast.js +1 -2
- package/dist/components/tooltip/tooltip.d.ts +0 -2
- package/dist/components/tooltip/tooltip.js +1 -2
- package/dist/config/config-provider.d.ts +1 -3
- package/dist/config/config-provider.js +1 -2
- package/dist/config/messages.d.ts +1 -3
- package/dist/config/messages.js +1 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -3
- package/dist/lib/cn.js +1 -2
- package/dist/lib/control.js +1 -2
- package/dist/lib/popup.js +1 -2
- package/dist/tokens/contrast.d.ts +1 -3
- package/dist/tokens/contrast.js +1 -2
- package/dist/tokens/palette.d.ts +0 -2
- package/dist/tokens/palette.js +1 -2
- package/dist/tokens/scale.js +1 -2
- package/dist/tokens/semantic.d.ts +0 -2
- package/dist/tokens/semantic.js +0 -1
- package/dist/tokens/types.d.ts +1 -3
- package/dist/tokens/types.js +1 -2
- package/package.json +5 -5
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Palette } from "./types.js";
|
|
2
2
|
import { SemanticMap } from "./semantic.js";
|
|
3
|
-
//#region src/tokens/contrast.d.ts
|
|
4
3
|
export declare const AA = 4.5;
|
|
5
4
|
export interface ContrastPair {
|
|
6
5
|
name: string;
|
|
@@ -9,5 +8,4 @@ export interface ContrastPair {
|
|
|
9
8
|
ratio: number;
|
|
10
9
|
}
|
|
11
10
|
export declare function semanticPairs(map: SemanticMap): ContrastPair[];
|
|
12
|
-
export declare function badgePairs(theme?: 'light' | 'dark', p?: Palette): ContrastPair[];
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function badgePairs(theme?: 'light' | 'dark', p?: Palette): ContrastPair[];
|
package/dist/tokens/contrast.js
CHANGED
|
@@ -2,7 +2,7 @@ import { FAMILIES } from "./types.js";
|
|
|
2
2
|
import { palette } from "./palette.js";
|
|
3
3
|
import { resolveRef } from "./semantic.js";
|
|
4
4
|
import { wcagContrast } from "culori";
|
|
5
|
-
|
|
5
|
+
// src/tokens/contrast.ts
|
|
6
6
|
const AA = 4.5;
|
|
7
7
|
const TEXT_TOKENS = [
|
|
8
8
|
"foreground",
|
|
@@ -75,5 +75,4 @@ function badgePairs(theme = "light", p = palette) {
|
|
|
75
75
|
const { background, foreground } = BADGE_STEPS[theme];
|
|
76
76
|
return FAMILIES.map((family) => pair(`badge ${family}`, p[family][foreground], p[family][background]));
|
|
77
77
|
}
|
|
78
|
-
//#endregion
|
|
79
78
|
export { AA, BADGE_STEPS, SURFACE_TOKENS, TEXT_TOKENS, badgePairs, semanticPairs };
|
package/dist/tokens/palette.d.ts
CHANGED
package/dist/tokens/palette.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FAMILIES, STEPS } from "./types.js";
|
|
2
2
|
import { buildPalette } from "./scale.js";
|
|
3
|
-
|
|
3
|
+
// src/tokens/palette.ts
|
|
4
4
|
const ANCHORS = {
|
|
5
5
|
gray: {
|
|
6
6
|
50: "#FCFCFC",
|
|
@@ -93,5 +93,4 @@ const ANCHORS = {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
const palette = buildPalette(ANCHORS);
|
|
96
|
-
//#endregion
|
|
97
96
|
export { ANCHORS, FAMILIES, STEPS, palette };
|
package/dist/tokens/scale.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { STEPS } from "./types.js";
|
|
2
2
|
import { clampChroma, formatHex, oklch, parse } from "culori";
|
|
3
|
-
|
|
3
|
+
// src/tokens/scale.ts
|
|
4
4
|
const LIGHTEST_MIN = .975;
|
|
5
5
|
const LIGHTEST_MAX = .995;
|
|
6
6
|
const DARKEST_MAX = .22;
|
|
@@ -94,5 +94,4 @@ function buildScale(anchors) {
|
|
|
94
94
|
function buildPalette(anchors) {
|
|
95
95
|
return Object.fromEntries(Object.entries(anchors).map(([family, set]) => [family, buildScale(set)]));
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { buildPalette, buildScale };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Family, Step } from "./types.js";
|
|
2
|
-
//#region src/tokens/semantic.d.ts
|
|
3
2
|
type OpaqueRef = 'white' | 'black' | `${Family}-${Step}`;
|
|
4
3
|
export type ColorRef = OpaqueRef | `${OpaqueRef}/${number}`;
|
|
5
4
|
export declare const SEMANTIC_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-hover", "primary-foreground", "primary-text", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-hover", "destructive-foreground", "destructive-text", "destructive-subtle", "success", "success-foreground", "success-subtle", "warning", "warning-foreground", "warning-subtle", "info", "info-foreground", "info-subtle", "border", "input", "ring", "tooltip", "tooltip-foreground", "table-header", "secondary-hover", "accent-hover", "accent-selected", "overlay", "sidebar-accent", "sidebar-indicator"];
|
|
@@ -9,5 +8,4 @@ export declare const themes: {
|
|
|
9
8
|
light: SemanticMap;
|
|
10
9
|
dark: SemanticMap;
|
|
11
10
|
};
|
|
12
|
-
//#endregion
|
|
13
11
|
export {};
|
package/dist/tokens/semantic.js
CHANGED
package/dist/tokens/types.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
//#region src/tokens/types.d.ts
|
|
2
1
|
export declare const STEPS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
3
2
|
export type Step = (typeof STEPS)[number];
|
|
4
3
|
export declare const FAMILIES: readonly ["gray", "slate", "blue", "green", "red", "yellow", "orange", "cyan", "indigo", "purple", "pink"];
|
|
5
4
|
export type Family = (typeof FAMILIES)[number];
|
|
6
|
-
export type Palette = Record<Family, Record<Step, string>>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export type Palette = Record<Family, Record<Step, string>>;
|
package/dist/tokens/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api7/ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "API7 React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@base-ui/react": "^1.8.0",
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|
|
36
|
-
"cn": "^0.
|
|
36
|
+
"cn": "^0.5.0",
|
|
37
37
|
"culori": "^4.0.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@tanstack/react-form": "^1.33.5",
|
|
61
61
|
"@tanstack/react-table": "^9.2.4",
|
|
62
62
|
"@types/culori": "^4.0.1",
|
|
63
|
-
"@types/node": "^
|
|
63
|
+
"@types/node": "^26.0.0",
|
|
64
64
|
"@types/react": "19.3.0",
|
|
65
65
|
"@types/react-dom": "19.3.0",
|
|
66
66
|
"@vitejs/plugin-react": "^6.1.1",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"lucide-react": "^1.48.0",
|
|
71
71
|
"playwright": "1.63.0",
|
|
72
72
|
"publint": "^0.3.24",
|
|
73
|
-
"react": "19.3.
|
|
73
|
+
"react": "19.3.1",
|
|
74
74
|
"react-day-picker": "^10.0.1",
|
|
75
|
-
"react-dom": "19.3.
|
|
75
|
+
"react-dom": "19.3.1",
|
|
76
76
|
"tailwindcss": "^4.3.3",
|
|
77
77
|
"tsdown": "^0.23.0",
|
|
78
78
|
"typescript": "6.0.3",
|