@particle-network/ui-react 0.0.1

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.
Files changed (109) hide show
  1. package/README.md +23 -0
  2. package/dist/components/ProgressWrapper/index.d.ts +34 -0
  3. package/dist/components/ProgressWrapper/index.js +102 -0
  4. package/dist/components/UXButton/button-group-context.d.ts +2 -0
  5. package/dist/components/UXButton/button-group-context.js +6 -0
  6. package/dist/components/UXButton/button-group.d.ts +4 -0
  7. package/dist/components/UXButton/button-group.js +22 -0
  8. package/dist/components/UXButton/button-theme.d.ts +236 -0
  9. package/dist/components/UXButton/button-theme.js +626 -0
  10. package/dist/components/UXButton/button.d.ts +4 -0
  11. package/dist/components/UXButton/button.js +31 -0
  12. package/dist/components/UXButton/index.d.ts +8 -0
  13. package/dist/components/UXButton/index.js +6 -0
  14. package/dist/components/UXButton/use-button-group.d.ts +37 -0
  15. package/dist/components/UXButton/use-button-group.js +55 -0
  16. package/dist/components/UXButton/use-button.d.ts +65 -0
  17. package/dist/components/UXButton/use-button.js +136 -0
  18. package/dist/components/UXCheckbox/checkbox.extend.d.ts +7 -0
  19. package/dist/components/UXCheckbox/checkbox.extend.js +151 -0
  20. package/dist/components/UXCheckbox/checkbox.icon.d.ts +6 -0
  21. package/dist/components/UXCheckbox/checkbox.icon.js +46 -0
  22. package/dist/components/UXCheckbox/index.d.ts +10 -0
  23. package/dist/components/UXCheckbox/index.js +17 -0
  24. package/dist/components/UXChip/chip.extend.d.ts +299 -0
  25. package/dist/components/UXChip/chip.extend.js +236 -0
  26. package/dist/components/UXChip/index.d.ts +302 -0
  27. package/dist/components/UXChip/index.js +10 -0
  28. package/dist/components/UXDivider/divider.extend.d.ts +286 -0
  29. package/dist/components/UXDivider/divider.extend.js +15 -0
  30. package/dist/components/UXDivider/index.d.ts +4 -0
  31. package/dist/components/UXDivider/index.js +10 -0
  32. package/dist/components/UXDropdown/dropdown-item.d.ts +3 -0
  33. package/dist/components/UXDropdown/dropdown-item.js +306 -0
  34. package/dist/components/UXDropdown/dropdown-menu.d.ts +3 -0
  35. package/dist/components/UXDropdown/dropdown-menu.js +25 -0
  36. package/dist/components/UXDropdown/dropdown-section.d.ts +1 -0
  37. package/dist/components/UXDropdown/dropdown-section.js +2 -0
  38. package/dist/components/UXDropdown/dropdown.d.ts +4 -0
  39. package/dist/components/UXDropdown/dropdown.js +21 -0
  40. package/dist/components/UXDropdown/index.d.ts +6 -0
  41. package/dist/components/UXDropdown/index.js +6 -0
  42. package/dist/components/UXHint/index.d.ts +8 -0
  43. package/dist/components/UXHint/index.js +22 -0
  44. package/dist/components/UXInput/index.d.ts +346 -0
  45. package/dist/components/UXInput/index.js +10 -0
  46. package/dist/components/UXInput/input.extend.d.ts +343 -0
  47. package/dist/components/UXInput/input.extend.js +6 -0
  48. package/dist/components/UXModal/index.d.ts +10 -0
  49. package/dist/components/UXModal/index.js +89 -0
  50. package/dist/components/UXNumberInput/index.d.ts +5 -0
  51. package/dist/components/UXNumberInput/index.js +10 -0
  52. package/dist/components/UXNumberInput/number-input.extend.d.ts +8 -0
  53. package/dist/components/UXNumberInput/number-input.extend.js +6 -0
  54. package/dist/components/UXPopover/index.d.ts +6 -0
  55. package/dist/components/UXPopover/index.js +10 -0
  56. package/dist/components/UXPopover/popover.extend.d.ts +7 -0
  57. package/dist/components/UXPopover/popover.extend.js +26 -0
  58. package/dist/components/UXRadio/index.d.ts +10 -0
  59. package/dist/components/UXRadio/index.js +12 -0
  60. package/dist/components/UXRadio/radio.extend.d.ts +7 -0
  61. package/dist/components/UXRadio/radio.extend.js +97 -0
  62. package/dist/components/UXSelect/index.d.ts +6 -0
  63. package/dist/components/UXSelect/index.js +51 -0
  64. package/dist/components/UXSwitch/index.d.ts +331 -0
  65. package/dist/components/UXSwitch/index.js +10 -0
  66. package/dist/components/UXSwitch/switch.extend.d.ts +328 -0
  67. package/dist/components/UXSwitch/switch.extend.js +117 -0
  68. package/dist/components/UXTabs/index.d.ts +9 -0
  69. package/dist/components/UXTabs/index.js +11 -0
  70. package/dist/components/UXTabs/tabs.classes.d.ts +210 -0
  71. package/dist/components/UXTabs/tabs.classes.js +530 -0
  72. package/dist/components/UXTabs/tabs.extend.d.ts +8 -0
  73. package/dist/components/UXTabs/tabs.extend.js +6 -0
  74. package/dist/components/UXTooltip/index.d.ts +5 -0
  75. package/dist/components/UXTooltip/index.js +23 -0
  76. package/dist/components/UXTooltip/tooltip.extend.d.ts +314 -0
  77. package/dist/components/UXTooltip/tooltip.extend.js +27 -0
  78. package/dist/components/index.d.ts +44 -0
  79. package/dist/components/index.js +31 -0
  80. package/dist/components/layout/Center.d.ts +4 -0
  81. package/dist/components/layout/Center.js +11 -0
  82. package/dist/components/layout/Circle.d.ts +6 -0
  83. package/dist/components/layout/Circle.js +12 -0
  84. package/dist/components/layout/Flex.d.ts +29 -0
  85. package/dist/components/layout/Flex.js +24 -0
  86. package/dist/components/layout/HStack.d.ts +4 -0
  87. package/dist/components/layout/HStack.js +12 -0
  88. package/dist/components/layout/Square.d.ts +8 -0
  89. package/dist/components/layout/Square.js +13 -0
  90. package/dist/components/layout/VStack.d.ts +4 -0
  91. package/dist/components/layout/VStack.js +12 -0
  92. package/dist/components/typography/Text.d.ts +3 -0
  93. package/dist/components/typography/Text.js +12 -0
  94. package/dist/components/typography/Text.type.d.ts +103 -0
  95. package/dist/components/typography/Text.type.js +47 -0
  96. package/dist/icons/index.d.ts +6 -0
  97. package/dist/icons/index.js +58 -0
  98. package/dist/index.d.ts +2 -0
  99. package/dist/index.js +2 -0
  100. package/dist/utils/classes.d.ts +35 -0
  101. package/dist/utils/classes.js +87 -0
  102. package/dist/utils/index.d.ts +3 -0
  103. package/dist/utils/index.js +4 -0
  104. package/dist/utils/input-classes.d.ts +427 -0
  105. package/dist/utils/input-classes.js +568 -0
  106. package/dist/utils/variants.d.ts +91 -0
  107. package/dist/utils/variants.js +100 -0
  108. package/package.json +42 -0
  109. package/tailwind-preset.js +298 -0
