@simplysm/solid 13.0.98 → 13.0.100

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/docs/styles.md CHANGED
@@ -1,127 +1,133 @@
1
- # Styles + Directives
1
+ # Styles & Directives
2
2
 
3
- Source: `src/styles/*.ts`, `src/directives/*.ts`
3
+ Source: `src/styles/**`, `src/directives/**`
4
4
 
5
- ## Base Styles
5
+ ## Base Styles (`base.styles`)
6
6
 
7
- Source: `src/styles/base.styles.ts`
7
+ Foundational design tokens for borders, backgrounds, and text.
8
8
 
9
- Design tokens for borders, backgrounds, and text.
10
-
11
- ```ts
12
- const border = {
13
- default: "border-base-200 dark:border-base-700",
14
- subtle: "border-base-200 dark:border-base-700",
9
+ ```typescript
10
+ export const border: {
11
+ default: string; // border-base-200 dark:border-base-700
12
+ subtle: string; // border-base-200 dark:border-base-700
15
13
  };
16
14
 
17
- const bg = {
18
- surface: "bg-white dark:bg-base-900",
19
- muted: "bg-base-100 dark:bg-base-800",
20
- subtle: "bg-base-200 dark:bg-base-700",
15
+ export const bg: {
16
+ surface: string; // bg-white dark:bg-base-900
17
+ muted: string; // bg-base-100 dark:bg-base-800
18
+ subtle: string; // bg-base-200 dark:bg-base-700
21
19
  };
22
20
 
23
- const text = {
24
- default: "text-base-900 dark:text-base-100",
25
- muted: "text-base-400 dark:text-base-500",
26
- placeholder: "placeholder:text-base-400 dark:placeholder:text-base-500",
21
+ export const text: {
22
+ default: string; // text-base-900 dark:text-base-100
23
+ muted: string; // text-base-400 dark:text-base-500
24
+ placeholder: string; // placeholder:text-base-400 dark:placeholder:text-base-500
27
25
  };
28
26
  ```
29
27
 
30
- ## Control Styles
28
+ ---
31
29
 
32
- Source: `src/styles/control.styles.ts`
30
+ ## Control Styles (`control.styles`)
33
31
 
34
- Tokens for interactive component sizing, padding, gaps, and states.
32
+ Size and state tokens for interactive components.
35
33
 
36
- ```ts
37
- const state = {
38
- disabled: "pointer-events-none cursor-default opacity-30",
39
- };
34
+ ### `ComponentSize`
40
35
 
41
- type ComponentSize = "xs" | "sm" | "md" | "lg" | "xl";
36
+ ```typescript
37
+ export type ComponentSize = "xs" | "sm" | "md" | "lg" | "xl";
38
+ ```
42
39
 
43
- const pad: Record<ComponentSize | string, string> = {
44
- md: "px-2 py-1",
45
- xs: "px-1 py-0",
46
- sm: "px-1.5 py-0.5",
47
- lg: "px-3 py-2",
48
- xl: "px-4 py-3",
49
- };
40
+ ### `state`
50
41
 
51
- const gap: Record<ComponentSize | string, string> = {
52
- md: "gap-1",
53
- xs: "gap-0",
54
- sm: "gap-0.5",
55
- lg: "gap-1.5",
56
- xl: "gap-2",
42
+ ```typescript
43
+ export const state: {
44
+ disabled: string; // pointer-events-none cursor-default opacity-30
57
45
  };
58
46
  ```
59
47
 
60
- ## Theme Styles
48
+ ### `pad`
61
49
 
62
- Source: `src/styles/theme.styles.ts`
50
+ Size-specific padding classes:
63
51
 
64
- Semantic color tokens for six themes: `primary`, `info`, `success`, `warning`, `danger`, `base`.
52
+ | Size | Value |
53
+ |------|-------|
54
+ | `xs` | `px-1 py-0` |
55
+ | `sm` | `px-1.5 py-0.5` |
56
+ | `md` | `px-2 py-1` |
57
+ | `lg` | `px-3 py-2` |
58
+ | `xl` | `px-4 py-3` |
65
59
 
66
- ```ts
67
- type SemanticTheme = "primary" | "info" | "success" | "warning" | "danger" | "base";
60
+ ### `gap`
68
61
 
69
- const themeTokens: Record<SemanticTheme, {
70
- solid: string; // solid background + white text
71
- solidHover: string; // hover state for solid
72
- light: string; // light background + dark text
73
- text: string; // text color only
74
- hoverBg: string; // hover background
75
- border: string; // border color
76
- }>;
77
- ```
62
+ Size-specific gap classes:
63
+
64
+ | Size | Value |
65
+ |------|-------|
66
+ | `xs` | `gap-0` |
67
+ | `sm` | `gap-0.5` |
68
+ | `md` | `gap-1` |
69
+ | `lg` | `gap-1.5` |
70
+ | `xl` | `gap-2` |
71
+
72
+ ---
78
73
 
79
- Each theme provides six variants:
74
+ ## Theme Styles (`theme.styles`)
80
75
 
81
- | Variant | Usage |
82
- |---------|-------|
83
- | `solid` | Tag, Button(solid), Progress bar fill |
84
- | `solidHover` | Button(solid) hover state |
85
- | `light` | Alert background |
86
- | `text` | Link color, Tab selected |
87
- | `hoverBg` | Button(ghost) hover, List item hover |
88
- | `border` | Button(outline) border |
76
+ Semantic color theme tokens for components.
89
77
 
90
- Example values for `primary`:
78
+ ### `SemanticTheme`
79
+
80
+ ```typescript
81
+ export type SemanticTheme = "primary" | "info" | "success" | "warning" | "danger" | "base";
91
82
  ```
92
- solid: "bg-primary-500 text-white"
93
- solidHover: "hover:bg-primary-600 dark:hover:bg-primary-400"
94
- light: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-100"
95
- text: "text-primary-600 dark:text-primary-400"
96
- hoverBg: "hover:bg-primary-100 dark:hover:bg-primary-800/30"
97
- border: "border-primary-300 dark:border-primary-600"
83
+
84
+ ### `themeTokens`
85
+
86
+ ```typescript
87
+ export const themeTokens: Record<SemanticTheme, {
88
+ solid: string; // Solid background + white text
89
+ solidHover: string; // Hover effect for solid
90
+ light: string; // Light background + dark text
91
+ text: string; // Text color only
92
+ hoverBg: string; // Hover background
93
+ border: string; // Border color
94
+ }>;
98
95
  ```
99
96
 
100
- ## Directives
97
+ Each theme (`primary`, `info`, `success`, `warning`, `danger`, `base`) provides all six token fields.
101
98
 
102
- ### ripple
99
+ ---
103
100
 
104
- Directive that adds a material-design-style ripple effect on pointer down.
101
+ ## Ripple Directive (`ripple`)
105
102
 
106
- ```ts
107
- function ripple(el: HTMLElement, accessor: Accessor<boolean>): void;
103
+ Directive that adds a material-design ripple effect to interactive elements.
104
+
105
+ ```typescript
106
+ export function ripple(el: HTMLElement, accessor: Accessor<boolean>): void;
108
107
  ```
109
108
 
110
- Usage in TSX:
109
+ ### Usage
111
110
 
112
111
  ```tsx
113
112
  <button use:ripple={!props.disabled}>Click me</button>
114
113
  ```
115
114
 
116
- Behavior:
117
- - Creates an internal ripple container with `overflow: hidden`.
118
- - Changes element position to `relative` if it is `static` (restored on cleanup).
119
- - Single ripple mode: removes previous ripple on new click.
120
- - Respects `prefers-reduced-motion: reduce`.
121
- - Ripple radius based on distance from click point to farthest corner.
115
+ ### Behavior
122
116
 
123
- To use the directive, import and void it at the top of your file:
124
- ```tsx
125
- import { ripple } from "@simplysm/solid";
126
- void ripple;
117
+ - Creates an internal ripple container with `overflow: hidden`
118
+ - Sets `position: relative` on static-positioned elements (restores on cleanup)
119
+ - Single ripple mode: removes previous ripple on new click
120
+ - Respects `prefers-reduced-motion: reduce`
121
+ - Full cleanup on unmount
122
+
123
+ ### TypeScript Declaration
124
+
125
+ ```typescript
126
+ declare module "solid-js" {
127
+ namespace JSX {
128
+ interface Directives {
129
+ ripple: boolean;
130
+ }
131
+ }
132
+ }
127
133
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/solid",
3
- "version": "13.0.98",
3
+ "version": "13.0.100",
4
4
  "description": "Simplysm package - SolidJS library",
5
5
  "author": "simplysm",
6
6
  "license": "Apache-2.0",
@@ -53,10 +53,10 @@
53
53
  "tabbable": "^6.4.0",
54
54
  "tailwind-merge": "^3.5.0",
55
55
  "tailwindcss": "^3.4.19",
56
- "@simplysm/core-browser": "13.0.98",
57
- "@simplysm/core-common": "13.0.98",
58
- "@simplysm/service-common": "13.0.98",
59
- "@simplysm/service-client": "13.0.98"
56
+ "@simplysm/core-browser": "13.0.100",
57
+ "@simplysm/core-common": "13.0.100",
58
+ "@simplysm/service-client": "13.0.100",
59
+ "@simplysm/service-common": "13.0.100"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@solidjs/testing-library": "^0.8.10"