zaravand-ui 4.2.3 → 4.3.1
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 +45 -45
- package/dist/components/shared/responsiveScale.d.ts +31 -27
- package/dist/index.cjs +13 -13
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4292 -4285
- package/dist/shared/scale.d.ts +32 -0
- package/package.json +1 -1
- package/dist/components/Select/Select.filter.d.ts +0 -8
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
# zaravand-ui
|
|
2
|
-
|
|
3
|
-
Reusable React UI library with centralized theme tokens.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i zaravand-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import "zaravand-ui/styles.css"
|
|
15
|
-
import { Button, applyTheme } from "zaravand-ui"
|
|
16
|
-
|
|
17
|
-
applyTheme({
|
|
18
|
-
primary: "#2563EB",
|
|
19
|
-
secondary: "#0891B2",
|
|
20
|
-
text: "#F8FAFC",
|
|
21
|
-
success: "#16A34A",
|
|
22
|
-
warning: "#EAB308",
|
|
23
|
-
danger: "#DC2626",
|
|
24
|
-
border: "#334155",
|
|
25
|
-
surface: "#0F172A",
|
|
26
|
-
mutedSurface: "#1E293B",
|
|
27
|
-
tooltipSurface: "#0B1120",
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
export function Example() {
|
|
31
|
-
return <Button label="Save" />
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Scripts
|
|
36
|
-
|
|
37
|
-
- `npm run build`
|
|
38
|
-
- `npm run docs:dev`
|
|
39
|
-
- `npm run docs:build`
|
|
40
|
-
- `npm run docs:preview`
|
|
41
|
-
|
|
42
|
-
## Documentation
|
|
43
|
-
|
|
44
|
-
- Developer docs (VitePress): `docs/`
|
|
45
|
-
- Full integration guide: `ZARAVAND_UI_INTEGRATION_GUIDE.md`
|
|
1
|
+
# zaravand-ui
|
|
2
|
+
|
|
3
|
+
Reusable React UI library with centralized theme tokens.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i zaravand-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import "zaravand-ui/styles.css"
|
|
15
|
+
import { Button, applyTheme } from "zaravand-ui"
|
|
16
|
+
|
|
17
|
+
applyTheme({
|
|
18
|
+
primary: "#2563EB",
|
|
19
|
+
secondary: "#0891B2",
|
|
20
|
+
text: "#F8FAFC",
|
|
21
|
+
success: "#16A34A",
|
|
22
|
+
warning: "#EAB308",
|
|
23
|
+
danger: "#DC2626",
|
|
24
|
+
border: "#334155",
|
|
25
|
+
surface: "#0F172A",
|
|
26
|
+
mutedSurface: "#1E293B",
|
|
27
|
+
tooltipSurface: "#0B1120",
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export function Example() {
|
|
31
|
+
return <Button label="Save" />
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Scripts
|
|
36
|
+
|
|
37
|
+
- `npm run build`
|
|
38
|
+
- `npm run docs:dev`
|
|
39
|
+
- `npm run docs:build`
|
|
40
|
+
- `npm run docs:preview`
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
- Developer docs (VitePress): `docs/`
|
|
45
|
+
- Full integration guide: `ZARAVAND_UI_INTEGRATION_GUIDE.md`
|
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fixed desktop-sized tokens for the whole library
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Fixed desktop-sized tokens for the whole library, expressed as a bare
|
|
3
|
+
* number multiplied by the `--zui-scale` CSS custom property (see
|
|
4
|
+
* src/index.css) instead of `rem`. `--zui-scale` is a LENGTH that
|
|
5
|
+
* defaults to `10px` — the desktop/Full-HD design size, identical to
|
|
6
|
+
* this library's previous fixed-rem behavior — when a consuming app
|
|
7
|
+
* doesn't set it, and is intentionally independent of the host app's own
|
|
8
|
+
* root `font-size`/`rem` scaling, which this library no longer reads
|
|
9
|
+
* (`rem` always resolves against the document's <html> element, so it
|
|
10
|
+
* can't be scoped to just this library's components).
|
|
6
11
|
*
|
|
7
|
-
* Every
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* root font-size scaling is applied.
|
|
12
|
+
* Every bare number below is the token's old `rem` numeral, unchanged —
|
|
13
|
+
* those were already authored against a 1rem = 10px baseline, which is
|
|
14
|
+
* exactly what `--zui-scale`'s `10px` default reproduces.
|
|
11
15
|
*/
|
|
12
|
-
declare const CONTROL_HEIGHT_SM = "zui:h-[4.
|
|
13
|
-
declare const CONTROL_HEIGHT_DEFAULT = "zui:h-[5.
|
|
14
|
-
declare const CONTROL_HEIGHT_LG = "zui:h-[5.
|
|
16
|
+
declare const CONTROL_HEIGHT_SM = "zui:h-[calc(var(--zui-scale,10px)*4.608)]";
|
|
17
|
+
declare const CONTROL_HEIGHT_DEFAULT = "zui:h-[calc(var(--zui-scale,10px)*5.184)]";
|
|
18
|
+
declare const CONTROL_HEIGHT_LG = "zui:h-[calc(var(--zui-scale,10px)*5.76)]";
|
|
15
19
|
declare const controlHeightBySize: {
|
|
16
|
-
readonly sm: "zui:h-[4.
|
|
17
|
-
readonly default: "zui:h-[5.
|
|
18
|
-
readonly lg: "zui:h-[5.
|
|
20
|
+
readonly sm: "zui:h-[calc(var(--zui-scale,10px)*4.608)]";
|
|
21
|
+
readonly default: "zui:h-[calc(var(--zui-scale,10px)*5.184)]";
|
|
22
|
+
readonly lg: "zui:h-[calc(var(--zui-scale,10px)*5.76)]";
|
|
19
23
|
};
|
|
20
|
-
declare const CONTROL_PADDING_X = "zui:px-[1.
|
|
21
|
-
declare const CONTROL_PADDING_Y = "zui:py-[1.
|
|
22
|
-
declare const BUTTON_PADDING_X = "zui:px-[1.
|
|
23
|
-
declare const TEXTAREA_MIN_HEIGHT = "zui:min-h-[7.
|
|
24
|
-
declare const TABLE_HEADER_HEIGHT = "zui:h-[5.
|
|
25
|
-
declare const TABLE_TEXT_SIZE = "zui:text-[1.
|
|
26
|
-
declare const DATEPICKER_DAY_SIZE = "zui:size-[3.
|
|
27
|
-
declare const DATEPICKER_NAV_SIZE = "zui:size-[2.
|
|
28
|
-
declare const DATEPICKER_CONTROL_HEIGHT = "zui:h-[3.
|
|
29
|
-
declare const OVERLAY_PANEL_PADDING = "zui:p-[2.
|
|
30
|
-
declare const TOAST_PADDING = "zui:p-[1.
|
|
31
|
-
declare const DATEPICKER_MANUAL_SEGMENT_WIDTH = "zui:w-[10.
|
|
32
|
-
declare const SQUARE_ICON_BUTTON_SIZE_IMPORTANT = "zui:[&>button]:!h-[4.
|
|
24
|
+
declare const CONTROL_PADDING_X = "zui:px-[calc(var(--zui-scale,10px)*1.2)]";
|
|
25
|
+
declare const CONTROL_PADDING_Y = "zui:py-[calc(var(--zui-scale,10px)*1.2)]";
|
|
26
|
+
declare const BUTTON_PADDING_X = "zui:px-[calc(var(--zui-scale,10px)*1.6)]";
|
|
27
|
+
declare const TEXTAREA_MIN_HEIGHT = "zui:min-h-[calc(var(--zui-scale,10px)*7.68)]";
|
|
28
|
+
declare const TABLE_HEADER_HEIGHT = "zui:h-[calc(var(--zui-scale,10px)*5.6)]";
|
|
29
|
+
declare const TABLE_TEXT_SIZE = "zui:text-[calc(var(--zui-scale,10px)*1.4)]";
|
|
30
|
+
declare const DATEPICKER_DAY_SIZE = "zui:size-[calc(var(--zui-scale,10px)*3.2)]";
|
|
31
|
+
declare const DATEPICKER_NAV_SIZE = "zui:size-[calc(var(--zui-scale,10px)*2.8)]";
|
|
32
|
+
declare const DATEPICKER_CONTROL_HEIGHT = "zui:h-[calc(var(--zui-scale,10px)*3.2)]";
|
|
33
|
+
declare const OVERLAY_PANEL_PADDING = "zui:p-[calc(var(--zui-scale,10px)*2.4)]";
|
|
34
|
+
declare const TOAST_PADDING = "zui:p-[calc(var(--zui-scale,10px)*1.6)]";
|
|
35
|
+
declare const DATEPICKER_MANUAL_SEGMENT_WIDTH = "zui:w-[calc(var(--zui-scale,10px)*10.4)]";
|
|
36
|
+
declare const SQUARE_ICON_BUTTON_SIZE_IMPORTANT = "zui:[&>button]:!h-[calc(var(--zui-scale,10px)*4.608)] zui:[&>button]:!w-[calc(var(--zui-scale,10px)*4.608)]";
|
|
33
37
|
export { controlHeightBySize, CONTROL_HEIGHT_SM, CONTROL_HEIGHT_DEFAULT, CONTROL_HEIGHT_LG, CONTROL_PADDING_X, CONTROL_PADDING_Y, BUTTON_PADDING_X, TEXTAREA_MIN_HEIGHT, TABLE_HEADER_HEIGHT, TABLE_TEXT_SIZE, DATEPICKER_DAY_SIZE, DATEPICKER_NAV_SIZE, DATEPICKER_CONTROL_HEIGHT, OVERLAY_PANEL_PADDING, TOAST_PADDING, DATEPICKER_MANUAL_SEGMENT_WIDTH, SQUARE_ICON_BUTTON_SIZE_IMPORTANT, };
|