qstd 0.3.10 → 0.3.12
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/dist/block/fns.d.ts +28 -0
- package/dist/block/fns.d.ts.map +1 -1
- package/dist/block/input.d.ts +21 -0
- package/dist/block/input.d.ts.map +1 -1
- package/dist/react/index.cjs +14 -7
- package/dist/react/index.js +14 -7
- package/package.json +1 -1
package/dist/block/fns.d.ts
CHANGED
|
@@ -1312,5 +1312,33 @@ export declare const getIcons: (extract: ReturnType<typeof extractElType>, anyPr
|
|
|
1312
1312
|
rightIcon: string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
1313
1313
|
};
|
|
1314
1314
|
export declare const omit: <T extends object>(obj: T, keys: readonly string[]) => Partial<T>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Merges default style props with consumer props, ensuring consumer values override defaults.
|
|
1317
|
+
*
|
|
1318
|
+
* This solves the PandaCSS atomic class collision problem where both default and consumer
|
|
1319
|
+
* conditional styles (like _hover, _labelLifted) would generate separate classes with
|
|
1320
|
+
* identical specificity, causing unpredictable cascade behavior.
|
|
1321
|
+
*
|
|
1322
|
+
* @param defaults - Default style props for the component
|
|
1323
|
+
* @param props - All props passed to the component
|
|
1324
|
+
* @param nonStyleKeys - Keys that are NOT style props (children, event handlers, etc.)
|
|
1325
|
+
* @returns Merged props with defaults applied, consumer overrides winning
|
|
1326
|
+
*
|
|
1327
|
+
* @example
|
|
1328
|
+
* const defaults = {
|
|
1329
|
+
* bg: "white",
|
|
1330
|
+
* _hover: { bg: "gray.100" },
|
|
1331
|
+
* _labelLifted: { top: "-10px", bg: "input-label-bg" }
|
|
1332
|
+
* };
|
|
1333
|
+
*
|
|
1334
|
+
* const { children, onClick, ...merged } = mergeStyleDefaults(
|
|
1335
|
+
* defaults,
|
|
1336
|
+
* props,
|
|
1337
|
+
* ["children", "onClick", "value"]
|
|
1338
|
+
* );
|
|
1339
|
+
*
|
|
1340
|
+
* return <Base {...merged}>{children}</Base>;
|
|
1341
|
+
*/
|
|
1342
|
+
export declare function mergeStyleDefaults<T extends Record<string, unknown>, K extends keyof T>(defaults: Record<string, unknown>, props: T, nonStyleKeys: readonly K[]): T;
|
|
1315
1343
|
export {};
|
|
1316
1344
|
//# sourceMappingURL=fns.d.ts.map
|
package/dist/block/fns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../src/block/fns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAMlE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,KAAK,kBAAkB,GAAG,EAAE,CAAC,gBAAgB,GAC3C,EAAE,CAAC,YAAY,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAW1B;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,GAAG,IAAI,uBAsC3C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,GAAG,IAAI,uBA6BjD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,GAAG,IAAI,kBAsB3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAU,CAAC,SAAS,IAAI,EAAE,eAAe,IAAI,EAAE,iBA4BvE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,MAAM,EACxD,UAAU,KAAK,CAAC,SAAS,EACzB,aAAa,MAAM,KAClB,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,SAW1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,IAAI,EAAE,CAAC,EAA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AQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAmB5E"}
|
package/dist/block/input.d.ts
CHANGED
|
@@ -15,6 +15,27 @@ export declare function RightSide(props: _t.BaseBlockProps & {
|
|
|
15
15
|
export declare namespace RightSide {
|
|
16
16
|
var displayName: string;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Floating label for Input component.
|
|
20
|
+
*
|
|
21
|
+
* Style defaults can be overridden by passing the same props.
|
|
22
|
+
* For `_labelLifted`, partial overrides are merged with defaults.
|
|
23
|
+
*
|
|
24
|
+
* **`bg` cascades to lifted state:** If you set `bg`, it applies to both
|
|
25
|
+
* default and lifted states. Only specify `_labelLifted.bg` if you want
|
|
26
|
+
* a different background when lifted.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // bg applies to both states
|
|
30
|
+
* <Block.Input.Label bg={{ base: "white", _dark: "gray.900" }}>
|
|
31
|
+
* Email
|
|
32
|
+
* </Block.Input.Label>
|
|
33
|
+
*
|
|
34
|
+
* // Different lifted bg
|
|
35
|
+
* <Block.Input.Label bg="white" _labelLifted={{ bg: "blue.50" }}>
|
|
36
|
+
* Email
|
|
37
|
+
* </Block.Input.Label>
|
|
38
|
+
*/
|
|
18
39
|
export declare function Label(props: Omit<_t.InputBlockProps, "is"> & LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
40
|
export declare namespace Label {
|
|
20
41
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/block/input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAU9B,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAA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
|
@@ -2232,11 +2232,21 @@ function Label2(props) {
|
|
|
2232
2232
|
required,
|
|
2233
2233
|
children,
|
|
2234
2234
|
hasLeftIcon,
|
|
2235
|
+
bg: consumerBg,
|
|
2236
|
+
_labelLifted: consumerLabelLifted,
|
|
2235
2237
|
onAnimationStart: _onAnimationStart,
|
|
2236
2238
|
onAnimationComplete: _onAnimationComplete,
|
|
2237
2239
|
...rest
|
|
2238
2240
|
} = props;
|
|
2239
2241
|
const ml = hasLeftIcon ? 6 : 1;
|
|
2242
|
+
const defaultLabelLifted = {
|
|
2243
|
+
transformOrigin: "top left",
|
|
2244
|
+
transform: "scale(0.8)",
|
|
2245
|
+
top: "-10px",
|
|
2246
|
+
ml,
|
|
2247
|
+
color: error ? "text-alert" : value ? "input-label-color-lifted" : "input-label-color",
|
|
2248
|
+
bg: consumerBg ?? "input-label-bg"
|
|
2249
|
+
};
|
|
2240
2250
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2241
2251
|
Base4,
|
|
2242
2252
|
{
|
|
@@ -2254,15 +2264,12 @@ function Label2(props) {
|
|
|
2254
2264
|
br: 8,
|
|
2255
2265
|
color: error ? "text-alert" : "input-label-color",
|
|
2256
2266
|
lineHeight: 1.1,
|
|
2267
|
+
bg: consumerBg,
|
|
2268
|
+
...rest,
|
|
2257
2269
|
_labelLifted: {
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
top: "-10px",
|
|
2261
|
-
ml,
|
|
2262
|
-
color: error ? "text-alert" : value ? "input-label-color-lifted" : "input-label-color",
|
|
2263
|
-
bg: "input-label-bg"
|
|
2270
|
+
...defaultLabelLifted,
|
|
2271
|
+
...consumerLabelLifted
|
|
2264
2272
|
},
|
|
2265
|
-
...rest,
|
|
2266
2273
|
children: [
|
|
2267
2274
|
children,
|
|
2268
2275
|
required && "*"
|
package/dist/react/index.js
CHANGED
|
@@ -2209,11 +2209,21 @@ function Label2(props) {
|
|
|
2209
2209
|
required,
|
|
2210
2210
|
children,
|
|
2211
2211
|
hasLeftIcon,
|
|
2212
|
+
bg: consumerBg,
|
|
2213
|
+
_labelLifted: consumerLabelLifted,
|
|
2212
2214
|
onAnimationStart: _onAnimationStart,
|
|
2213
2215
|
onAnimationComplete: _onAnimationComplete,
|
|
2214
2216
|
...rest
|
|
2215
2217
|
} = props;
|
|
2216
2218
|
const ml = hasLeftIcon ? 6 : 1;
|
|
2219
|
+
const defaultLabelLifted = {
|
|
2220
|
+
transformOrigin: "top left",
|
|
2221
|
+
transform: "scale(0.8)",
|
|
2222
|
+
top: "-10px",
|
|
2223
|
+
ml,
|
|
2224
|
+
color: error ? "text-alert" : value ? "input-label-color-lifted" : "input-label-color",
|
|
2225
|
+
bg: consumerBg ?? "input-label-bg"
|
|
2226
|
+
};
|
|
2217
2227
|
return /* @__PURE__ */ jsxs(
|
|
2218
2228
|
Base4,
|
|
2219
2229
|
{
|
|
@@ -2231,15 +2241,12 @@ function Label2(props) {
|
|
|
2231
2241
|
br: 8,
|
|
2232
2242
|
color: error ? "text-alert" : "input-label-color",
|
|
2233
2243
|
lineHeight: 1.1,
|
|
2244
|
+
bg: consumerBg,
|
|
2245
|
+
...rest,
|
|
2234
2246
|
_labelLifted: {
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
top: "-10px",
|
|
2238
|
-
ml,
|
|
2239
|
-
color: error ? "text-alert" : value ? "input-label-color-lifted" : "input-label-color",
|
|
2240
|
-
bg: "input-label-bg"
|
|
2247
|
+
...defaultLabelLifted,
|
|
2248
|
+
...consumerLabelLifted
|
|
2241
2249
|
},
|
|
2242
|
-
...rest,
|
|
2243
2250
|
children: [
|
|
2244
2251
|
children,
|
|
2245
2252
|
required && "*"
|