@sentio/ui-core 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -18,15 +18,31 @@ pnpm add @sentio/ui-core
18
18
  ## Usage
19
19
 
20
20
  ```tsx
21
- import { Button, BaseDialog, BarLoading, CopyButton } from '@sentio/ui-core'
21
+ import {
22
+ Button,
23
+ BaseDialog,
24
+ BarLoading,
25
+ CopyButton,
26
+ Input,
27
+ Select,
28
+ Switch,
29
+ PopoverTooltip,
30
+ ResizeTable,
31
+ FlatTree,
32
+ useMobile
33
+ } from '@sentio/ui-core'
22
34
  import '@sentio/ui-core/dist/style.css'
23
35
 
24
36
  function App() {
37
+ const isMobile = useMobile()
38
+
25
39
  return (
26
40
  <>
27
41
  <Button>Click me</Button>
28
42
  <BarLoading />
29
43
  <CopyButton text="Copy this" />
44
+ <Input placeholder="Enter text" />
45
+ {!isMobile && <p>Desktop view</p>}
30
46
  </>
31
47
  )
32
48
  }
@@ -37,18 +53,20 @@ function App() {
37
53
  ### Common Components
38
54
  - `BarLoading` - Bar loading indicator
39
55
  - `SpinLoading` - Spinner loading indicator
40
- - `CopyButton`, `CopyIcon`, `CopySuccessIcon` - Copy button with icons
41
- - `Button` - Button component with variants
42
- - `BaseDialog` - Dialog component
56
+ - `CopyButton`, `CopyIcon`, `CopySuccessIcon` - Copy button and icons
57
+ - `Button` - Button component with loading state support
58
+ - `BaseDialog`, `BaseZIndexContext` - Dialog component with z-index context
43
59
  - `PopoverTooltip` - Tooltip component
44
- - `DisclosurePanel` - Collapsible disclosure panel
45
- - `Collapse` - Collapse/expand animation wrapper
46
- - `Input` - Text input component
47
- - `RadioSelect` - Radio button group
48
- - `Switch` - Toggle switch component
49
- - `Select` - Dropdown select component
60
+ - `DisclosurePanel` - Disclosure panel component
61
+ - `Collapse` - Collapse/expand component
62
+ - `Input` - Input component
63
+ - `RadioSelect` - Radio select component
64
+ - `Switch` - Switch toggle component
65
+ - `Select` - Select dropdown component
66
+ - `FlatTree` - Tree component with flat data structure
67
+ - `LinkifyText` - Text component that converts URLs to links
50
68
  - `Empty` - Empty state component
51
- - `StatusBadge` - Badge component with status colors
69
+ - `StatusBadge`, `StatusRole` - Status badge components
52
70
  - `HeaderToolsToggleButton`, `HeaderToolsContent` - Header tools dropdown
53
71
 
54
72
  ### Table Components
@@ -56,27 +74,20 @@ function App() {
56
74
  - `MoveLeftIcon`, `MoveRightIcon`, `RenameIcon`, `DeleteIcon` - Table action icons
57
75
 
58
76
  ### Menu Components
59
- - `PopupMenuButton` - Popup menu trigger button
60
- - `MenuItem` - Menu item component
61
- - `SubMenuButton` - Submenu button component
62
- - `MenuContext` - Menu context provider
63
- - `COLOR_MAP` - Color mapping for menu items
77
+ - `PopupMenuButton` - Popup menu button
78
+ - `MenuItem`, `SubMenuButton`, `MenuContext`, `COLOR_MAP` - Menu system components
64
79
 
65
80
  ### Tree Components
66
- - `FlatTree` - Flat tree component
67
81
  - `ROOT_KEY`, `SUFFIX_NODE_KEY` - Tree node key constants
68
82
  - `PlusSquareO`, `MinusSquareO`, `CloseSquareO`, `EyeO` - Tree icons
69
83
 
70
- ### Text Components
71
- - `LinkifyText` - Text component that converts URLs to clickable links
72
-
73
- ### Utilities / Hooks
84
+ ### Utilities & Hooks
74
85
  - `useMobile()` - Detect mobile device
75
86
  - `useBoolean()` - Boolean state hook
76
- - `classNames()` - Conditional class name utility
77
- - `getNumberWithDecimal()` - Number formatting utilities
87
+ - Number formatting utilities (e.g., `getNumberWithDecimal()`)
88
+ - `classNames()` - Classname utility
89
+ - Contexts: `NavSizeContext`, `BaseZIndexContext`, `MenuContext`
78
90
  - Extension context utilities
79
- - `NavSizeContext` - Navigation size context
80
91
 
81
92
  ## Theming
82
93
 
@@ -89,78 +100,3 @@ Components are themed using CSS variables. You can customize the theme by overri
89
100
  /* ... */
90
101
  }
91
102
  ```
