@knitui/components 1.2.1 → 1.3.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/lib/commonjs/Avatar/Avatar.js +32 -10
- package/lib/commonjs/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/Input/shared.js +10 -1
- package/lib/commonjs/Input/shared.js.map +1 -1
- package/lib/commonjs/InputBase/InputBase.js +22 -1
- package/lib/commonjs/InputBase/InputBase.js.map +1 -1
- package/lib/commonjs/Modal/index.js +18 -0
- package/lib/commonjs/Modal/index.js.map +1 -1
- package/lib/commonjs/Modal/modal-base.js +20 -15
- package/lib/commonjs/Modal/modal-base.js.map +1 -1
- package/lib/commonjs/Modal/modal-stack.js +87 -0
- package/lib/commonjs/Modal/modal-stack.js.map +1 -0
- package/lib/commonjs/Portal/OverlayPortal.js +7 -1
- package/lib/commonjs/Portal/OverlayPortal.js.map +1 -1
- package/lib/commonjs/Portal/index.js +19 -0
- package/lib/commonjs/Portal/index.js.map +1 -1
- package/lib/commonjs/Portal/teleported-layer-scope.js +72 -0
- package/lib/commonjs/Portal/teleported-layer-scope.js.map +1 -0
- package/lib/commonjs/ScrollArea/ScrollArea.js +23 -1
- package/lib/commonjs/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/commonjs/ScrollArea/ScrollArea.native.js +70 -61
- package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/commonjs/UnstyledButton/UnstyledButton.js +4 -0
- package/lib/commonjs/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/register-icon-color.js +7 -0
- package/lib/commonjs/internal/register-icon-color.js.map +1 -0
- package/lib/commonjs/internal/style-props.js +17 -0
- package/lib/commonjs/internal/style-props.js.map +1 -1
- package/lib/module/Avatar/Avatar.js +30 -9
- package/lib/module/Avatar/Avatar.js.map +1 -1
- package/lib/module/Input/shared.js +10 -1
- package/lib/module/Input/shared.js.map +1 -1
- package/lib/module/InputBase/InputBase.js +22 -1
- package/lib/module/InputBase/InputBase.js.map +1 -1
- package/lib/module/Modal/index.js +1 -0
- package/lib/module/Modal/index.js.map +1 -1
- package/lib/module/Modal/modal-base.js +20 -15
- package/lib/module/Modal/modal-base.js.map +1 -1
- package/lib/module/Modal/modal-stack.js +80 -0
- package/lib/module/Modal/modal-stack.js.map +1 -0
- package/lib/module/Portal/OverlayPortal.js +8 -2
- package/lib/module/Portal/OverlayPortal.js.map +1 -1
- package/lib/module/Portal/index.js +1 -0
- package/lib/module/Portal/index.js.map +1 -1
- package/lib/module/Portal/teleported-layer-scope.js +66 -0
- package/lib/module/Portal/teleported-layer-scope.js.map +1 -0
- package/lib/module/ScrollArea/ScrollArea.js +23 -1
- package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/module/ScrollArea/ScrollArea.native.js +70 -61
- package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/module/UnstyledButton/UnstyledButton.js +4 -0
- package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/register-icon-color.js +8 -0
- package/lib/module/internal/register-icon-color.js.map +1 -0
- package/lib/module/internal/style-props.js +17 -0
- package/lib/module/internal/style-props.js.map +1 -1
- package/lib/typescript/Avatar/Avatar.d.ts +18 -7
- package/lib/typescript/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/Image/Image.d.ts +7 -7
- package/lib/typescript/Image/Image.native.d.ts +7 -7
- package/lib/typescript/Image/createImage.d.ts +9 -9
- package/lib/typescript/Input/shared.d.ts.map +1 -1
- package/lib/typescript/InputBase/InputBase.d.ts.map +1 -1
- package/lib/typescript/Modal/index.d.ts +1 -0
- package/lib/typescript/Modal/index.d.ts.map +1 -1
- package/lib/typescript/Modal/modal-base.d.ts +2 -2
- package/lib/typescript/Modal/modal-base.d.ts.map +1 -1
- package/lib/typescript/Modal/modal-stack.d.ts +45 -0
- package/lib/typescript/Modal/modal-stack.d.ts.map +1 -0
- package/lib/typescript/Portal/OverlayPortal.d.ts.map +1 -1
- package/lib/typescript/Portal/index.d.ts +1 -0
- package/lib/typescript/Portal/index.d.ts.map +1 -1
- package/lib/typescript/Portal/teleported-layer-scope.d.ts +41 -0
- package/lib/typescript/Portal/teleported-layer-scope.d.ts.map +1 -0
- package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
- package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/internal/register-icon-color.d.ts +2 -0
- package/lib/typescript/internal/register-icon-color.d.ts.map +1 -0
- package/lib/typescript/internal/style-props.d.ts +17 -0
- package/lib/typescript/internal/style-props.d.ts.map +1 -1
- package/package.json +9 -6
- package/src/Avatar/Avatar.tsx +33 -7
- package/src/Input/shared.tsx +24 -1
- package/src/InputBase/InputBase.tsx +36 -1
- package/src/Modal/index.ts +1 -0
- package/src/Modal/modal-base.tsx +17 -18
- package/src/Modal/modal-stack.ts +100 -0
- package/src/Portal/OverlayPortal.tsx +9 -2
- package/src/Portal/index.ts +6 -0
- package/src/Portal/teleported-layer-scope.tsx +73 -0
- package/src/ScrollArea/ScrollArea.native.tsx +85 -74
- package/src/ScrollArea/ScrollArea.tsx +47 -1
- package/src/UnstyledButton/UnstyledButton.tsx +4 -0
- package/src/index.ts +10 -0
- package/src/internal/register-icon-color.ts +6 -0
- package/src/internal/style-props.ts +45 -14
package/src/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "./internal/register-icon-color";
|
|
2
|
+
|
|
1
3
|
export {
|
|
2
4
|
Accordion,
|
|
3
5
|
type AccordionChevronPosition,
|
|
@@ -38,6 +40,7 @@ export {
|
|
|
38
40
|
type AvatarProps,
|
|
39
41
|
type AvatarSize,
|
|
40
42
|
type AvatarVariant,
|
|
43
|
+
getAvatarSize,
|
|
41
44
|
} from "./Avatar";
|
|
42
45
|
// Media
|
|
43
46
|
export {
|
|
@@ -322,6 +325,8 @@ export {
|
|
|
322
325
|
type MenuTrigger,
|
|
323
326
|
} from "./Menu";
|
|
324
327
|
export {
|
|
328
|
+
type EscapeLayerOptions,
|
|
329
|
+
hasOpenEscapeLayer,
|
|
325
330
|
Modal,
|
|
326
331
|
type ModalBodyProps,
|
|
327
332
|
type ModalContentProps,
|
|
@@ -329,6 +334,7 @@ export {
|
|
|
329
334
|
type ModalProps,
|
|
330
335
|
type ModalSize,
|
|
331
336
|
type ModalTitleProps,
|
|
337
|
+
useEscapeLayer,
|
|
332
338
|
} from "./Modal";
|
|
333
339
|
|
|
334
340
|
export {
|
|
@@ -428,9 +434,13 @@ export {
|
|
|
428
434
|
type PortalProps,
|
|
429
435
|
PortalProvider,
|
|
430
436
|
type PortalProviderProps,
|
|
437
|
+
resolvePersistTaps,
|
|
431
438
|
ROOT_OVERLAY_HOST,
|
|
439
|
+
type TeleportedLayerScope,
|
|
432
440
|
useOverlayHost,
|
|
433
441
|
usePortal,
|
|
442
|
+
useRegisterTeleportedLayer,
|
|
443
|
+
useTeleportedLayerScope,
|
|
434
444
|
useTopmostOverlayHost,
|
|
435
445
|
} from "./Portal";
|
|
436
446
|
export {
|
|
@@ -311,13 +311,13 @@ const SQUARE_CONTROL_RADIUS = "md";
|
|
|
311
311
|
|
|
312
312
|
/** Square control sizes WITH the matching corner, per size key. */
|
|
313
313
|
export const SQUARE_ROUNDED_SIZES = {
|
|
314
|
-
xxs: { ...squareSizeVariant.xxs, borderRadius: M.xxs.borderRadius },
|
|
315
|
-
xs: { ...squareSizeVariant.xs, borderRadius: M.xs.borderRadius },
|
|
316
|
-
sm: { ...squareSizeVariant.sm, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
317
|
-
md: { ...squareSizeVariant.md, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
318
|
-
lg: { ...squareSizeVariant.lg, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
319
|
-
xl: { ...squareSizeVariant.xl, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
320
|
-
xxl: { ...squareSizeVariant.xxl, borderRadius: M.xxl.borderRadius },
|
|
314
|
+
xxs: { ...squareSizeVariant.xxs, minHeight: M.xxs.height, borderRadius: M.xxs.borderRadius },
|
|
315
|
+
xs: { ...squareSizeVariant.xs, minHeight: M.xs.height, borderRadius: M.xs.borderRadius },
|
|
316
|
+
sm: { ...squareSizeVariant.sm, minHeight: M.sm.height, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
317
|
+
md: { ...squareSizeVariant.md, minHeight: M.md.height, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
318
|
+
lg: { ...squareSizeVariant.lg, minHeight: M.lg.height, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
319
|
+
xl: { ...squareSizeVariant.xl, minHeight: M.xl.height, borderRadius: SQUARE_CONTROL_RADIUS },
|
|
320
|
+
xxl: { ...squareSizeVariant.xxl, minHeight: M.xxl.height, borderRadius: M.xxl.borderRadius },
|
|
321
321
|
} as const;
|
|
322
322
|
|
|
323
323
|
/**
|
|
@@ -334,15 +334,46 @@ export const squareSizeRoundedVariant = tableVariant(SQUARE_ROUNDED_SIZES, squar
|
|
|
334
334
|
* `height`, space.md on `paddingHorizontal`. Static exact-key map.
|
|
335
335
|
*
|
|
336
336
|
* Used by `Button`, `Button.GroupSection`, `SegmentedControl.Control`.
|
|
337
|
+
*
|
|
338
|
+
* `minHeight` matches `height` because `flex: 1 1 0` inside a column makes the flex
|
|
339
|
+
* basis win over `height`, which would otherwise collapse the control to its border.
|
|
337
340
|
*/
|
|
338
341
|
export const controlVariant = {
|
|
339
|
-
xxs: {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
342
|
+
xxs: {
|
|
343
|
+
height: M.xxs.height,
|
|
344
|
+
minHeight: M.xxs.height,
|
|
345
|
+
paddingHorizontal: M.xxs.paddingHorizontal,
|
|
346
|
+
},
|
|
347
|
+
xs: {
|
|
348
|
+
height: M.xs.height,
|
|
349
|
+
minHeight: M.xs.height,
|
|
350
|
+
paddingHorizontal: M.xs.paddingHorizontal,
|
|
351
|
+
},
|
|
352
|
+
sm: {
|
|
353
|
+
height: M.sm.height,
|
|
354
|
+
minHeight: M.sm.height,
|
|
355
|
+
paddingHorizontal: M.sm.paddingHorizontal,
|
|
356
|
+
},
|
|
357
|
+
md: {
|
|
358
|
+
height: M.md.height,
|
|
359
|
+
minHeight: M.md.height,
|
|
360
|
+
paddingHorizontal: M.md.paddingHorizontal,
|
|
361
|
+
},
|
|
362
|
+
lg: {
|
|
363
|
+
height: M.lg.height,
|
|
364
|
+
minHeight: M.lg.height,
|
|
365
|
+
paddingHorizontal: M.lg.paddingHorizontal,
|
|
366
|
+
},
|
|
367
|
+
xl: {
|
|
368
|
+
height: M.xl.height,
|
|
369
|
+
minHeight: M.xl.height,
|
|
370
|
+
paddingHorizontal: M.xl.paddingHorizontal,
|
|
371
|
+
},
|
|
372
|
+
xxl: {
|
|
373
|
+
height: M.xxl.height,
|
|
374
|
+
minHeight: M.xxl.height,
|
|
375
|
+
paddingHorizontal: M.xxl.paddingHorizontal,
|
|
376
|
+
},
|
|
346
377
|
} as const;
|
|
347
378
|
|
|
348
379
|
/**
|