@scaleflex/ui-tw 0.0.82 → 0.0.83

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,12 @@
1
+ import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
2
+ import React from 'react';
3
+ type CommandSkeletonProps = {
4
+ count?: number;
5
+ size?: FormSizeType;
6
+ isGroup?: boolean;
7
+ withIcons?: boolean;
8
+ withCheckbox?: boolean;
9
+ className?: string;
10
+ };
11
+ declare function CommandSkeleton({ count, size, isGroup, withIcons, withCheckbox, className, }: CommandSkeletonProps): React.JSX.Element;
12
+ export { CommandSkeleton };
@@ -0,0 +1,47 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { selectItemVariants } from '@scaleflex/ui-tw/select/select.component';
3
+ import { getOptionInGroupPaddingLeft } from '@scaleflex/ui-tw/select/select.utils';
4
+ import { FormSize } from '@scaleflex/ui-tw/types/form-size';
5
+ import { cn } from '@scaleflex/ui-tw/utils/cn';
6
+ import React from 'react';
7
+ var iconSizeByFormSize = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, 'size-4'), FormSize.Md, 'size-4'), FormSize.Lg, 'size-5');
8
+ var rowSizes = ['w-3/4', 'w-2/3', 'w-5/6', 'w-1/2', 'w-11/12', 'w-4/5', 'w-1/3', 'w-1/4'];
9
+ function CommandSkeleton(_ref) {
10
+ var _ref$count = _ref.count,
11
+ count = _ref$count === void 0 ? 5 : _ref$count,
12
+ _ref$size = _ref.size,
13
+ size = _ref$size === void 0 ? FormSize.Md : _ref$size,
14
+ _ref$isGroup = _ref.isGroup,
15
+ isGroup = _ref$isGroup === void 0 ? false : _ref$isGroup,
16
+ _ref$withIcons = _ref.withIcons,
17
+ withIcons = _ref$withIcons === void 0 ? false : _ref$withIcons,
18
+ _ref$withCheckbox = _ref.withCheckbox,
19
+ withCheckbox = _ref$withCheckbox === void 0 ? false : _ref$withCheckbox,
20
+ className = _ref.className;
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ "data-slot": "command-skeleton",
23
+ role: "status",
24
+ "aria-live": "polite",
25
+ className: cn('flex flex-col gap-1 px-2', className)
26
+ }, Array.from({
27
+ length: count > 8 ? 5 : count
28
+ }).map(function (_, i) {
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ key: i,
31
+ className: cn('flex w-full animate-pulse items-center gap-3 rounded', selectItemVariants({
32
+ size: size
33
+ }), isGroup && getOptionInGroupPaddingLeft(size))
34
+ }, withCheckbox && /*#__PURE__*/React.createElement("div", {
35
+ "aria-hidden": "true",
36
+ className: cn('bg-muted shrink-0 rounded-[4px]', size === FormSize.Lg ? 'h-5 w-5' : 'h-4 w-4')
37
+ }), withIcons && /*#__PURE__*/React.createElement("div", {
38
+ "aria-hidden": "true",
39
+ className: cn('bg-muted shrink-0 rounded', iconSizeByFormSize[size])
40
+ }), /*#__PURE__*/React.createElement("div", {
41
+ className: "flex-1 space-y-2 overflow-hidden"
42
+ }, /*#__PURE__*/React.createElement("div", {
43
+ className: cn('bg-muted/70 h-3 rounded', rowSizes[i])
44
+ })));
45
+ }));
46
+ }
47
+ export { CommandSkeleton };
@@ -1 +1,2 @@
1
1
  export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from './command.component';
2
+ export { CommandSkeleton } from './command.skeleton';
package/command/index.js CHANGED
@@ -1 +1,2 @@
1
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator } from './command.component';
1
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator } from './command.component';
2
+ export { CommandSkeleton } from './command.skeleton';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/ui-tw",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -23,7 +23,7 @@
23
23
  "@radix-ui/react-slot": "^1.1.2",
24
24
  "@radix-ui/react-switch": "^1.0.1",
25
25
  "@radix-ui/react-tooltip": "^1.2.6",
26
- "@scaleflex/icons-tw": "^0.0.82",
26
+ "@scaleflex/icons-tw": "^0.0.83",
27
27
  "@tanstack/react-table": "^8.21.3",
28
28
  "@types/lodash.merge": "^4.6.9",
29
29
  "class-variance-authority": "^0.7.1",