92
-
93
- ## Development
94
-
95
- ### Component Development with Ladle
96
-
97
- This package uses [Ladle](https://ladle.dev/) for component development and testing. Ladle provides a fast, lightweight alternative to Storybook for developing React components in isolation.
98
-
99
- #### Prerequisites
100
-
101
- Make sure you have dependencies installed:
102
-
103
- ```bash
104
- pnpm install
105
- ```
106
-
107
- #### Starting the Development Server
108
-
109
- To start the Ladle development server:
110
-
111
- ```bash
112
- pnpm ladle serve
113
- ```
114
-
115
- This will:
116
- - Start a local development server (typically at `http://localhost:61000`)
117
- - Watch for changes in your component stories
118
- - Provide hot module replacement for fast development
119
- - Display all your component stories in an interactive UI
120
-
121
- #### Writing Stories
122
-
123
- Stories are located alongside components with the `.stories.tsx` extension. For example:
124
-
125
- ```tsx
126
- // src/common/Button.stories.tsx
127
- import type { Story } from '@ladle/react'
128
- import { Button } from './Button'
129
-
130
- export const Default: Story = () => <Button>Click me</Button>
131
-
132
- export const Primary: Story = () => <Button variant="primary">Primary</Button>
133
-
134
- export const Disabled: Story = () => <Button disabled>Disabled</Button>
135
- ```
136
-
137
- #### Available Story Examples
138
-
139
- Check out existing stories in the `src/` directory:
140
- - `src/common/NewButton.stories.tsx` - Button component examples
141
- - `src/common/dialog/BaseDialog.stories.tsx` - Dialog examples
142
- - `src/common/table/ResizeTable.stories.tsx` - Table examples
143
- - `src/common/tree/FlatTree.stories.tsx` - Tree component examples
144
- - And many more...
145
-
146
- #### Building for Production
147
-
148
- To build the package:
149
-
150
- ```bash
151
- pnpm build
152
- ```
153
-
154
- This will:
155
- 1. Build CSS with Tailwind (`pnpm build:css`)
156
- 2. Build JavaScript/TypeScript with tsup (`pnpm build:js`)
157
-
158
- #### Watch Mode for Development
159
-
160
- If you're developing this package alongside another package:
161
-
162
- ```bash
163
- pnpm dev
164
- ```
165
-
166
- This runs both CSS and JS builds in watch mode concurrently.
package/dist/index.css CHANGED
@@ -1852,27 +1852,18 @@ video {
1852
1852
  .h-\[18px\] {
1853
1853
  height: 18px;
1854
1854
  }
1855
- .h-\[1em\] {
1856
- height: 1em;
1857
- }
1858
1855
  .h-\[200px\] {
1859
1856
  height: 200px;
1860
1857
  }
1861
1858
  .h-full {
1862
1859
  height: 100%;
1863
1860
  }
1864
- .max-h-0 {
1865
- max-height: 0px;
1866
- }
1867
1861
  .max-h-60 {
1868
1862
  max-height: 15rem;
1869
1863
  }
1870
1864
  .max-h-96 {
1871
1865
  max-height: 24rem;
1872
1866
  }
1873
- .max-h-\[2000px\] {
1874
- max-height: 2000px;
1875
- }
1876
1867
  .min-h-\[24px\] {
1877
1868
  min-height: 24px;
1878
1869
  }
@@ -1927,9 +1918,6 @@ video {
1927
1918
  .w-\[18px\] {
1928
1919
  width: 18px;
1929
1920
  }
1930
- .w-\[1em\] {
1931
- width: 1em;
1932
- }
1933
1921
  .w-\[30px\] {
1934
1922
  width: 30px;
1935
1923
  }
@@ -2369,9 +2357,6 @@ video {
2369
2357
  .bg-yellow-500 {
2370
2358
  background-color: rgba(var(--yellow-500));
2371
2359
  }
2372
- .fill-gray {
2373
- fill: rgba(var(--gray-600));
2374
- }
2375
2360
  .p-1 {
2376
2361
  padding: 0.25rem;
2377
2362
  }
@@ -2949,9 +2934,6 @@ video {
2949
2934
  .hover\:bg-yellow-600:hover {
2950
2935
  background-color: rgba(var(--yellow-600));
2951
2936
  }
2952
- .hover\:fill-primary-500:hover {
2953
- fill: rgba(var(--primary-500));
2954
- }
2955
2937
  .hover\:text-gray-500:hover {
2956
2938
  color: rgba(var(--gray-500));
2957
2939
  }
@@ -3185,12 +3167,12 @@ video {
3185
3167
  .dark\:hover\:bg-sentio-gray-400:hover:where(.dark, .dark *) {
3186
3168
  background-color: rgba(var(--sentio-gray-400));
3187
3169
  }
3188
- .dark\:hover\:fill-primary-700:hover:where(.dark, .dark *) {
3189
- fill: rgba(var(--primary-700));
3190
- }
3191
3170
  .dark\:hover\:text-gray-700:hover:where(.dark, .dark *) {
3192
3171
  color: rgba(var(--gray-700));
3193
3172
  }
3173
+ .dark\:hover\:text-primary-700:hover:where(.dark, .dark *) {
3174
+ color: rgba(var(--primary-700));
3175
+ }
3194
3176
  .dark\:focus\:ring-gray-800:focus:where(.dark, .dark *) {
3195
3177
  --tw-ring-color: rgba(var(--gray-800));
3196
3178
  }