silva-ui 1.1.0 → 1.2.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.
@@ -0,0 +1,24 @@
1
+ import { themeColors } from './theme.css';
2
+ /** A theme token or any valid CSS colour value. */
3
+ export type GradientColor = keyof typeof themeColors | (string & {});
4
+ /**
5
+ * A theme-aware CSS gradient.
6
+ *
7
+ * Colour names resolve against Silva UI's theme contract, so values such as
8
+ * `primary`, `violet9`, and `background` automatically follow a nested Theme.
9
+ * Any valid CSS colour is also accepted for one-off brand work.
10
+ */
11
+ export interface Gradient {
12
+ /** First gradient stop. */
13
+ from: GradientColor;
14
+ /** Final gradient stop. */
15
+ to: GradientColor;
16
+ /** Optional middle stop. */
17
+ via?: GradientColor;
18
+ /** CSS gradient function. Defaults to `linear`. */
19
+ type?: 'linear' | 'radial' | 'conic';
20
+ /** Direction in degrees for linear and conic gradients. Defaults to 90. */
21
+ deg?: number;
22
+ }
23
+ /** Creates a CSS `background-image` value from a theme-aware gradient. */
24
+ export declare function gradientToCss({ from, to, via, type, deg, }: Gradient): string;
@@ -1,6 +1,8 @@
1
1
  export { sprinkles, tokens } from './core/sprinkles.css';
2
2
  export type { Sprinkles } from './core/sprinkles.css';
3
3
  export { cls, splitSprinklesProps, toSprinklesClass } from './core/utils';
4
+ export { gradientToCss } from './core/gradient';
5
+ export type { Gradient, GradientColor } from './core/gradient';
4
6
  export type { BaseProps, ComponentSize } from './core/types';
5
7
  export { gradients, animations } from './core/visuals.css';
6
8
  export type { GradientName, AnimationName } from './core/visuals.css';
@@ -1,7 +1,10 @@
1
+ import { type Gradient } from '../core/gradient';
1
2
  import type { BaseProps } from '../core/types';
2
3
  export interface BoxProps extends BaseProps {
3
4
  /** Rendered HTML element. Defaults to 'div'. */
4
5
  as?: string;
6
+ /** Theme-aware background gradient. Takes precedence over `bg`. */
7
+ gradient?: Gradient;
5
8
  }
6
9
  /**
7
10
  * Box — the foundational layout primitive.
@@ -16,4 +19,4 @@ export interface BoxProps extends BaseProps {
16
19
  * </Box>
17
20
  * ```
18
21
  */
19
- export declare function Box({ as: Tag, class: extraClass, children, ...rest }: BoxProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
22
+ export declare function Box({ as: Tag, class: extraClass, gradient, style: inlineStyle, children, ...rest }: BoxProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
1
  {
2
- "name": "silva-ui",
3
- "version": "1.1.0",
4
- "description": "A Hono JSX UI component library with framework-neutral styling and Tamagui-inspired theming.",
5
- "main": "./dist/library/silva-ui.js",
6
- "module": "./dist/library/silva-ui.js",
7
- "types": "./dist/types/index.d.ts",
8
- "style": "./dist/library/silva-ui.css",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/types/index.d.ts",
12
- "import": "./dist/library/silva-ui.js",
13
- "default": "./dist/library/silva-ui.js"
14
- },
15
- "./style.css": {
16
- "types": "./style.css.d.ts",
17
- "default": "./dist/library/silva-ui.css"
18
- }
19
- },
20
- "sideEffects": [
21
- "**/*.css"
22
- ],
23
- "files": [
24
- "dist/library",
25
- "dist/types",
26
- "style.css.d.ts",
27
- "README.md",
28
- "LICENSE"
29
- ],
30
- "scripts": {
31
- "dev": "vite",
32
- "build": "vite build",
33
- "build:library": "vite build --config vite.library.config.ts",
34
- "build:types": "tsc -p tsconfig.types.json",
35
- "build:package": "npm run build:library && npm run build:types",
36
- "profile:library": "vite build --config vite.library.config.ts --profile",
37
- "pack:check": "npm run build:package && npm pack --dry-run",
38
- "preview": "vite preview",
39
- "typecheck": "tsc --noEmit"
40
- },
41
- "keywords": [
42
- "ui",
43
- "ui-components",
44
- "component-library",
45
- "design-system",
46
- "hono",
47
- "hono-jsx",
48
- "jsx",
49
- "typescript",
50
- "vanilla-extract",
51
- "sprinkles",
52
- "theming",
53
- "accessible"
54
- ],
55
- "author": "BlackSilva",
56
- "license": "MIT",
57
- "type": "module",
58
- "peerDependencies": {
59
- "hono": "^4.13.13"
60
- },
61
- "devDependencies": {
62
- "@vanilla-extract/vite-plugin": "^5.2.6",
63
- "@vanilla-extract/css": "^1.21.3",
64
- "@vanilla-extract/sprinkles": "^1.7.1",
65
- "hono": "^4.13.13",
66
- "typescript": "^7.0.2",
67
- "vite": "^8.3.4"
68
- },
69
- "repository": {
70
- "type": "git",
71
- "url": "git+https://github.com/black-silva/silva-ui.git"
72
- }
2
+ "name": "silva-ui",
3
+ "version": "1.2.0",
4
+ "description": "A Hono JSX UI component library with framework-neutral styling and Tamagui-inspired theming.",
5
+ "main": "./dist/library/silva-ui.js",
6
+ "module": "./dist/library/silva-ui.js",
7
+ "types": "./dist/types/index.d.ts",
8
+ "style": "./dist/library/silva-ui.css",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "import": "./dist/library/silva-ui.js",
13
+ "default": "./dist/library/silva-ui.js"
14
+ },
15
+ "./style.css": {
16
+ "types": "./style.css.d.ts",
17
+ "default": "./dist/library/silva-ui.css"
18
+ }
19
+ },
20
+ "sideEffects": [
21
+ "**/*.css"
22
+ ],
23
+ "files": [
24
+ "dist/library",
25
+ "dist/types",
26
+ "style.css.d.ts",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "scripts": {
31
+ "dev": "vite",
32
+ "build": "vite build",
33
+ "build:library": "vite build --config vite.library.config.ts",
34
+ "build:types": "tsc -p tsconfig.types.json",
35
+ "build:package": "npm run build:library && npm run build:types",
36
+ "profile:library": "vite build --config vite.library.config.ts --profile",
37
+ "pack:check": "npm run build:package && npm pack --dry-run",
38
+ "preview": "vite preview",
39
+ "typecheck": "tsc --noEmit"
40
+ },
41
+ "keywords": [
42
+ "ui",
43
+ "ui-components",
44
+ "component-library",
45
+ "design-system",
46
+ "hono",
47
+ "hono-jsx",
48
+ "jsx",
49
+ "typescript",
50
+ "vanilla-extract",
51
+ "sprinkles",
52
+ "theming",
53
+ "accessible"
54
+ ],
55
+ "author": "BlackSilva",
56
+ "license": "MIT",
57
+ "type": "module",
58
+ "peerDependencies": {
59
+ "hono": "^4.13.13"
60
+ },
61
+ "devDependencies": {
62
+ "@vanilla-extract/vite-plugin": "^5.2.6",
63
+ "@vanilla-extract/css": "^1.21.3",
64
+ "@vanilla-extract/sprinkles": "^1.7.1",
65
+ "hono": "^4.13.13",
66
+ "typescript": "^7.0.2",
67
+ "vite": "^8.3.4"
68
+ },
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "git+https://github.com/black-silva/silva-ui.git"
72
+ }
73
73
  }