@emporix/component-library 1.0.0

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 ADDED
@@ -0,0 +1,294 @@
1
+ # Emporix Component Library
2
+
3
+ A modern React component library built with TypeScript, Vite, and SCSS modules.
4
+
5
+ ## Features
6
+
7
+ - ๐Ÿš€ **Modern Stack**: Built with Vite, TypeScript, and React 18
8
+ - ๐ŸŽจ **Styled Components**: SCSS modules for component styling
9
+ - ๐Ÿ“š **Storybook**: Interactive component documentation
10
+ - ๐Ÿงช **Testing**: Comprehensive test suite with Vitest and React Testing Library
11
+ - ๐Ÿ“ฆ **Library Build**: Optimized for npm package distribution
12
+ - ๐Ÿ”„ **CI/CD**: Automated testing and publishing pipeline
13
+
14
+ ## Quick Start
15
+
16
+ ### Installation
17
+
18
+ ```bash
19
+ npm install @emporix/component-library
20
+ ```
21
+
22
+ ### Usage
23
+
24
+ #### Method 1: Import styles in your main CSS file (Recommended)
25
+
26
+ ```css
27
+ /* In your main CSS file (e.g., index.css, App.css) */
28
+ @import '@emporix/component-library/styles';
29
+ ```
30
+
31
+ ```tsx
32
+ import { Button } from '@emporix/component-library'
33
+
34
+ const MyComponent = () => {
35
+ return (
36
+ <Button variant='primary' onClick={() => console.log('Clicked!')}>
37
+ Click me
38
+ </Button>
39
+ )
40
+ }
41
+ ```
42
+
43
+ #### Method 2: Import styles in your main JavaScript/TypeScript file
44
+
45
+ ```tsx
46
+ import { Button } from '@emporix/component-library'
47
+ import '@emporix/component-library/styles'
48
+
49
+ const MyComponent = () => {
50
+ return (
51
+ <Button variant='primary' onClick={() => console.log('Clicked!')}>
52
+ Click me
53
+ </Button>
54
+ )
55
+ }
56
+ ```
57
+
58
+ #### Method 3: Copy CSS file manually
59
+
60
+ If the above methods don't work, you can copy the CSS file from `node_modules/@emporix/component-library/dist/style.css` to your project and import it directly.
61
+
62
+ ## Theming with CSS Variables
63
+
64
+ The component library uses CSS variables for easy theming. You can customize the appearance by overriding these variables:
65
+
66
+ ```css
67
+ :root {
68
+ --color-primary: #your-primary-color;
69
+ --color-primary-hover: #your-primary-hover-color;
70
+ --color-secondary: #your-secondary-color;
71
+ --border-radius-md: 0.5rem;
72
+ --font-size-base: 1.1rem;
73
+ /* ... other variables */
74
+ }
75
+ ```
76
+
77
+ Available CSS variables:
78
+
79
+ - **Colors**: `--color-primary`, `--color-secondary`, `--color-success`, `--color-danger`, `--color-warning`, `--color-info`, `--color-light`, `--color-dark`
80
+ - **Border Radius**: `--border-radius-sm`, `--border-radius-md`, `--border-radius-lg`
81
+ - **Font Sizes**: `--font-size-sm`, `--font-size-base`, `--font-size-lg`
82
+ - **Font Weight**: `--font-weight-medium`
83
+ - **Transitions**: `--transition-fast`, `--transition-normal`, `--transition-slow`
84
+ - **Z-Index Layers**: `--z-dropdown`, `--z-modal`, `--z-tooltip`, etc.
85
+ - **Component Variables**: `--button-padding-md`, `--input-padding-lg`, `--card-padding`, etc.
86
+
87
+ For a complete reference of all available CSS variables, see [CSS_VARIABLES.md](./CSS_VARIABLES.md).
88
+
89
+ ## Development
90
+
91
+ ### Prerequisites
92
+
93
+ - Node.js 18+
94
+ - npm or yarn
95
+
96
+ ### Setup
97
+
98
+ ```bash
99
+ # Clone the repository
100
+ git clone <repository-url>
101
+ cd component-library
102
+
103
+ # Install dependencies
104
+ npm install
105
+
106
+ # Start development server
107
+ npm run dev
108
+
109
+ # Start Storybook
110
+ npm run storybook
111
+ ```
112
+
113
+ ### Available Scripts
114
+
115
+ - `npm run dev` - Start development server with showcase
116
+ - `npm run build` - Build the development version
117
+ - `npm run build:lib` - Build the library for distribution
118
+ - `npm run test` - Run tests
119
+ - `npm run test:ui` - Run tests with UI
120
+ - `npm run test:coverage` - Run tests with coverage
121
+ - `npm run storybook` - Start Storybook
122
+ - `npm run build-storybook` - Build Storybook
123
+ - `npm run lint` - Run ESLint
124
+ - `npm run lint:fix` - Fix ESLint issues
125
+ - `npm run type-check` - Run TypeScript type checking
126
+ - `npm run format` - Format code with Prettier
127
+ - `npm run format:check` - Check code formatting
128
+
129
+ ## Components
130
+
131
+ ### Button
132
+
133
+ A versatile button component with multiple variants and sizes.
134
+
135
+ ```tsx
136
+ import { Button } from '@emporix/component-library'
137
+
138
+ // Variants
139
+ <Button variant="primary">Primary</Button>
140
+ <Button variant="secondary">Secondary</Button>
141
+ <Button variant="success">Success</Button>
142
+ <Button variant="danger">Danger</Button>
143
+
144
+ // Sizes
145
+ <Button size="sm">Small</Button>
146
+ <Button size="md">Medium</Button>
147
+ <Button size="lg">Large</Button>
148
+
149
+ // States
150
+ <Button disabled>Disabled</Button>
151
+ <Button fullWidth>Full Width</Button>
152
+ ```
153
+
154
+ #### Props
155
+
156
+ | Prop | Type | Default | Description |
157
+ | ----------- | --------------------------------------------------------------------------------------------- | --------- | ------------------------------- |
158
+ | children | ReactNode | - | Button content |
159
+ | variant | 'primary' \| 'secondary' \| 'success' \| 'danger' \| 'warning' \| 'info' \| 'light' \| 'dark' | 'primary' | Button variant |
160
+ | size | 'sm' \| 'md' \| 'lg' | 'md' | Button size |
161
+ | disabled | boolean | false | Whether button is disabled |
162
+ | fullWidth | boolean | false | Whether button takes full width |
163
+ | type | 'button' \| 'submit' \| 'reset' | 'button' | Button type |
164
+ | onClick | (event: MouseEvent) => void | - | Click handler |
165
+ | className | string | - | Additional CSS class |
166
+ | data-testid | string | - | Test ID for testing |
167
+
168
+ ## Testing
169
+
170
+ The library includes comprehensive tests using Vitest and React Testing Library.
171
+
172
+ ```bash
173
+ # Run all tests
174
+ npm test
175
+
176
+ # Run tests with coverage
177
+ npm run test:coverage
178
+
179
+ # Run tests with UI
180
+ npm run test:ui
181
+ ```
182
+
183
+ ## Storybook
184
+
185
+ Interactive component documentation is available in Storybook.
186
+
187
+ ```bash
188
+ # Start Storybook
189
+ npm run storybook
190
+
191
+ # Build Storybook
192
+ npm run build-storybook
193
+ ```
194
+
195
+ ## Building for Distribution
196
+
197
+ The library is built using Vite with optimized settings for npm distribution.
198
+
199
+ ```bash
200
+ # Build the library
201
+ npm run build:lib
202
+ ```
203
+
204
+ The build output includes:
205
+
206
+ - ES modules (`index.es.js`)
207
+ - UMD bundle (`index.umd.js`)
208
+ - TypeScript declarations (`index.d.ts`)
209
+ - CSS styles (`styles.css`)
210
+
211
+ ## Code Formatting
212
+
213
+ This project uses Prettier for consistent code formatting. The configuration is defined in `.prettierrc`.
214
+
215
+ ```bash
216
+ # Format all files
217
+ npm run format
218
+
219
+ # Check if files are formatted correctly
220
+ npm run format:check
221
+ ```
222
+
223
+ The project also includes pre-commit hooks that automatically format staged files before commits.
224
+
225
+ ## Contributing
226
+
227
+ 1. Fork the repository
228
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
229
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
230
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
231
+ 5. Open a Pull Request
232
+
233
+ ### Development Guidelines
234
+
235
+ - Follow TypeScript best practices
236
+ - Write tests for new components
237
+ - Add Storybook stories for components
238
+ - Follow the existing code style
239
+ - Update documentation as needed
240
+ - Use arrow functions for React components (enforced by ESLint)
241
+ - Avoid using `React.FC` type annotation (redundant with modern TypeScript)
242
+
243
+ ## License
244
+
245
+ MIT License - see [LICENSE](LICENSE) file for details.
246
+
247
+ ## Troubleshooting
248
+
249
+ ### Import Issues
250
+
251
+ If you encounter import errors like "Failed to resolve entry for package", ensure:
252
+
253
+ 1. The package is properly installed: `npm install @emporix/component-library`
254
+ 2. You're using the correct import syntax:
255
+ ```tsx
256
+ import { Button } from '@emporix/component-library'
257
+ import '@emporix/component-library/styles'
258
+ ```
259
+ 3. Your bundler supports ES modules and the package.json exports field
260
+
261
+ ### Styling Issues
262
+
263
+ If the Button component appears unstyled or you get "styles not found" errors:
264
+
265
+ 1. **Try Method 1 (Recommended):** Import styles in your main CSS file:
266
+
267
+ ```css
268
+ @import '@emporix/component-library/styles';
269
+ ```
270
+
271
+ 2. **Try Method 2:** Import styles in your main JavaScript/TypeScript file:
272
+
273
+ ```tsx
274
+ import '@emporix/component-library/styles'
275
+ ```
276
+
277
+ 3. **If both methods fail:** Copy the CSS file manually:
278
+ - Copy `node_modules/@emporix/component-library/dist/style.css` to your project
279
+ - Import it in your main CSS file: `@import './path/to/style.css';`
280
+
281
+ 4. **Check your bundler configuration:** Ensure your bundler (Vite, Webpack, etc.) is configured to handle CSS imports from node_modules
282
+
283
+ 5. **Verify the CSS classes:** The component uses SCSS modules with hashed class names (e.g., `_button_184r1_20`, `_primary_184r1_45`) and CSS variables for theming
284
+
285
+ ### TypeScript Issues
286
+
287
+ If TypeScript can't find types, make sure:
288
+
289
+ 1. The `@types/react` package is installed
290
+ 2. Your `tsconfig.json` includes the library in `node_modules`
291
+
292
+ ## Support
293
+
294
+ For support and questions, please open an issue in the repository.
package/dist/App.d.ts ADDED
@@ -0,0 +1,4 @@
1
+
2
+ declare const App: () => import("react/jsx-runtime").JSX.Element;
3
+ export default App;
4
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAEA,OAAO,mCAAmC,CAAA;AAC1C,QAAA,MAAM,GAAG,+CAiGR,CAAA;AAED,eAAe,GAAG,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface ButtonProps {
4
+ /**
5
+ * The content of the button
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * The size of the button
10
+ */
11
+ size?: 'sm' | 'md' | 'lg';
12
+ /**
13
+ * Whether the button is disabled
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Whether the button should take full width
18
+ */
19
+ fullWidth?: boolean;
20
+ /**
21
+ * The type of the button
22
+ */
23
+ type?: 'button' | 'submit' | 'reset';
24
+ /**
25
+ * Click handler
26
+ */
27
+ onClick?: () => void;
28
+ /**
29
+ * Additional CSS class name
30
+ */
31
+ className?: string;
32
+ /**
33
+ * Test ID for testing
34
+ */
35
+ 'data-testid'?: string;
36
+ }
37
+ export declare const Button: ({ children, size, disabled, fullWidth, type, onClick, className, "data-testid": testId, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
38
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,MAAM,GAAI,oGAUpB,WAAW,4CAuBb,CAAA"}
@@ -0,0 +1,47 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ children, size, disabled, fullWidth, type, onClick, className, "data-testid": testId, ...props }: import('./Button').ButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ size: {
12
+ control: {
13
+ type: string;
14
+ };
15
+ options: string[];
16
+ };
17
+ disabled: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ };
22
+ fullWidth: {
23
+ control: {
24
+ type: string;
25
+ };
26
+ };
27
+ type: {
28
+ control: {
29
+ type: string;
30
+ };
31
+ options: string[];
32
+ };
33
+ };
34
+ args: {
35
+ onClick: import('@vitest/spy').Mock<[], void>;
36
+ };
37
+ };
38
+ export default meta;
39
+ type Story = StoryObj<typeof meta>;
40
+ export declare const Default: Story;
41
+ export declare const Small: Story;
42
+ export declare const Medium: Story;
43
+ export declare const Large: Story;
44
+ export declare const Disabled: Story;
45
+ export declare const FullWidth: Story;
46
+ export declare const AllSizes: Story;
47
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAItD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBqB,CAAA;AAE/B,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Button.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.test.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { Button } from './components/Button/Button';
2
+ export type { ButtonProps } from './components/Button/Button';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAG7D,OAAO,qBAAqB,CAAA"}
@@ -0,0 +1,668 @@
1
+ import Se from "react";
2
+ var H = { exports: {} }, I = {};
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var Oe;
13
+ function fr() {
14
+ if (Oe) return I;
15
+ Oe = 1;
16
+ var D = Se, R = Symbol.for("react.element"), S = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, C = D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function m(b, f, y) {
18
+ var p, g = {}, T = null, $ = null;
19
+ y !== void 0 && (T = "" + y), f.key !== void 0 && (T = "" + f.key), f.ref !== void 0 && ($ = f.ref);
20
+ for (p in f) h.call(f, p) && !P.hasOwnProperty(p) && (g[p] = f[p]);
21
+ if (b && b.defaultProps) for (p in f = b.defaultProps, f) g[p] === void 0 && (g[p] = f[p]);
22
+ return { $$typeof: R, type: b, key: T, ref: $, props: g, _owner: C.current };
23
+ }
24
+ return I.Fragment = S, I.jsx = m, I.jsxs = m, I;
25
+ }
26
+ var W = {};
27
+ /**
28
+ * @license React
29
+ * react-jsx-runtime.development.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */
36
+ var we;
37
+ function cr() {
38
+ return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
39
+ var D = Se, R = Symbol.for("react.element"), S = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), b = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), Z = Symbol.iterator, Ce = "@@iterator";
40
+ function Pe(e) {
41
+ if (e === null || typeof e != "object")
42
+ return null;
43
+ var r = Z && e[Z] || e[Ce];
44
+ return typeof r == "function" ? r : null;
45
+ }
46
+ var j = D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function c(e) {
48
+ {
49
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
50
+ t[n - 1] = arguments[n];
51
+ je("error", e, t);
52
+ }
53
+ }
54
+ function je(e, r, t) {
55
+ {
56
+ var n = j.ReactDebugCurrentFrame, i = n.getStackAddendum();
57
+ i !== "" && (r += "%s", t = t.concat([i]));
58
+ var u = t.map(function(o) {
59
+ return String(o);
60
+ });
61
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
62
+ }
63
+ }
64
+ var xe = !1, ke = !1, De = !1, Fe = !1, Ae = !1, Q;
65
+ Q = Symbol.for("react.module.reference");
66
+ function Ie(e) {
67
+ return !!(typeof e == "string" || typeof e == "function" || e === h || e === P || Ae || e === C || e === y || e === p || Fe || e === $ || xe || ke || De || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === g || e.$$typeof === m || e.$$typeof === b || e.$$typeof === f || // This needs to include all possible module reference object
68
+ // types supported by any Flight configuration anywhere since
69
+ // we don't know which Flight build this will end up being used
70
+ // with.
71
+ e.$$typeof === Q || e.getModuleId !== void 0));
72
+ }
73
+ function We(e, r, t) {
74
+ var n = e.displayName;
75
+ if (n)
76
+ return n;
77
+ var i = r.displayName || r.name || "";
78
+ return i !== "" ? t + "(" + i + ")" : t;
79
+ }
80
+ function ee(e) {
81
+ return e.displayName || "Context";
82
+ }
83
+ function E(e) {
84
+ if (e == null)
85
+ return null;
86
+ if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ return e.displayName || e.name || null;
88
+ if (typeof e == "string")
89
+ return e;
90
+ switch (e) {
91
+ case h:
92
+ return "Fragment";
93
+ case S:
94
+ return "Portal";
95
+ case P:
96
+ return "Profiler";
97
+ case C:
98
+ return "StrictMode";
99
+ case y:
100
+ return "Suspense";
101
+ case p:
102
+ return "SuspenseList";
103
+ }
104
+ if (typeof e == "object")
105
+ switch (e.$$typeof) {
106
+ case b:
107
+ var r = e;
108
+ return ee(r) + ".Consumer";
109
+ case m:
110
+ var t = e;
111
+ return ee(t._context) + ".Provider";
112
+ case f:
113
+ return We(e, e.render, "ForwardRef");
114
+ case g:
115
+ var n = e.displayName || null;
116
+ return n !== null ? n : E(e.type) || "Memo";
117
+ case T: {
118
+ var i = e, u = i._payload, o = i._init;
119
+ try {
120
+ return E(o(u));
121
+ } catch {
122
+ return null;
123
+ }
124
+ }
125
+ }
126
+ return null;
127
+ }
128
+ var O = Object.assign, F = 0, re, te, ne, ae, oe, ie, ue;
129
+ function se() {
130
+ }
131
+ se.__reactDisabledLog = !0;
132
+ function $e() {
133
+ {
134
+ if (F === 0) {
135
+ re = console.log, te = console.info, ne = console.warn, ae = console.error, oe = console.group, ie = console.groupCollapsed, ue = console.groupEnd;
136
+ var e = {
137
+ configurable: !0,
138
+ enumerable: !0,
139
+ value: se,
140
+ writable: !0
141
+ };
142
+ Object.defineProperties(console, {
143
+ info: e,
144
+ log: e,
145
+ warn: e,
146
+ error: e,
147
+ group: e,
148
+ groupCollapsed: e,
149
+ groupEnd: e
150
+ });
151
+ }
152
+ F++;
153
+ }
154
+ }
155
+ function Ye() {
156
+ {
157
+ if (F--, F === 0) {
158
+ var e = {
159
+ configurable: !0,
160
+ enumerable: !0,
161
+ writable: !0
162
+ };
163
+ Object.defineProperties(console, {
164
+ log: O({}, e, {
165
+ value: re
166
+ }),
167
+ info: O({}, e, {
168
+ value: te
169
+ }),
170
+ warn: O({}, e, {
171
+ value: ne
172
+ }),
173
+ error: O({}, e, {
174
+ value: ae
175
+ }),
176
+ group: O({}, e, {
177
+ value: oe
178
+ }),
179
+ groupCollapsed: O({}, e, {
180
+ value: ie
181
+ }),
182
+ groupEnd: O({}, e, {
183
+ value: ue
184
+ })
185
+ });
186
+ }
187
+ F < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ }
189
+ }
190
+ var N = j.ReactCurrentDispatcher, B;
191
+ function Y(e, r, t) {
192
+ {
193
+ if (B === void 0)
194
+ try {
195
+ throw Error();
196
+ } catch (i) {
197
+ var n = i.stack.trim().match(/\n( *(at )?)/);
198
+ B = n && n[1] || "";
199
+ }
200
+ return `
201
+ ` + B + e;
202
+ }
203
+ }
204
+ var J = !1, L;
205
+ {
206
+ var Le = typeof WeakMap == "function" ? WeakMap : Map;
207
+ L = new Le();
208
+ }
209
+ function le(e, r) {
210
+ if (!e || J)
211
+ return "";
212
+ {
213
+ var t = L.get(e);
214
+ if (t !== void 0)
215
+ return t;
216
+ }
217
+ var n;
218
+ J = !0;
219
+ var i = Error.prepareStackTrace;
220
+ Error.prepareStackTrace = void 0;
221
+ var u;
222
+ u = N.current, N.current = null, $e();
223
+ try {
224
+ if (r) {
225
+ var o = function() {
226
+ throw Error();
227
+ };
228
+ if (Object.defineProperty(o.prototype, "props", {
229
+ set: function() {
230
+ throw Error();
231
+ }
232
+ }), typeof Reflect == "object" && Reflect.construct) {
233
+ try {
234
+ Reflect.construct(o, []);
235
+ } catch (v) {
236
+ n = v;
237
+ }
238
+ Reflect.construct(e, [], o);
239
+ } else {
240
+ try {
241
+ o.call();
242
+ } catch (v) {
243
+ n = v;
244
+ }
245
+ e.call(o.prototype);
246
+ }
247
+ } else {
248
+ try {
249
+ throw Error();
250
+ } catch (v) {
251
+ n = v;
252
+ }
253
+ e();
254
+ }
255
+ } catch (v) {
256
+ if (v && n && typeof v.stack == "string") {
257
+ for (var a = v.stack.split(`
258
+ `), d = n.stack.split(`
259
+ `), s = a.length - 1, l = d.length - 1; s >= 1 && l >= 0 && a[s] !== d[l]; )
260
+ l--;
261
+ for (; s >= 1 && l >= 0; s--, l--)
262
+ if (a[s] !== d[l]) {
263
+ if (s !== 1 || l !== 1)
264
+ do
265
+ if (s--, l--, l < 0 || a[s] !== d[l]) {
266
+ var _ = `
267
+ ` + a[s].replace(" at new ", " at ");
268
+ return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, _), _;
269
+ }
270
+ while (s >= 1 && l >= 0);
271
+ break;
272
+ }
273
+ }
274
+ } finally {
275
+ J = !1, N.current = u, Ye(), Error.prepareStackTrace = i;
276
+ }
277
+ var k = e ? e.displayName || e.name : "", w = k ? Y(k) : "";
278
+ return typeof e == "function" && L.set(e, w), w;
279
+ }
280
+ function Ve(e, r, t) {
281
+ return le(e, !1);
282
+ }
283
+ function Me(e) {
284
+ var r = e.prototype;
285
+ return !!(r && r.isReactComponent);
286
+ }
287
+ function V(e, r, t) {
288
+ if (e == null)
289
+ return "";
290
+ if (typeof e == "function")
291
+ return le(e, Me(e));
292
+ if (typeof e == "string")
293
+ return Y(e);
294
+ switch (e) {
295
+ case y:
296
+ return Y("Suspense");
297
+ case p:
298
+ return Y("SuspenseList");
299
+ }
300
+ if (typeof e == "object")
301
+ switch (e.$$typeof) {
302
+ case f:
303
+ return Ve(e.render);
304
+ case g:
305
+ return V(e.type, r, t);
306
+ case T: {
307
+ var n = e, i = n._payload, u = n._init;
308
+ try {
309
+ return V(u(i), r, t);
310
+ } catch {
311
+ }
312
+ }
313
+ }
314
+ return "";
315
+ }
316
+ var A = Object.prototype.hasOwnProperty, fe = {}, ce = j.ReactDebugCurrentFrame;
317
+ function M(e) {
318
+ if (e) {
319
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
320
+ ce.setExtraStackFrame(t);
321
+ } else
322
+ ce.setExtraStackFrame(null);
323
+ }
324
+ function Ue(e, r, t, n, i) {
325
+ {
326
+ var u = Function.call.bind(A);
327
+ for (var o in e)
328
+ if (u(e, o)) {
329
+ var a = void 0;
330
+ try {
331
+ if (typeof e[o] != "function") {
332
+ var d = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ throw d.name = "Invariant Violation", d;
334
+ }
335
+ a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ } catch (s) {
337
+ a = s;
338
+ }
339
+ a && !(a instanceof Error) && (M(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), M(null)), a instanceof Error && !(a.message in fe) && (fe[a.message] = !0, M(i), c("Failed %s type: %s", t, a.message), M(null));
340
+ }
341
+ }
342
+ }
343
+ var Ne = Array.isArray;
344
+ function q(e) {
345
+ return Ne(e);
346
+ }
347
+ function Be(e) {
348
+ {
349
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
+ return t;
351
+ }
352
+ }
353
+ function Je(e) {
354
+ try {
355
+ return de(e), !1;
356
+ } catch {
357
+ return !0;
358
+ }
359
+ }
360
+ function de(e) {
361
+ return "" + e;
362
+ }
363
+ function ve(e) {
364
+ if (Je(e))
365
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), de(e);
366
+ }
367
+ var pe = j.ReactCurrentOwner, qe = {
368
+ key: !0,
369
+ ref: !0,
370
+ __self: !0,
371
+ __source: !0
372
+ }, _e, be;
373
+ function Ke(e) {
374
+ if (A.call(e, "ref")) {
375
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
376
+ if (r && r.isReactWarning)
377
+ return !1;
378
+ }
379
+ return e.ref !== void 0;
380
+ }
381
+ function Ge(e) {
382
+ if (A.call(e, "key")) {
383
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
384
+ if (r && r.isReactWarning)
385
+ return !1;
386
+ }
387
+ return e.key !== void 0;
388
+ }
389
+ function ze(e, r) {
390
+ typeof e.ref == "string" && pe.current;
391
+ }
392
+ function Xe(e, r) {
393
+ {
394
+ var t = function() {
395
+ _e || (_e = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
396
+ };
397
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
398
+ get: t,
399
+ configurable: !0
400
+ });
401
+ }
402
+ }
403
+ function He(e, r) {
404
+ {
405
+ var t = function() {
406
+ be || (be = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
407
+ };
408
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
409
+ get: t,
410
+ configurable: !0
411
+ });
412
+ }
413
+ }
414
+ var Ze = function(e, r, t, n, i, u, o) {
415
+ var a = {
416
+ // This tag allows us to uniquely identify this as a React Element
417
+ $$typeof: R,
418
+ // Built-in properties that belong on the element
419
+ type: e,
420
+ key: r,
421
+ ref: t,
422
+ props: o,
423
+ // Record the component responsible for creating this element.
424
+ _owner: u
425
+ };
426
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
427
+ configurable: !1,
428
+ enumerable: !1,
429
+ writable: !0,
430
+ value: !1
431
+ }), Object.defineProperty(a, "_self", {
432
+ configurable: !1,
433
+ enumerable: !1,
434
+ writable: !1,
435
+ value: n
436
+ }), Object.defineProperty(a, "_source", {
437
+ configurable: !1,
438
+ enumerable: !1,
439
+ writable: !1,
440
+ value: i
441
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
442
+ };
443
+ function Qe(e, r, t, n, i) {
444
+ {
445
+ var u, o = {}, a = null, d = null;
446
+ t !== void 0 && (ve(t), a = "" + t), Ge(r) && (ve(r.key), a = "" + r.key), Ke(r) && (d = r.ref, ze(r, i));
447
+ for (u in r)
448
+ A.call(r, u) && !qe.hasOwnProperty(u) && (o[u] = r[u]);
449
+ if (e && e.defaultProps) {
450
+ var s = e.defaultProps;
451
+ for (u in s)
452
+ o[u] === void 0 && (o[u] = s[u]);
453
+ }
454
+ if (a || d) {
455
+ var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
+ a && Xe(o, l), d && He(o, l);
457
+ }
458
+ return Ze(e, a, d, i, n, pe.current, o);
459
+ }
460
+ }
461
+ var K = j.ReactCurrentOwner, ge = j.ReactDebugCurrentFrame;
462
+ function x(e) {
463
+ if (e) {
464
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
465
+ ge.setExtraStackFrame(t);
466
+ } else
467
+ ge.setExtraStackFrame(null);
468
+ }
469
+ var G;
470
+ G = !1;
471
+ function z(e) {
472
+ return typeof e == "object" && e !== null && e.$$typeof === R;
473
+ }
474
+ function he() {
475
+ {
476
+ if (K.current) {
477
+ var e = E(K.current.type);
478
+ if (e)
479
+ return `
480
+
481
+ Check the render method of \`` + e + "`.";
482
+ }
483
+ return "";
484
+ }
485
+ }
486
+ function er(e) {
487
+ return "";
488
+ }
489
+ var ye = {};
490
+ function rr(e) {
491
+ {
492
+ var r = he();
493
+ if (!r) {
494
+ var t = typeof e == "string" ? e : e.displayName || e.name;
495
+ t && (r = `
496
+
497
+ Check the top-level render call using <` + t + ">.");
498
+ }
499
+ return r;
500
+ }
501
+ }
502
+ function Ee(e, r) {
503
+ {
504
+ if (!e._store || e._store.validated || e.key != null)
505
+ return;
506
+ e._store.validated = !0;
507
+ var t = rr(r);
508
+ if (ye[t])
509
+ return;
510
+ ye[t] = !0;
511
+ var n = "";
512
+ e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + E(e._owner.type) + "."), x(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), x(null);
513
+ }
514
+ }
515
+ function Re(e, r) {
516
+ {
517
+ if (typeof e != "object")
518
+ return;
519
+ if (q(e))
520
+ for (var t = 0; t < e.length; t++) {
521
+ var n = e[t];
522
+ z(n) && Ee(n, r);
523
+ }
524
+ else if (z(e))
525
+ e._store && (e._store.validated = !0);
526
+ else if (e) {
527
+ var i = Pe(e);
528
+ if (typeof i == "function" && i !== e.entries)
529
+ for (var u = i.call(e), o; !(o = u.next()).done; )
530
+ z(o.value) && Ee(o.value, r);
531
+ }
532
+ }
533
+ }
534
+ function tr(e) {
535
+ {
536
+ var r = e.type;
537
+ if (r == null || typeof r == "string")
538
+ return;
539
+ var t;
540
+ if (typeof r == "function")
541
+ t = r.propTypes;
542
+ else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
543
+ // Inner props are checked in the reconciler.
544
+ r.$$typeof === g))
545
+ t = r.propTypes;
546
+ else
547
+ return;
548
+ if (t) {
549
+ var n = E(r);
550
+ Ue(t, e.props, "prop", n, e);
551
+ } else if (r.PropTypes !== void 0 && !G) {
552
+ G = !0;
553
+ var i = E(r);
554
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
555
+ }
556
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ }
558
+ }
559
+ function nr(e) {
560
+ {
561
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
562
+ var n = r[t];
563
+ if (n !== "children" && n !== "key") {
564
+ x(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), x(null);
565
+ break;
566
+ }
567
+ }
568
+ e.ref !== null && (x(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), x(null));
569
+ }
570
+ }
571
+ var me = {};
572
+ function Te(e, r, t, n, i, u) {
573
+ {
574
+ var o = Ie(e);
575
+ if (!o) {
576
+ var a = "";
577
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
+ var d = er();
579
+ d ? a += d : a += he();
580
+ var s;
581
+ e === null ? s = "null" : q(e) ? s = "array" : e !== void 0 && e.$$typeof === R ? (s = "<" + (E(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
582
+ }
583
+ var l = Qe(e, r, t, i, u);
584
+ if (l == null)
585
+ return l;
586
+ if (o) {
587
+ var _ = r.children;
588
+ if (_ !== void 0)
589
+ if (n)
590
+ if (q(_)) {
591
+ for (var k = 0; k < _.length; k++)
592
+ Re(_[k], e);
593
+ Object.freeze && Object.freeze(_);
594
+ } else
595
+ c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ else
597
+ Re(_, e);
598
+ }
599
+ if (A.call(r, "key")) {
600
+ var w = E(e), v = Object.keys(r).filter(function(lr) {
601
+ return lr !== "key";
602
+ }), X = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
603
+ if (!me[w + X]) {
604
+ var sr = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
605
+ c(`A props object containing a "key" prop is being spread into JSX:
606
+ let props = %s;
607
+ <%s {...props} />
608
+ React keys must be passed directly to JSX without using spread:
609
+ let props = %s;
610
+ <%s key={someKey} {...props} />`, X, w, sr, w), me[w + X] = !0;
611
+ }
612
+ }
613
+ return e === h ? nr(l) : tr(l), l;
614
+ }
615
+ }
616
+ function ar(e, r, t) {
617
+ return Te(e, r, t, !0);
618
+ }
619
+ function or(e, r, t) {
620
+ return Te(e, r, t, !1);
621
+ }
622
+ var ir = or, ur = ar;
623
+ W.Fragment = h, W.jsx = ir, W.jsxs = ur;
624
+ }()), W;
625
+ }
626
+ process.env.NODE_ENV === "production" ? H.exports = fr() : H.exports = cr();
627
+ var dr = H.exports;
628
+ const vr = "_button_8tu5w_1", pr = "_sm_8tu5w_29", _r = "_md_8tu5w_36", br = "_lg_8tu5w_42", gr = "_fullWidth_8tu5w_49", hr = "_disabled_8tu5w_53", U = {
629
+ button: vr,
630
+ sm: pr,
631
+ md: _r,
632
+ lg: br,
633
+ fullWidth: gr,
634
+ disabled: hr
635
+ }, Er = ({
636
+ children: D,
637
+ size: R = "md",
638
+ disabled: S = !1,
639
+ fullWidth: h = !1,
640
+ type: C = "button",
641
+ onClick: P,
642
+ className: m = "",
643
+ "data-testid": b,
644
+ ...f
645
+ }) => {
646
+ const y = [
647
+ U.button,
648
+ U[R],
649
+ h ? U.fullWidth : "",
650
+ S ? U.disabled : "",
651
+ m
652
+ ].filter(Boolean).join(" ");
653
+ return /* @__PURE__ */ dr.jsx(
654
+ "button",
655
+ {
656
+ type: C,
657
+ className: y,
658
+ disabled: S,
659
+ onClick: P,
660
+ "data-testid": b,
661
+ ...f,
662
+ children: D
663
+ }
664
+ );
665
+ };
666
+ export {
667
+ Er as Button
668
+ };
@@ -0,0 +1,30 @@
1
+ (function(m,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(m=typeof globalThis<"u"?globalThis:m||self,C(m.EmporixComponentLibrary={},m.React))})(this,function(m,C){"use strict";var J={exports:{}},A={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ee;function Pe(){if(ee)return A;ee=1;var I=C,R=Symbol.for("react.element"),P=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,j=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function T(b,f,y){var p,g={},O=null,M=null;y!==void 0&&(O=""+y),f.key!==void 0&&(O=""+f.key),f.ref!==void 0&&(M=f.ref);for(p in f)h.call(f,p)&&!x.hasOwnProperty(p)&&(g[p]=f[p]);if(b&&b.defaultProps)for(p in f=b.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:R,type:b,key:O,ref:M,props:g,_owner:j.current}}return A.Fragment=P,A.jsx=T,A.jsxs=T,A}var W={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var re;function je(){return re||(re=1,process.env.NODE_ENV!=="production"&&function(){var I=C,R=Symbol.for("react.element"),P=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),b=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),te=Symbol.iterator,De="@@iterator";function Fe(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[De];return typeof r=="function"?r:null}var k=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ae("error",e,t)}}function Ae(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var We=!1,Ie=!1,Ye=!1,$e=!1,Le=!1,ne;ne=Symbol.for("react.module.reference");function Me(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===x||Le||e===j||e===y||e===p||$e||e===M||We||Ie||Ye||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===g||e.$$typeof===T||e.$$typeof===b||e.$$typeof===f||e.$$typeof===ne||e.getModuleId!==void 0))}function Ve(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ae(e){return e.displayName||"Context"}function E(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case P:return"Portal";case x:return"Profiler";case j:return"StrictMode";case y:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return ae(r)+".Consumer";case T:var t=e;return ae(t._context)+".Provider";case f:return Ve(e,e.render,"ForwardRef");case g:var n=e.displayName||null;return n!==null?n:E(e.type)||"Memo";case O:{var i=e,u=i._payload,o=i._init;try{return E(o(u))}catch{return null}}}return null}var w=Object.assign,Y=0,oe,ie,ue,se,le,fe,ce;function de(){}de.__reactDisabledLog=!0;function Ue(){{if(Y===0){oe=console.log,ie=console.info,ue=console.warn,se=console.error,le=console.group,fe=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Ne(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},e,{value:oe}),info:w({},e,{value:ie}),warn:w({},e,{value:ue}),error:w({},e,{value:se}),group:w({},e,{value:le}),groupCollapsed:w({},e,{value:fe}),groupEnd:w({},e,{value:ce})})}Y<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=k.ReactCurrentDispatcher,q;function V(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
18
+ `+q+e}}var G=!1,U;{var Be=typeof WeakMap=="function"?WeakMap:Map;U=new Be}function ve(e,r){if(!e||G)return"";{var t=U.get(e);if(t!==void 0)return t}var n;G=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=K.current,K.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(v){n=v}Reflect.construct(e,[],o)}else{try{o.call()}catch(v){n=v}e.call(o.prototype)}}else{try{throw Error()}catch(v){n=v}e()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var a=v.stack.split(`
19
+ `),d=n.stack.split(`
20
+ `),s=a.length-1,l=d.length-1;s>=1&&l>=0&&a[s]!==d[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==d[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==d[l]){var _=`
21
+ `+a[s].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,_),_}while(s>=1&&l>=0);break}}}finally{G=!1,K.current=u,Ne(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",S=F?V(F):"";return typeof e=="function"&&U.set(e,S),S}function Je(e,r,t){return ve(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,Ke(e));if(typeof e=="string")return V(e);switch(e){case y:return V("Suspense");case p:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Je(e.render);case g:return N(e.type,r,t);case O:{var n=e,i=n._payload,u=n._init;try{return N(u(i),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,pe={},_e=k.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}function qe(e,r,t,n,i){{var u=Function.call.bind($);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(B(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),B(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,B(i),c("Failed %s type: %s",t,a.message),B(null))}}}var Ge=Array.isArray;function z(e){return Ge(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function ge(e){if(Xe(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),be(e)}var he=k.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},ye,Ee;function Ze(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Qe(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function er(e,r){typeof e.ref=="string"&&he.current}function rr(e,r){{var t=function(){ye||(ye=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function tr(e,r){{var t=function(){Ee||(Ee=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var nr=function(e,r,t,n,i,u,o){var a={$$typeof:R,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ar(e,r,t,n,i){{var u,o={},a=null,d=null;t!==void 0&&(ge(t),a=""+t),Qe(r)&&(ge(r.key),a=""+r.key),Ze(r)&&(d=r.ref,er(r,i));for(u in r)$.call(r,u)&&!He.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&rr(o,l),d&&tr(o,l)}return nr(e,a,d,i,n,he.current,o)}}var X=k.ReactCurrentOwner,me=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}var H;H=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===R}function Re(){{if(X.current){var e=E(X.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function or(e){return""}var Te={};function ir(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
+
25
+ Check the top-level render call using <`+t+">.")}return r}}function Oe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),D(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function we(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Oe(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=Fe(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Z(o.value)&&Oe(o.value,r)}}}function ur(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===g))t=r.propTypes;else return;if(t){var n=E(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var i=E(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Se={};function Ce(e,r,t,n,i,u){{var o=Me(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=or();d?a+=d:a+=Re();var s;e===null?s="null":z(e)?s="array":e!==void 0&&e.$$typeof===R?(s="<"+(E(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=ar(e,r,t,i,u);if(l==null)return l;if(o){var _=r.children;if(_!==void 0)if(n)if(z(_)){for(var F=0;F<_.length;F++)we(_[F],e);Object.freeze&&Object.freeze(_)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else we(_,e)}if($.call(r,"key")){var S=E(e),v=Object.keys(r).filter(function(pr){return pr!=="key"}),Q=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!Se[S+Q]){var vr=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Q,S,vr,S),Se[S+Q]=!0}}return e===h?sr(l):ur(l),l}}function lr(e,r,t){return Ce(e,r,t,!0)}function fr(e,r,t){return Ce(e,r,t,!1)}var cr=fr,dr=lr;W.Fragment=h,W.jsx=cr,W.jsxs=dr}()),W}process.env.NODE_ENV==="production"?J.exports=Pe():J.exports=je();var xe=J.exports;const L={button:"_button_8tu5w_1",sm:"_sm_8tu5w_29",md:"_md_8tu5w_36",lg:"_lg_8tu5w_42",fullWidth:"_fullWidth_8tu5w_49",disabled:"_disabled_8tu5w_53"},ke=({children:I,size:R="md",disabled:P=!1,fullWidth:h=!1,type:j="button",onClick:x,className:T="","data-testid":b,...f})=>{const y=[L.button,L[R],h?L.fullWidth:"",P?L.disabled:"",T].filter(Boolean).join(" ");return xe.jsx("button",{type:j,className:y,disabled:P,onClick:x,"data-testid":b,...f,children:I})};m.Button=ke,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAA"}
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ ._button_8tu5w_1{background:#3b73bb;border:1px solid #3b73bb;align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:#fff;padding:0 1.5rem;cursor:pointer;height:34px}._button_8tu5w_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._button_8tu5w_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid #d6e3f5;background:#d6e3f5;opacity:.5}._sm_8tu5w_29{padding:var(--button-padding-sm);font-size:var(--font-size-sm);line-height:1.5;border-radius:var(--border-radius-sm)}._md_8tu5w_36{padding:var(--button-padding-md);font-size:var(--font-size-base);line-height:1.5}._lg_8tu5w_42{padding:var(--button-padding-lg);font-size:var(--font-size-lg);line-height:1.5;border-radius:var(--border-radius-lg)}._fullWidth_8tu5w_49{width:100%}._disabled_8tu5w_53{cursor:not-allowed;opacity:.65}._disabled_8tu5w_53:hover{transform:none}*{box-sizing:border-box}:root{--color-primary: #007bff;--color-primary-hover: #0056b3;--color-secondary: #6c757d;--color-success: #28a745;--color-danger: #dc3545;--color-warning: #ffc107;--color-info: #17a2b8;--color-light: #f8f9fa;--color-dark: #343a40;--color-text-primary: #212529;--color-text-secondary: #6c757d;--color-text-muted: #6c757d;--color-bg-primary: #ffffff;--color-bg-secondary: #f8f9fa;--color-border: #dee2e6;--color-border-light: #e9ecef;--spacing-xs: .25rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 3rem;--border-radius-sm: .25rem;--border-radius-md: .375rem;--border-radius-lg: .5rem;--font-size-sm: .875rem;--font-size-base: 1rem;--font-size-lg: 1.125rem;--font-size-xl: 1.25rem;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--transition-fast: .15s ease-in-out;--transition-normal: .3s ease-in-out;--transition-slow: .5s ease-in-out;--z-dropdown: 1000;--z-sticky: 1020;--z-fixed: 1030;--z-modal-backdrop: 1040;--z-modal: 1050;--z-popover: 1060;--z-tooltip: 1070;--button-padding-sm: .25rem .5rem;--button-padding-md: .375rem .75rem;--button-padding-lg: .5rem 1rem;--input-padding-sm: .25rem .5rem;--input-padding-md: .375rem .75rem;--input-padding-lg: .5rem 1rem;--card-padding: 1rem;--card-border-radius: var(--border-radius-md);--card-shadow: var(--shadow-sm)}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--color-text-primary);background-color:var(--color-bg-primary);margin:0;padding:0}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA"}
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@emporix/component-library",
3
+ "version": "1.0.0",
4
+ "description": "A React component library for Emporix projects",
5
+ "type": "module",
6
+ "main": "./dist/index.umd.js",
7
+ "module": "./dist/index.es.js",
8
+ "browser": "./dist/index.umd.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.es.js",
13
+ "require": "./dist/index.umd.js",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./styles": "./dist/style.css"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "dev": "vite",
23
+ "build": "tsc && vite build",
24
+ "build:lib": "vite build --mode library",
25
+ "preview": "vite preview",
26
+ "test": "vitest",
27
+ "test:ui": "vitest --ui",
28
+ "test:coverage": "vitest --coverage",
29
+ "storybook": "storybook dev -p 6006",
30
+ "build-storybook": "storybook build",
31
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
32
+ "lint:fix": "eslint . --ext ts,tsx --fix",
33
+ "type-check": "tsc --noEmit",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check .",
36
+ "format:staged": "prettier --write",
37
+ "prepare": "husky install"
38
+ },
39
+ "keywords": [
40
+ "react",
41
+ "components",
42
+ "library",
43
+ "typescript",
44
+ "vite"
45
+ ],
46
+ "author": "Emporix",
47
+ "license": "MIT",
48
+ "peerDependencies": {
49
+ "react": "^18.0.0",
50
+ "react-dom": "^18.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@storybook/addon-essentials": "^7.6.17",
54
+ "@storybook/addon-interactions": "^7.6.17",
55
+ "@storybook/addon-links": "^7.6.17",
56
+ "@storybook/blocks": "^7.6.17",
57
+ "@storybook/react": "^7.6.17",
58
+ "@storybook/react-vite": "^7.6.17",
59
+ "@storybook/test": "^7.6.17",
60
+ "@types/react": "^18.2.66",
61
+ "@types/react-dom": "^18.2.22",
62
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
63
+ "@typescript-eslint/parser": "^7.2.0",
64
+ "@vitejs/plugin-react": "^4.2.1",
65
+ "@vitest/coverage-v8": "^1.4.0",
66
+ "@vitest/ui": "^1.4.0",
67
+ "eslint": "^8.57.0",
68
+ "eslint-config-prettier": "^9.1.0",
69
+ "eslint-plugin-prettier": "^5.1.3",
70
+ "eslint-plugin-react": "^7.34.1",
71
+ "eslint-plugin-react-hooks": "^4.6.0",
72
+ "eslint-plugin-react-refresh": "^0.4.6",
73
+ "husky": "^9.0.11",
74
+ "jsdom": "^24.0.0",
75
+ "prettier": "^3.2.5",
76
+ "react": "^18.2.0",
77
+ "react-dom": "^18.2.0",
78
+ "sass": "^1.71.1",
79
+ "storybook": "^7.6.17",
80
+ "typescript": "^5.2.2",
81
+ "vite": "^5.2.0",
82
+ "vite-plugin-dts": "^3.7.3",
83
+ "vitest": "^1.4.0"
84
+ },
85
+ "dependencies": {
86
+ "@testing-library/jest-dom": "^6.4.2",
87
+ "@testing-library/react": "^14.2.1",
88
+ "@testing-library/user-event": "^14.5.2"
89
+ }
90
+ }