@app-studio/web 0.8.76 → 0.8.77
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 +171 -0
- package/dist/components/Chart/Chart/ChartColors.d.ts +20 -0
- package/dist/components/Separator/Separator.d.ts +1 -0
- package/dist/web.cjs.development.js +36 -5
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +36 -6
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +40 -8
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# App Studio Web Component Library
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
A comprehensive, accessible, and customizable React component library built with TypeScript and App Studio. This library provides a wide range of UI components designed to help you build beautiful and functional web applications quickly and efficiently.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- **40+ UI Components**: From basic elements to complex interactive components
|
|
13
|
+
- **Fully Typed**: Built with TypeScript for better developer experience
|
|
14
|
+
- **Accessible**: Follows WCAG guidelines for accessibility
|
|
15
|
+
- **Customizable**: Easily theme and style components to match your brand
|
|
16
|
+
- **Responsive**: Works across all device sizes
|
|
17
|
+
- **Form Integration**: Seamless integration with Formik for form handling
|
|
18
|
+
- **Modern Design**: Clean, consistent design following best practices
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @app-studio/web
|
|
24
|
+
# or
|
|
25
|
+
yarn add @app-studio/web
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import { Button, Text } from '@app-studio/web';
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
<Text>Hello, world!</Text>
|
|
38
|
+
<Button onClick={() => alert('Clicked!')}>Click me</Button>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Component Categories
|
|
45
|
+
|
|
46
|
+
### Layout Components
|
|
47
|
+
- View
|
|
48
|
+
- Center
|
|
49
|
+
- Horizontal
|
|
50
|
+
- Vertical
|
|
51
|
+
- AspectRatio
|
|
52
|
+
- Separator
|
|
53
|
+
- Resizable
|
|
54
|
+
|
|
55
|
+
### Form Components
|
|
56
|
+
- Checkbox
|
|
57
|
+
- Radio
|
|
58
|
+
- Select
|
|
59
|
+
- Switch
|
|
60
|
+
- TextArea
|
|
61
|
+
- TextField
|
|
62
|
+
- OTPInput
|
|
63
|
+
|
|
64
|
+
### Navigation Components
|
|
65
|
+
- Accordion
|
|
66
|
+
- Menubar
|
|
67
|
+
- NavigationMenu
|
|
68
|
+
- Pagination
|
|
69
|
+
- Sidebar
|
|
70
|
+
- Tabs
|
|
71
|
+
|
|
72
|
+
### Feedback Components
|
|
73
|
+
- Alert
|
|
74
|
+
- Modal
|
|
75
|
+
- Toast
|
|
76
|
+
- Tooltip
|
|
77
|
+
|
|
78
|
+
### Data Display Components
|
|
79
|
+
- Avatar
|
|
80
|
+
- Badge
|
|
81
|
+
- Card
|
|
82
|
+
- Table
|
|
83
|
+
- Chart
|
|
84
|
+
|
|
85
|
+
### Utility Components
|
|
86
|
+
- Button
|
|
87
|
+
- Gradient
|
|
88
|
+
- Loader
|
|
89
|
+
- Text
|
|
90
|
+
|
|
91
|
+
### Interactive Components
|
|
92
|
+
- Carousel
|
|
93
|
+
- ContextMenu
|
|
94
|
+
- DropdownMenu
|
|
95
|
+
- HoverCard
|
|
96
|
+
- Slider
|
|
97
|
+
- Toggle
|
|
98
|
+
- ToggleGroup
|
|
99
|
+
|
|
100
|
+
## Design System
|
|
101
|
+
|
|
102
|
+
All components follow a consistent design system with:
|
|
103
|
+
|
|
104
|
+
- **Typography**: Inter/Geist font, specific sizes/weights
|
|
105
|
+
- **Spacing**: 4px grid system
|
|
106
|
+
- **Colors**: Neutral palette with semantic colors
|
|
107
|
+
- **Rounded corners**: Consistent border radius
|
|
108
|
+
- **Transitions**: Subtle animations
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
### Prerequisites
|
|
113
|
+
|
|
114
|
+
- Node.js (>= 10.x)
|
|
115
|
+
- npm or yarn
|
|
116
|
+
|
|
117
|
+
### Setup
|
|
118
|
+
|
|
119
|
+
1. Clone the repository
|
|
120
|
+
```bash
|
|
121
|
+
git clone https://github.com/your-org/app-studio-web.git
|
|
122
|
+
cd app-studio-web
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
2. Install dependencies
|
|
126
|
+
```bash
|
|
127
|
+
npm install
|
|
128
|
+
# or
|
|
129
|
+
yarn
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
3. Start the development server
|
|
133
|
+
```bash
|
|
134
|
+
npm start
|
|
135
|
+
# or
|
|
136
|
+
yarn start
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Available Scripts
|
|
140
|
+
|
|
141
|
+
- `npm start` - Start the development server
|
|
142
|
+
- `npm run build` - Build the library for production
|
|
143
|
+
- `npm test` - Run tests
|
|
144
|
+
- `npm run storybook` - Start Storybook for component development
|
|
145
|
+
- `npm run lint` - Run ESLint
|
|
146
|
+
- `npm run lint:fix` - Fix ESLint issues
|
|
147
|
+
- `npm run prettier` - Run Prettier
|
|
148
|
+
- `npm run prettier:fix` - Fix Prettier issues
|
|
149
|
+
|
|
150
|
+
## Contributing
|
|
151
|
+
|
|
152
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details.
|
|
153
|
+
|
|
154
|
+
### Creating New Components
|
|
155
|
+
|
|
156
|
+
Use our component creation script to scaffold new components:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm run create-structure -- --name=YourComponentName
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
165
|
+
|
|
166
|
+
## Acknowledgements
|
|
167
|
+
|
|
168
|
+
- Built with [React](https://reactjs.org/)
|
|
169
|
+
- Styled with [App Studio](https://app-studio.dev/)
|
|
170
|
+
- Form handling with [Formik](https://formik.org/)
|
|
171
|
+
- State management with [Zustand](https://github.com/pmndrs/zustand)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart Colors
|
|
3
|
+
*
|
|
4
|
+
* Defines a consistent color scheme for all chart examples.
|
|
5
|
+
* These colors should be used in the same order across all chart types
|
|
6
|
+
* to ensure consistency between the charts and their legends.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CHART_COLORS: {
|
|
9
|
+
blue: string;
|
|
10
|
+
green: string;
|
|
11
|
+
purple: string;
|
|
12
|
+
orange: string;
|
|
13
|
+
red: string;
|
|
14
|
+
teal: string;
|
|
15
|
+
pink: string;
|
|
16
|
+
indigo: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
cyan: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const DEFAULT_CHART_COLORS: string[];
|
|
@@ -29,7 +29,6 @@ require('core-js/modules/web.url.js');
|
|
|
29
29
|
require('core-js/modules/web.url.to-json.js');
|
|
30
30
|
require('core-js/modules/web.url-search-params.js');
|
|
31
31
|
var zustand = require('zustand');
|
|
32
|
-
require('src/components/Badge/Badge');
|
|
33
32
|
require('core-js/modules/es.string.ends-with.js');
|
|
34
33
|
require('core-js/modules/es.string.match.js');
|
|
35
34
|
require('core-js/modules/es.string.search.js');
|
|
@@ -4755,8 +4754,32 @@ Carousel.Item = CarouselItemComponent; // Compound component pattern
|
|
|
4755
4754
|
Carousel.Previous = CarouselPreviousComponent; // Compound component pattern
|
|
4756
4755
|
Carousel.Next = CarouselNextComponent; // Compound component pattern
|
|
4757
4756
|
|
|
4757
|
+
/**
|
|
4758
|
+
* Chart Colors
|
|
4759
|
+
*
|
|
4760
|
+
* Defines a consistent color scheme for all chart examples.
|
|
4761
|
+
* These colors should be used in the same order across all chart types
|
|
4762
|
+
* to ensure consistency between the charts and their legends.
|
|
4763
|
+
*/
|
|
4764
|
+
var CHART_COLORS = {
|
|
4765
|
+
// Primary colors for all charts
|
|
4766
|
+
blue: 'color.blue.500',
|
|
4767
|
+
green: 'color.green.500',
|
|
4768
|
+
purple: 'color.purple.500',
|
|
4769
|
+
orange: 'color.orange.500',
|
|
4770
|
+
red: 'color.red.500',
|
|
4771
|
+
// Additional colors if needed
|
|
4772
|
+
teal: 'color.teal.500',
|
|
4773
|
+
pink: 'color.pink.500',
|
|
4774
|
+
indigo: 'color.indigo.500',
|
|
4775
|
+
yellow: 'color.yellow.500',
|
|
4776
|
+
cyan: 'color.cyan.500'
|
|
4777
|
+
};
|
|
4778
|
+
// Default color array for consistent ordering
|
|
4779
|
+
var DEFAULT_CHART_COLORS = [CHART_COLORS.blue, CHART_COLORS.green, CHART_COLORS.purple, CHART_COLORS.orange, CHART_COLORS.red, CHART_COLORS.teal, CHART_COLORS.pink, CHART_COLORS.indigo, CHART_COLORS.yellow, CHART_COLORS.cyan];
|
|
4780
|
+
|
|
4758
4781
|
// Default colors for chart series
|
|
4759
|
-
var DEFAULT_COLORS =
|
|
4782
|
+
var DEFAULT_COLORS = DEFAULT_CHART_COLORS;
|
|
4760
4783
|
// Default styles for chart container
|
|
4761
4784
|
var ChartContainerStyles = {
|
|
4762
4785
|
width: '100%',
|
|
@@ -5000,6 +5023,9 @@ var BarChart = _ref => {
|
|
|
5000
5023
|
hideTooltip,
|
|
5001
5024
|
views
|
|
5002
5025
|
} = _ref;
|
|
5026
|
+
var {
|
|
5027
|
+
getColor
|
|
5028
|
+
} = appStudio.useTheme();
|
|
5003
5029
|
// Calculate chart dimensions
|
|
5004
5030
|
var padding = {
|
|
5005
5031
|
top: 20,
|
|
@@ -5093,7 +5119,7 @@ var BarChart = _ref => {
|
|
|
5093
5119
|
y: y,
|
|
5094
5120
|
width: barWidth,
|
|
5095
5121
|
height: barHeight,
|
|
5096
|
-
fill: series.color,
|
|
5122
|
+
fill: series.color ? getColor(series.color) : 'black',
|
|
5097
5123
|
onMouseEnter: handleMouseEnter,
|
|
5098
5124
|
onMouseLeave: hideTooltip,
|
|
5099
5125
|
onClick: handleClick
|
|
@@ -5114,6 +5140,9 @@ var LineChart = _ref => {
|
|
|
5114
5140
|
views
|
|
5115
5141
|
} = _ref;
|
|
5116
5142
|
// Calculate chart dimensions
|
|
5143
|
+
var {
|
|
5144
|
+
getColor
|
|
5145
|
+
} = appStudio.useTheme();
|
|
5117
5146
|
var padding = {
|
|
5118
5147
|
top: 20,
|
|
5119
5148
|
right: 20,
|
|
@@ -5204,11 +5233,11 @@ var LineChart = _ref => {
|
|
|
5204
5233
|
key: "series-" + seriesIndex
|
|
5205
5234
|
}, /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
5206
5235
|
d: generateAreaPath(series.data),
|
|
5207
|
-
fill: series.color,
|
|
5236
|
+
fill: series.color ? getColor(series.color) : 'black',
|
|
5208
5237
|
opacity: 0.1
|
|
5209
5238
|
}, views == null ? void 0 : views.area)), /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
5210
5239
|
d: generatePath(series.data),
|
|
5211
|
-
stroke: series.color
|
|
5240
|
+
stroke: series.color ? getColor(series.color) : 'black'
|
|
5212
5241
|
}, LineStyles, views == null ? void 0 : views.line)), series.data.map((value, dataIndex) => {
|
|
5213
5242
|
var x = padding.left + dataIndex / (data.labels.length - 1) * chartWidth;
|
|
5214
5243
|
var y = height - padding.bottom - value / maxValue * chartHeight * animationProgress;
|
|
@@ -15242,6 +15271,7 @@ var SeparatorComponent = props => {
|
|
|
15242
15271
|
return /*#__PURE__*/React__default.createElement(SeparatorView, Object.assign({}, props));
|
|
15243
15272
|
};
|
|
15244
15273
|
var Separator = SeparatorComponent;
|
|
15274
|
+
var Divider = SeparatorComponent;
|
|
15245
15275
|
|
|
15246
15276
|
var useSidebarState = function useSidebarState(defaultExpanded, expanded, onExpandedChange, breakpoint) {
|
|
15247
15277
|
if (defaultExpanded === void 0) {
|
|
@@ -17841,6 +17871,7 @@ exports.CountryPicker = CountryPicker;
|
|
|
17841
17871
|
exports.CropIcon = CropIcon;
|
|
17842
17872
|
exports.DatePicker = DatePicker;
|
|
17843
17873
|
exports.DeleteIcon = DeleteIcon;
|
|
17874
|
+
exports.Divider = Divider;
|
|
17844
17875
|
exports.DocumentIcon = DocumentIcon;
|
|
17845
17876
|
exports.DownloadIcon = DownloadIcon;
|
|
17846
17877
|
exports.DragAndDrop = DragAndDrop;
|