@bricks-toolkit/toolkit 0.1.9 → 0.1.11

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.
@@ -202,6 +202,7 @@ var Phone = react.forwardRef(function Phone2({
202
202
  onChange,
203
203
  showFlag = true,
204
204
  defaultCountryCode = "+91",
205
+ defaultCountry,
205
206
  autoComplete = "tel",
206
207
  ...rest
207
208
  }, ref) {
@@ -213,8 +214,17 @@ var Phone = react.forwardRef(function Phone2({
213
214
  const [isOpen, setIsOpen] = react.useState(false);
214
215
  const [searchTerm, setSearchTerm] = react.useState("");
215
216
  const dropdownRef = react.useRef(null);
217
+ const initialDialCode = (() => {
218
+ if (defaultCountry) {
219
+ const country = COUNTRIES.find(
220
+ (c) => c.id.toLowerCase() === defaultCountry.toLowerCase()
221
+ );
222
+ if (country) return country.dialCode;
223
+ }
224
+ return defaultCountryCode;
225
+ })();
216
226
  const [internalPhone, setInternalPhone] = react.useState(
217
- defaultValue ?? { countryCode: defaultCountryCode, phoneNumber: "" }
227
+ defaultValue ?? { countryCode: initialDialCode, phoneNumber: "" }
218
228
  );
219
229
  const isControlled = value !== void 0;
220
230
  const currentPhone = isControlled ? value : internalPhone;
@@ -177,7 +177,7 @@ var Tabs = forwardRef(function Tabs2({
177
177
  )
178
178
  }
179
179
  ),
180
- canScrollRight && /* @__PURE__ */ jsxs("div", { className: "absolute right-0 z-20 flex h-full items-center pr-1 hidden pointer-events-none", children: [
180
+ canScrollRight && /* @__PURE__ */ jsxs("div", { className: "absolute right-0 z-20 flex h-full items-center pr-1 lg:hidden pointer-events-none", children: [
181
181
  /* @__PURE__ */ jsx("div", { className: "w-8 h-full bg-gradient-to-l from-surface to-transparent pointer-events-none -mr-4" }),
182
182
  /* @__PURE__ */ jsx(
183
183
  IconButton,
@@ -200,6 +200,7 @@ var Phone = forwardRef(function Phone2({
200
200
  onChange,
201
201
  showFlag = true,
202
202
  defaultCountryCode = "+91",
203
+ defaultCountry,
203
204
  autoComplete = "tel",
204
205
  ...rest
205
206
  }, ref) {
@@ -211,8 +212,17 @@ var Phone = forwardRef(function Phone2({
211
212
  const [isOpen, setIsOpen] = useState(false);
212
213
  const [searchTerm, setSearchTerm] = useState("");
213
214
  const dropdownRef = useRef(null);
215
+ const initialDialCode = (() => {
216
+ if (defaultCountry) {
217
+ const country = COUNTRIES.find(
218
+ (c) => c.id.toLowerCase() === defaultCountry.toLowerCase()
219
+ );
220
+ if (country) return country.dialCode;
221
+ }
222
+ return defaultCountryCode;
223
+ })();
214
224
  const [internalPhone, setInternalPhone] = useState(
215
- defaultValue ?? { countryCode: defaultCountryCode, phoneNumber: "" }
225
+ defaultValue ?? { countryCode: initialDialCode, phoneNumber: "" }
216
226
  );
217
227
  const isControlled = value !== void 0;
218
228
  const currentPhone = isControlled ? value : internalPhone;
@@ -179,7 +179,7 @@ var Tabs = react.forwardRef(function Tabs2({
179
179
  )
180
180
  }
181
181
  ),
182
- canScrollRight && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 z-20 flex h-full items-center pr-1 hidden pointer-events-none", children: [
182
+ canScrollRight && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 z-20 flex h-full items-center pr-1 lg:hidden pointer-events-none", children: [
183
183
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-full bg-gradient-to-l from-surface to-transparent pointer-events-none -mr-4" }),
184
184
  /* @__PURE__ */ jsxRuntime.jsx(
185
185
  chunkTNGW5YHA_cjs.IconButton,
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@ var chunkPCYGJNEQ_cjs = require('./chunk-PCYGJNEQ.cjs');
4
4
  var chunk7DDDQ3RH_cjs = require('./chunk-7DDDQ3RH.cjs');
5
5
  var chunkLTG6YP5I_cjs = require('./chunk-LTG6YP5I.cjs');
6
6
  require('./chunk-NMJ5CVZH.cjs');
7
- var chunk3IPWW66F_cjs = require('./chunk-3IPWW66F.cjs');
7
+ var chunkY6AN7AWX_cjs = require('./chunk-Y6AN7AWX.cjs');
8
8
  var chunkXFNRKHHF_cjs = require('./chunk-XFNRKHHF.cjs');
9
9
  var chunkDHC5LI2P_cjs = require('./chunk-DHC5LI2P.cjs');
10
10
  var chunkYMMNWJT6_cjs = require('./chunk-YMMNWJT6.cjs');
@@ -16,7 +16,7 @@ var chunkS7VEND5Z_cjs = require('./chunk-S7VEND5Z.cjs');
16
16
  var chunk56ILK7Y4_cjs = require('./chunk-56ILK7Y4.cjs');
17
17
  var chunkNRZIXK35_cjs = require('./chunk-NRZIXK35.cjs');
18
18
  var chunk5RKET2JO_cjs = require('./chunk-5RKET2JO.cjs');
19
- var chunkB4OV5GRT_cjs = require('./chunk-B4OV5GRT.cjs');
19
+ var chunkB2FU2E2X_cjs = require('./chunk-B2FU2E2X.cjs');
20
20
  var chunkVRZFAKSV_cjs = require('./chunk-VRZFAKSV.cjs');
21
21
  var chunk7R5JRJ2W_cjs = require('./chunk-7R5JRJ2W.cjs');
22
22
  var chunkOEU5VG3D_cjs = require('./chunk-OEU5VG3D.cjs');
@@ -633,7 +633,7 @@ Object.defineProperty(exports, "useTheme", {
633
633
  });
634
634
  Object.defineProperty(exports, "Tabs", {
635
635
  enumerable: true,
636
- get: function () { return chunk3IPWW66F_cjs.Tabs; }
636
+ get: function () { return chunkY6AN7AWX_cjs.Tabs; }
637
637
  });
638
638
  Object.defineProperty(exports, "TextInput", {
639
639
  enumerable: true,
@@ -697,7 +697,7 @@ Object.defineProperty(exports, "PasswordInput", {
697
697
  });
698
698
  Object.defineProperty(exports, "Phone", {
699
699
  enumerable: true,
700
- get: function () { return chunkB4OV5GRT_cjs.Phone; }
700
+ get: function () { return chunkB2FU2E2X_cjs.Phone; }
701
701
  });
702
702
  Object.defineProperty(exports, "RadioButton", {
703
703
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ export { Modal, ModalBody, ModalCloseButton, ModalFooter, ModalHeader } from './
2
2
  export { SearchInput } from './chunk-VHVFRWF5.mjs';
3
3
  export { ThemeProvider, useTheme } from './chunk-Y3NTKFUE.mjs';
4
4
  import './chunk-SBNNV6FE.mjs';
5
- export { Tabs } from './chunk-K3IJEZ4S.mjs';
5
+ export { Tabs } from './chunk-G4HVY6FM.mjs';
6
6
  export { TextInput } from './chunk-CMER5LO3.mjs';
7
7
  export { TimePicker } from './chunk-VKQDW7C2.mjs';
8
8
  export { Toaster } from './chunk-YOTCXSXL.mjs';
@@ -14,7 +14,7 @@ export { Skeleton, SkeletonAvatar, SkeletonCard, SkeletonTable, SkeletonText } f
14
14
  export { MultiSelect } from './chunk-JKPNJ4PZ.mjs';
15
15
  export { OtpInput } from './chunk-RYWDZHKG.mjs';
16
16
  export { PasswordInput } from './chunk-446OJWC6.mjs';
17
- export { Phone } from './chunk-CBA54EY4.mjs';
17
+ export { Phone } from './chunk-TBMIMUU4.mjs';
18
18
  export { RadioButton } from './chunk-DN2GFJF4.mjs';
19
19
  export { Select } from './chunk-TIVSMCXZ.mjs';
20
20
  export { Pagination, Table } from './chunk-7364SUK6.mjs';
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkB4OV5GRT_cjs = require('../chunk-B4OV5GRT.cjs');
3
+ var chunkB2FU2E2X_cjs = require('../chunk-B2FU2E2X.cjs');
4
4
  require('../chunk-L5VQZZVR.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Phone", {
9
9
  enumerable: true,
10
- get: function () { return chunkB4OV5GRT_cjs.Phone; }
10
+ get: function () { return chunkB2FU2E2X_cjs.Phone; }
11
11
  });
@@ -1,2 +1,2 @@
1
- export { Phone } from '../chunk-CBA54EY4.mjs';
1
+ export { Phone } from '../chunk-TBMIMUU4.mjs';
2
2
  import '../chunk-OCPFOFJ4.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk3IPWW66F_cjs = require('../chunk-3IPWW66F.cjs');
3
+ var chunkY6AN7AWX_cjs = require('../chunk-Y6AN7AWX.cjs');
4
4
  require('../chunk-TNGW5YHA.cjs');
5
5
  require('../chunk-6CC5KIA5.cjs');
6
6
  require('../chunk-R72GDCWE.cjs');
@@ -10,5 +10,5 @@ require('../chunk-L5VQZZVR.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "Tabs", {
12
12
  enumerable: true,
13
- get: function () { return chunk3IPWW66F_cjs.Tabs; }
13
+ get: function () { return chunkY6AN7AWX_cjs.Tabs; }
14
14
  });
@@ -1,4 +1,4 @@
1
- export { Tabs } from '../chunk-K3IJEZ4S.mjs';
1
+ export { Tabs } from '../chunk-G4HVY6FM.mjs';
2
2
  import '../chunk-BVBCAAES.mjs';
3
3
  import '../chunk-RAD5VJHR.mjs';
4
4
  import '../chunk-65UZC3FK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bricks-toolkit/toolkit",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Micro-modularized, fully independent, type-safe UI component library",
5
5
  "license": "MIT",
6
6
  "author": "ITProfound",
@@ -367,31 +367,12 @@
367
367
  },
368
368
  "./styles.css": "./dist/styles.css",
369
369
  "./theme.css": "./dist/theme.css"
370
-
371
370
  },
372
371
  "files": [
373
372
  "dist",
374
373
  "README.md",
375
374
  "LICENSE"
376
375
  ],
377
- "scripts": {
378
- "storybook": "storybook dev -p 6006 --no-version-updates",
379
- "build": "tsup && copy src\\styles\\theme.css dist\\theme.css",
380
- "build:watch": "tsup --watch",
381
- "build:storybook": "storybook build",
382
- "test": "vitest run",
383
- "test:watch": "vitest",
384
- "test:coverage": "vitest run --coverage",
385
- "lint": "eslint .",
386
- "lint:fix": "eslint . --fix",
387
- "format": "prettier --write .",
388
- "format:check": "prettier --check .",
389
- "typecheck": "tsc --noEmit",
390
- "validate": "pnpm typecheck && pnpm lint && pnpm test",
391
- "clean": "rimraf dist",
392
- "prepare": "husky",
393
- "audit": "pnpm audit"
394
- },
395
376
  "devDependencies": {
396
377
  "@eslint/js": "10.0.1",
397
378
  "@storybook/addon-a11y": "10.3.5",
@@ -463,5 +444,22 @@
463
444
  },
464
445
  "dependencies": {
465
446
  "@heroicons/react": "2.2.0"
447
+ },
448
+ "scripts": {
449
+ "storybook": "storybook dev -p 6006 --no-version-updates",
450
+ "build": "tsup && copy src\\styles\\theme.css dist\\theme.css",
451
+ "build:watch": "tsup --watch",
452
+ "build:storybook": "storybook build",
453
+ "test": "vitest run",
454
+ "test:watch": "vitest",
455
+ "test:coverage": "vitest run --coverage",
456
+ "lint": "eslint .",
457
+ "lint:fix": "eslint . --fix",
458
+ "format": "prettier --write .",
459
+ "format:check": "prettier --check .",
460
+ "typecheck": "tsc --noEmit",
461
+ "validate": "pnpm typecheck && pnpm lint && pnpm test",
462
+ "clean": "rimraf dist",
463
+ "audit": "pnpm audit"
466
464
  }
467
- }
465
+ }
package/dist/theme.css DELETED
@@ -1,62 +0,0 @@
1
- @theme {
2
- /* Brand & Status Colors */
3
- --color-primary: var(--primary);
4
- --color-primary-hover: var(--primary-hover);
5
- --color-primary-active: var(--primary-active);
6
- --color-secondary: var(--secondary);
7
- --color-secondary-hover: var(--secondary-hover);
8
- --color-accent: var(--accent);
9
- --color-success: var(--success);
10
- --color-warning: var(--warning);
11
- --color-error: var(--error);
12
- --color-info: var(--info);
13
-
14
- /* Layout & Surface Colors */
15
- --color-background: var(--background);
16
- --color-surface: var(--surface);
17
- --color-surface-secondary: var(--surface-secondary);
18
- --color-border: var(--border);
19
- --color-border-light: var(--border-light);
20
- --color-divider: var(--divider);
21
-
22
- /* Text Colors */
23
- --color-text: var(--text);
24
- --color-text-secondary: var(--text-secondary);
25
- --color-text-muted: var(--text-muted);
26
- --color-text-inverse: var(--text-inverse);
27
-
28
- /* Interaction Colors */
29
- --color-hover: var(--hover);
30
- --color-active: var(--active);
31
- --color-focus: var(--focus);
32
- --color-disabled: var(--disabled);
33
-
34
- /* Semantic Mappings (Shadcn-like) */
35
- --color-primary-foreground: var(--text-inverse);
36
- --color-secondary-foreground: var(--text);
37
- --color-muted: var(--surface-secondary);
38
- --color-muted-foreground: var(--text-muted);
39
- --color-accent-foreground: var(--text-inverse);
40
- --color-destructive: var(--error);
41
- --color-destructive-foreground: var(--text-inverse);
42
-
43
- /* Shadows */
44
- --shadow-sm: var(--shadow-sm);
45
- --shadow-md: var(--shadow-md);
46
- --shadow-lg: var(--shadow-lg);
47
- --shadow-xl: var(--shadow-xl);
48
- --shadow-2xl: var(--shadow-2xl);
49
- --shadow-premium: var(--shadow-premium);
50
-
51
- /* Durations */
52
- --duration-fast: 150ms;
53
- --duration-normal: 250ms;
54
- --duration-slow: 400ms;
55
-
56
- /* Z-Index */
57
- --z-index-dropdown: 1000;
58
- --z-index-sticky: 1020;
59
- --z-index-popover: 1030;
60
- --z-index-modal: 1050;
61
- --z-index-tooltip: 1100;
62
- }