@techsio/ui-kit 0.56.0 → 0.57.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 +30 -0
- package/dist/atoms/button.js +1 -1
- package/dist/atoms/checkbox.js +1 -1
- package/dist/atoms/input.js +2 -2
- package/dist/molecules/form-checkbox.js +1 -1
- package/dist/molecules/form-input.js +8 -2
- package/dist/src/atoms/button.d.ts +1 -1
- package/dist/src/atoms/checkbox.d.ts +1 -1
- package/dist/src/atoms/input.d.ts +1 -1
- package/dist/src/molecules/form-input.d.ts +2 -2
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -0
- package/package.json +1 -1
- package/src/tokens/components/atoms/_button.css +3 -0
- package/src/tokens/components/atoms/_input.css +4 -0
package/README.md
CHANGED
|
@@ -104,6 +104,36 @@ Our CSS token files use Tailwind’s `@theme` block to generate CSS variables, e
|
|
|
104
104
|
|
|
105
105
|
---
|
|
106
106
|
|
|
107
|
+
### Component font-weight overrides
|
|
108
|
+
|
|
109
|
+
Button and LinkButton use `--font-weight-button`, defaulting to
|
|
110
|
+
`var(--font-weight-medium)`. Input uses `--font-weight-input` and
|
|
111
|
+
`--font-weight-input-placeholder`, both defaulting independently to
|
|
112
|
+
`var(--font-weight-normal)`. FormInput and NumericInput inherit the Input
|
|
113
|
+
tokens. Changing the input weight does not change the placeholder weight.
|
|
114
|
+
|
|
115
|
+
Override component tokens in the scope that needs them:
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
.order-form {
|
|
119
|
+
--font-weight-button: var(--font-weight-bold);
|
|
120
|
+
--font-weight-input: var(--font-weight-medium);
|
|
121
|
+
--font-weight-input-placeholder: var(--font-weight-normal);
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Migration: CSS aliases resolve at their declaration scope. Global overrides
|
|
126
|
+
of the referenced primitive at the root still work. A descendant scope that
|
|
127
|
+
previously changed only `--font-weight-medium` or `--font-weight-normal` must
|
|
128
|
+
now set the corresponding component token there. Other medium/normal text is
|
|
129
|
+
unaffected by component token overrides. Explicit input/button weight classes
|
|
130
|
+
continue to override the component default.
|
|
131
|
+
|
|
132
|
+
These aliases are currently code-owned in `_button.css` and `_input.css`.
|
|
133
|
+
When Figma exports the aliases, transfer ownership through the export pipeline
|
|
134
|
+
and remove the duplicate bridge declarations. Do not edit generated
|
|
135
|
+
`tokens/figma/variables.css` by hand.
|
|
136
|
+
|
|
107
137
|
## 5. Development Guidelines
|
|
108
138
|
|
|
109
139
|
### Component Development
|
package/dist/atoms/button.js
CHANGED
|
@@ -5,7 +5,7 @@ const buttonVariants = tv({
|
|
|
5
5
|
base: [
|
|
6
6
|
"relative",
|
|
7
7
|
"inline-flex cursor-pointer items-center justify-center",
|
|
8
|
-
"font-
|
|
8
|
+
"font-button",
|
|
9
9
|
"transition duration-200 motion-reduce:transition-none",
|
|
10
10
|
"motion-safe:not-disabled:active:scale-97",
|
|
11
11
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
package/dist/atoms/checkbox.js
CHANGED
|
@@ -4,7 +4,7 @@ const checkboxVariants = tv({
|
|
|
4
4
|
base: [
|
|
5
5
|
"relative shrink-0 cursor-pointer appearance-none",
|
|
6
6
|
"size-checkbox",
|
|
7
|
-
"rounded-checkbox border
|
|
7
|
+
"border-(length:--border-width-checkbox) rounded-checkbox border-checkbox-border-base",
|
|
8
8
|
"bg-checkbox-bg-base",
|
|
9
9
|
"after:-translate-1/2 after:absolute after:top-1/2 after:left-1/2",
|
|
10
10
|
"checked:bg-checkbox-bg-checked",
|
package/dist/atoms/input.js
CHANGED
|
@@ -3,10 +3,10 @@ import { tv } from "../utils.js";
|
|
|
3
3
|
const inputVariants = tv({
|
|
4
4
|
base: [
|
|
5
5
|
"block w-full",
|
|
6
|
-
"font-
|
|
6
|
+
"font-input",
|
|
7
7
|
"bg-input-bg-base",
|
|
8
8
|
"text-input-fg",
|
|
9
|
-
"placeholder:font-
|
|
9
|
+
"placeholder:font-input-placeholder",
|
|
10
10
|
"placeholder:text-input-fg-placeholder",
|
|
11
11
|
"border-(length:--border-width-input) border-input-border-base",
|
|
12
12
|
"rounded-input",
|
|
@@ -10,7 +10,7 @@ const checkboxVariants = tv({
|
|
|
10
10
|
control: [
|
|
11
11
|
"relative shrink-0 cursor-pointer",
|
|
12
12
|
"size-checkbox",
|
|
13
|
-
"rounded-checkbox border
|
|
13
|
+
"border-(length:--border-width-checkbox) rounded-checkbox border-checkbox-border-base",
|
|
14
14
|
"bg-checkbox-bg-base",
|
|
15
15
|
"flex items-center justify-center",
|
|
16
16
|
"transition duration-200 motion-reduce:transition-none",
|
|
@@ -3,7 +3,11 @@ import { useId } from "react";
|
|
|
3
3
|
import { Input } from "../atoms/input.js";
|
|
4
4
|
import { Label } from "../atoms/label.js";
|
|
5
5
|
import { StatusText } from "../atoms/status-text.js";
|
|
6
|
-
|
|
6
|
+
import { tv } from "../utils.js";
|
|
7
|
+
const formInputVariants = tv({
|
|
8
|
+
base: "p-input-sm md:p-input-md"
|
|
9
|
+
});
|
|
10
|
+
function FormInputRaw({ id, label, validateStatus = "default", helpText, size = "md", required, disabled, className, ...props }) {
|
|
7
11
|
const generatedId = useId();
|
|
8
12
|
const controlId = id || generatedId;
|
|
9
13
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -23,7 +27,9 @@ function FormInputRaw({ id, label, validateStatus = "default", helpText, size =
|
|
|
23
27
|
size: size,
|
|
24
28
|
variant: validateStatus,
|
|
25
29
|
...props,
|
|
26
|
-
className:
|
|
30
|
+
className: formInputVariants({
|
|
31
|
+
className
|
|
32
|
+
})
|
|
27
33
|
}),
|
|
28
34
|
helpText
|
|
29
35
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* FormInput — @techsio/ui-kit molecule.
|
|
3
3
|
*
|
|
4
4
|
* @component FormInput
|
|
5
|
-
* @componentVersion v1.1.
|
|
5
|
+
* @componentVersion v1.1.2
|
|
6
6
|
* @skill form-input-usage
|
|
7
7
|
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
8
|
*
|
|
@@ -19,7 +19,7 @@ type FormInputRawProps = InputProps & {
|
|
|
19
19
|
validateStatus?: ValidateStatus;
|
|
20
20
|
helpText?: ReactNode;
|
|
21
21
|
};
|
|
22
|
-
export declare function FormInputRaw({ id, label, validateStatus, helpText, size, required, disabled, ...props }: FormInputRawProps): import("react").JSX.Element;
|
|
22
|
+
export declare function FormInputRaw({ id, label, validateStatus, helpText, size, required, disabled, className, ...props }: FormInputRawProps): import("react").JSX.Element;
|
|
23
23
|
type FormInputProps = FormInputRawProps & {
|
|
24
24
|
showHelpTextIcon?: boolean;
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-input.d.ts","sourceRoot":"","sources":["../../../src/molecules/form-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"form-input.d.ts","sourceRoot":"","sources":["../../../src/molecules/form-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AASvD,KAAK,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AAEjE,KAAK,iBAAiB,GAAG,UAAU,GAAG;IACpC,uEAAuE;IACvE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,SAAS,CAAA;IAChB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,cAA0B,EAC1B,QAAQ,EACR,IAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,+BA4BnB;AAED,KAAK,cAAc,GAAG,iBAAiB,GAAG;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,EAAE,EACF,cAA0B,EAC1B,gBAA+C,EAC/C,IAAW,EACX,kBAAkB,EAAE,eAAe,EACnC,cAAc,EAAE,WAAW,EAC3B,GAAG,KAAK,EACT,EAAE,cAAc,+BA6BhB"}
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAA;AAU3C,eAAO,MAAM,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAA;AAU3C,eAAO,MAAM,EAAE,EAAE,EAUf,CAAA;AAEF,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,UASlC"}
|
package/dist/utils.js
CHANGED
|
@@ -10,6 +10,22 @@ const tv = createTV({
|
|
|
10
10
|
theme: {
|
|
11
11
|
text: [
|
|
12
12
|
(value)=>TEXT_SIZE_REGEX.test(value)
|
|
13
|
+
],
|
|
14
|
+
"font-weight": [
|
|
15
|
+
"button",
|
|
16
|
+
"input",
|
|
17
|
+
"input-placeholder"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
classGroups: {
|
|
21
|
+
p: [
|
|
22
|
+
{
|
|
23
|
+
p: [
|
|
24
|
+
"input-sm",
|
|
25
|
+
"input-md",
|
|
26
|
+
"input-lg"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
13
29
|
]
|
|
14
30
|
}
|
|
15
31
|
}
|
package/package.json
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
* axes; this bridge composes them so the existing utility name keeps
|
|
8
8
|
* working without per-axis class churn.
|
|
9
9
|
* - The `token-icon-button-spinner` semantic icon alias.
|
|
10
|
+
* - `--font-weight-button` (also used by LinkButton). Code-owned until
|
|
11
|
+
* the shared Figma library exports the same alias.
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
@theme static {
|
|
15
|
+
--font-weight-button: var(--font-weight-medium);
|
|
13
16
|
--padding-button-sm: var(--padding-button-y-sm) var(--padding-button-x-sm);
|
|
14
17
|
--padding-button-md: var(--padding-button-y-md) var(--padding-button-x-md);
|
|
15
18
|
--padding-button-lg: var(--padding-button-y-lg) var(--padding-button-x-lg);
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
* This file only declares what Figma does not export:
|
|
5
5
|
* - `--spacing-form-field-gap` — used by the FormField molecule to space
|
|
6
6
|
* label, control, and helper text.
|
|
7
|
+
* - `--font-weight-input` and `--font-weight-input-placeholder`.
|
|
8
|
+
* Code-owned until the shared Figma library exports the same aliases.
|
|
7
9
|
*
|
|
8
10
|
* Color, border-width, padding, radius, text, ring, validation, and the
|
|
9
11
|
* `--padding-input-with-button*` family are all owned by Figma.
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
@theme static {
|
|
15
|
+
--font-weight-input: var(--font-weight-normal);
|
|
16
|
+
--font-weight-input-placeholder: var(--font-weight-normal);
|
|
13
17
|
--spacing-form-field-gap: var(--spacing-form-field);
|
|
14
18
|
}
|