@@ -0,0 +1,103 @@
1
+ import type React from 'react';
2
+ import type { UXForegroundColor } from '@particle-network/ui-shared';
3
+ type TextVariant = 'h1' | 'h2' | 'h3' | 'body1' | 'body1Bold' | 'body2' | 'body2Bold' | 'body3' | 'body3Bold' | 'caption1' | 'caption1Bold';
4
+ type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
5
+ type TextLineHeight = '1' | '1.4';
6
+ type TextAlign = 'left' | 'center' | 'right';
7
+ export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
8
+ /**
9
+ * | variant | font-size | font-weight |
10
+ * | :----------- | :-------- | :---------- |
11
+ * | h1 | 24px | 600 |
12
+ * | h2 | 20px | 600 |
13
+ * | h3 | 16px | 600 |
14
+ * | body1 | 14px | 400 |
15
+ * | body1Bold | 14px | 500 |
16
+ * | body2 | 12px | 400 |
17
+ * | body2Bold | 12px | 500 |
18
+ * | body3 | 10px | 400 |
19
+ * | body3Bold | 10px | 500 |
20
+ * | caption1 | 8px | 400 |
21
+ * | caption1Bold | 8px | 500 |
22
+ */
23
+ variant?: TextVariant;
24
+ /**
25
+ * `24px 600`
26
+ */
27
+ h1?: boolean;
28
+ /**
29
+ * `20px 600`
30
+ */
31
+ h2?: boolean;
32
+ /**
33
+ * `16px 600`
34
+ */
35
+ h3?: boolean;
36
+ /**
37
+ * `14px 400`
38
+ */
39
+ body1?: boolean;
40
+ /**
41
+ * `14px 500`
42
+ */
43
+ body1Bold?: boolean;
44
+ /**
45
+ * `12px 400`
46
+ */
47
+ body2?: boolean;
48
+ /**
49
+ * `12px 500`
50
+ */
51
+ body2Bold?: boolean;
52
+ /**
53
+ * `10px 400`
54
+ */
55
+ body3?: boolean;
56
+ /**
57
+ * `10px 500`
58
+ */
59
+ body3Bold?: boolean;
60
+ /**
61
+ * `8px 400`
62
+ */
63
+ caption1?: boolean;
64
+ /**
65
+ * `8px 500`
66
+ */
67
+ caption1Bold?: boolean;
68
+ /**
69
+ * | weight | font-weight |
70
+ * | :-------- | :---------: |
71
+ * | normal | 400 |
72
+ * | medium | 500 |
73
+ * | semibold | 600 |
74
+ * | bold | 700 |
75
+ * | extrabold | 800 |
76
+ */
77
+ fontWeight?: TextWeight;
78
+ /**
79
+ * | color | dark | light |
80
+ * | :--------- | :-------- | :-------- |
81
+ * | default | - | - |
82
+ * | foreground | #FFFFFF | #000000 |
83
+ * | secondary | #A1A1AA | #767A80 |
84
+ * | tertiary | #4E4E56 | #C0C0C9 |
85
+ * | primary | #D745FF | #000000 |
86
+ * | success | #45B167 | #2E9F4A |
87
+ * | danger | #E84A5A | #DE4A40 |
88
+ * | alert | #F57733 | #E65E16 |
89
+ * | warning | #FF9821 | #FF9821 |
90
+ * | gold | #FFB800 | #F38300 |
91
+ */
92
+ color?: UXForegroundColor;
93
+ lineHeight?: TextLineHeight;
94
+ align?: TextAlign;
95
+ }
96
+ export declare const textClasses: {
97
+ variant: Record<TextVariant, string>;
98
+ color: Record<UXForegroundColor, string>;
99
+ fontWeight: Record<TextWeight, string>;
100
+ lineHeight: Record<TextLineHeight, string>;
101
+ align: Record<TextAlign, string>;
102
+ };
103
+ export {};
@@ -0,0 +1,47 @@
1
+ const textClasses = {
2
+ variant: {
3
+ h1: 'text-[1.5rem] leading-[1.75rem] font-semibold',
4
+ h2: 'text-[1.25rem] leading-[1.5rem] font-semibold',
5
+ h3: 'text-[1rem] leading-[1.25rem] font-semibold',
6
+ body1Bold: 'text-[0.875rem] leading-[1.125rem] font-medium',
7
+ body1: 'text-[0.875rem] leading-[1.125rem] font-normal',
8
+ body2Bold: 'text-[0.75rem] leading-[1rem] font-medium',
9
+ body2: 'text-[0.75rem] leading-[1rem] font-normal',
10
+ body3Bold: 'text-[0.6875rem] leading-[1rem] font-medium',
11
+ body3: 'text-[0.6875rem] leading-[1rem] font-normal',
12
+ caption1Bold: 'text-[0.625rem] leading-[0.875rem] font-medium',
13
+ caption1: 'text-[0.625rem] leading-[0.875rem] font-normal'
14
+ },
15
+ color: {
16
+ default: '',
17
+ foreground: 'text-foreground',
18
+ secondary: 'text-foreground-300',
19
+ white: 'text-white',
20
+ tertiary: 'text-foreground-100',
21
+ primary: 'text-primary',
22
+ success: 'text-success',
23
+ danger: 'text-danger',
24
+ alert: 'text-alert',
25
+ warning: 'text-warning',
26
+ gold: 'text-gold',
27
+ bullish: 'text-bullish',
28
+ bearish: 'text-bearish'
29
+ },
30
+ fontWeight: {
31
+ normal: 'font-normal',
32
+ medium: 'font-medium',
33
+ semibold: 'font-semibold',
34
+ bold: 'font-bold',
35
+ extrabold: 'font-extrabold'
36
+ },
37
+ lineHeight: {
38
+ 1: 'leading-none',
39
+ '1.4': 'leading-[1.4]'
40
+ },
41
+ align: {
42
+ left: 'text-left',
43
+ center: 'text-center',
44
+ right: 'text-right'
45
+ }
46
+ };
47
+ export { textClasses };
@@ -0,0 +1,6 @@
1
+ import React, { type SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement>;
3
+ export declare const CloseIcon: React.FC<IconProps>;
4
+ export declare const QuestionIcon: React.FC<IconProps>;
5
+ export declare const ChevronDownIcon: React.FC<IconProps>;
6
+ export {};
@@ -0,0 +1,58 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ const CloseIcon = (props)=>/*#__PURE__*/ jsx("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: 24,
6
+ height: 24,
7
+ fill: "none",
8
+ style: {
9
+ color: 'var(--heroui-foreground)'
10
+ },
11
+ ...props,
12
+ children: /*#__PURE__*/ jsx("path", {
13
+ fill: "currentColor",
14
+ fillRule: "evenodd",
15
+ d: "m8.002 8.941 3.77 3.772a.667.667 0 0 0 .944-.943L8.944 8l3.771-3.772a.667.667 0 0 0-.942-.942L8.002 7.056 4.23 3.285a.667.667 0 0 0-.942.942L7.058 8l-3.77 3.771a.667.667 0 1 0 .942.943L8.002 8.94Z",
16
+ clipRule: "evenodd"
17
+ })
18
+ });
19
+ const QuestionIcon = (props)=>/*#__PURE__*/ jsxs("svg", {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ width: 12,
22
+ height: 12,
23
+ fill: "none",
24
+ style: {
25
+ color: 'var(--heroui-foreground-300)'
26
+ },
27
+ ...props,
28
+ children: [
29
+ /*#__PURE__*/ jsx("circle", {
30
+ cx: 6,
31
+ cy: 6,
32
+ r: 5.611,
33
+ stroke: "currentColor",
34
+ strokeWidth: 0.778
35
+ }),
36
+ /*#__PURE__*/ jsx("path", {
37
+ fill: "currentColor",
38
+ d: "M7.9 4.766c-.025.468-.176.837-.929 1.554-.382.363-.622.637-.646.876a.375.375 0 0 1-.38.329c-.013 0-.025-.002-.038-.003a.37.37 0 0 1-.343-.397c.052-.504.44-.911.868-1.318.684-.652.695-.859.707-1.078a.906.906 0 0 0-.28-.697 1.22 1.22 0 0 0-.86-.35h-.003c-.626 0-1.138.488-1.138 1.085 0 .202-.17.364-.382.364a.373.373 0 0 1-.382-.365c0-.483.197-.938.556-1.28.358-.344.835-.532 1.344-.533a2.007 2.007 0 0 1 1.419.576c.34.342.513.781.488 1.237ZM6.228 8.195a.457.457 0 1 0-.458.792.457.457 0 0 0 .458-.792Z"
39
+ })
40
+ ]
41
+ });
42
+ const ChevronDownIcon = (props)=>/*#__PURE__*/ jsx("svg", {
43
+ xmlns: "http://www.w3.org/2000/svg",
44
+ width: 20,
45
+ height: 20,
46
+ fill: "none",
47
+ style: {
48
+ color: 'var(--heroui-foreground-300)'
49
+ },
50
+ ...props,
51
+ children: /*#__PURE__*/ jsx("path", {
52
+ fill: "currentColor",
53
+ fillRule: "evenodd",
54
+ d: "M12.706 15.702a1 1 0 0 1-1.414 0l-5.657-5.657A1 1 0 1 1 7.05 8.631l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414l-5.657 5.657Z",
55
+ clipRule: "evenodd"
56
+ })
57
+ });
58
+ export { ChevronDownIcon, CloseIcon, QuestionIcon };
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ export * from './utils';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./components/index.js";
2
+ export * from "./utils/index.js";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This is the base classNames for all elements.
3
+ * Is meant to be used with the `addBase` method from tailwindcss.
4
+ */
5
+ export declare const baseStyles: (prefix: string) => {
6
+ color: string;
7
+ backgroundColor: string;
8
+ };
9
+ /**
10
+ * focus classNames when the element is focused by keyboard.
11
+ */
12
+ export declare const focusVisibleClasses: string[];
13
+ export declare const dataFocusVisibleClasses: string[];
14
+ export declare const groupDataFocusVisibleClasses: string[];
15
+ export declare const ringClasses: string[];
16
+ /**
17
+ * This classes centers the element by using absolute positioning.
18
+ */
19
+ export declare const translateCenterClasses: string[];
20
+ export declare const absoluteFullClasses: string[];
21
+ /**
22
+ * This object defines CSS classes for collapsing adjacent variant borders.
23
+ * It includes classes for different variants like default, primary, secondary, etc.
24
+ */
25
+ export declare const collapseAdjacentVariantBorders: {
26
+ default: string[];
27
+ primary: string[];
28
+ secondary: string[];
29
+ success: string[];
30
+ warning: string[];
31
+ danger: string[];
32
+ bullish: string[];
33
+ bearish: string[];
34
+ };
35
+ export declare const hiddenInputClasses: string[];
@@ -0,0 +1,87 @@
1
+ const baseStyles = (prefix)=>({
2
+ color: `hsl(var(--${prefix}-foreground))`,
3
+ backgroundColor: `hsl(var(--${prefix}-background))`
4
+ });
5
+ const focusVisibleClasses = [
6
+ 'focus-visible:z-10',
7
+ 'focus-visible:outline-2',
8
+ 'focus-visible:outline-focus',
9
+ 'focus-visible:outline-offset-2'
10
+ ];
11
+ const dataFocusVisibleClasses = [
12
+ 'outline-none',
13
+ 'data-[focus-visible=true]:z-10',
14
+ 'data-[focus-visible=true]:outline-2',
15
+ 'data-[focus-visible=true]:outline-focus',
16
+ 'data-[focus-visible=true]:outline-offset-2'
17
+ ];
18
+ const groupDataFocusVisibleClasses = [
19
+ 'outline-none',
20
+ 'group-data-[focus-visible=true]:z-10',
21
+ 'group-data-[focus-visible=true]:ring-2',
22
+ 'group-data-[focus-visible=true]:ring-focus',
23
+ 'group-data-[focus-visible=true]:ring-offset-2',
24
+ 'group-data-[focus-visible=true]:ring-offset-background'
25
+ ];
26
+ const ringClasses = [
27
+ 'outline-none',
28
+ 'ring-2',
29
+ 'ring-focus',
30
+ 'ring-offset-2',
31
+ 'ring-offset-background'
32
+ ];
33
+ const translateCenterClasses = [
34
+ 'absolute',
35
+ 'top-1/2',
36
+ 'left-1/2',
37
+ '-translate-x-1/2',
38
+ '-translate-y-1/2'
39
+ ];
40
+ const absoluteFullClasses = [
41
+ 'absolute',
42
+ 'inset-0'
43
+ ];
44
+ const collapseAdjacentVariantBorders = {
45
+ default: [
46
+ '[&+.border-medium.border-default]:ms-[calc(theme(borderWidth.medium)*-1)]'
47
+ ],
48
+ primary: [
49
+ '[&+.border-medium.border-primary]:ms-[calc(theme(borderWidth.medium)*-1)]'
50
+ ],
51
+ secondary: [
52
+ '[&+.border-medium.border-secondary]:ms-[calc(theme(borderWidth.medium)*-1)]'
53
+ ],
54
+ success: [
55
+ '[&+.border-medium.border-success]:ms-[calc(theme(borderWidth.medium)*-1)]'
56
+ ],
57
+ warning: [
58
+ '[&+.border-medium.border-warning]:ms-[calc(theme(borderWidth.medium)*-1)]'
59
+ ],
60
+ danger: [
61
+ '[&+.border-medium.border-danger]:ms-[calc(theme(borderWidth.medium)*-1)]'
62
+ ],
63
+ bullish: [
64
+ '[&+.border-medium.border-bullish]:ms-[calc(theme(borderWidth.medium)*-1)]'
65
+ ],
66
+ bearish: [
67
+ '[&+.border-medium.border-bearish]:ms-[calc(theme(borderWidth.medium)*-1)]'
68
+ ]
69
+ };
70
+ const hiddenInputClasses = [
71
+ 'font-inherit',
72
+ 'text-[100%]',
73
+ 'leading-[1.15]',
74
+ 'm-0',
75
+ 'p-0',
76
+ 'overflow-visible',
77
+ 'box-border',
78
+ 'absolute',
79
+ 'top-0',
80
+ 'w-full',
81
+ 'h-full',
82
+ 'opacity-[0.0001]',
83
+ 'z-[1]',
84
+ 'cursor-pointer',
85
+ 'disabled:cursor-default'
86
+ ];
87
+ export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses };
@@ -0,0 +1,3 @@
1
+ export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses, } from './classes';
2
+ export * from './input-classes';
3
+ export { colorVariants } from './variants';
@@ -0,0 +1,4 @@
1
+ import { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses } from "./classes.js";
2
+ import { colorVariants } from "./variants.js";
3
+ export * from "./input-classes.js";
4
+ export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses };