@docsplain-kit/core 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 (100) hide show
  1. package/LICENSE +21 -0
  2. package/MIGRATION_GUIDE.md +198 -0
  3. package/README.md +28 -0
  4. package/button/button.d.ts +4 -0
  5. package/button/button.js +39 -0
  6. package/button/button.js.map +1 -0
  7. package/button/button.props.d.ts +34 -0
  8. package/button/button.props.js +3 -0
  9. package/button/button.props.js.map +1 -0
  10. package/button/button.style.d.ts +153 -0
  11. package/button/button.style.js +167 -0
  12. package/button/button.style.js.map +1 -0
  13. package/button/index.d.ts +2 -0
  14. package/button/index.js +6 -0
  15. package/button/index.js.map +1 -0
  16. package/config/colors/control.d.ts +13 -0
  17. package/config/colors/control.js +18 -0
  18. package/config/colors/control.js.map +1 -0
  19. package/config/colors/danger.d.ts +13 -0
  20. package/config/colors/danger.js +18 -0
  21. package/config/colors/danger.js.map +1 -0
  22. package/config/colors/info.d.ts +13 -0
  23. package/config/colors/info.js +18 -0
  24. package/config/colors/info.js.map +1 -0
  25. package/config/colors/primary.d.ts +13 -0
  26. package/config/colors/primary.js +18 -0
  27. package/config/colors/primary.js.map +1 -0
  28. package/config/colors/secondary.d.ts +13 -0
  29. package/config/colors/secondary.js +18 -0
  30. package/config/colors/secondary.js.map +1 -0
  31. package/config/colors/success.d.ts +13 -0
  32. package/config/colors/success.js +18 -0
  33. package/config/colors/success.js.map +1 -0
  34. package/config/colors/tertiary.d.ts +13 -0
  35. package/config/colors/tertiary.js +18 -0
  36. package/config/colors/tertiary.js.map +1 -0
  37. package/config/colors/warning.d.ts +13 -0
  38. package/config/colors/warning.js +18 -0
  39. package/config/colors/warning.js.map +1 -0
  40. package/config/typography/font-family.d.ts +6 -0
  41. package/config/typography/font-family.js +11 -0
  42. package/config/typography/font-family.js.map +1 -0
  43. package/config/typography/font-sizes.d.ts +32 -0
  44. package/config/typography/font-sizes.js +37 -0
  45. package/config/typography/font-sizes.js.map +1 -0
  46. package/config/typography/line-heights.d.ts +32 -0
  47. package/config/typography/line-heights.js +37 -0
  48. package/config/typography/line-heights.js.map +1 -0
  49. package/config/width-height.d.ts +35 -0
  50. package/config/width-height.js +40 -0
  51. package/config/width-height.js.map +1 -0
  52. package/div/div.d.ts +4 -0
  53. package/div/div.js +13 -0
  54. package/div/div.js.map +1 -0
  55. package/div/div.props.d.ts +18 -0
  56. package/div/div.props.js +3 -0
  57. package/div/div.props.js.map +1 -0
  58. package/div/index.d.ts +2 -0
  59. package/div/index.js +6 -0
  60. package/div/index.js.map +1 -0
  61. package/index.d.ts +6 -0
  62. package/index.js +15 -0
  63. package/index.js.map +1 -0
  64. package/loading-indicator/index.d.ts +2 -0
  65. package/loading-indicator/index.js +6 -0
  66. package/loading-indicator/index.js.map +1 -0
  67. package/loading-indicator/loading-indicator.d.ts +4 -0
  68. package/loading-indicator/loading-indicator.js +19 -0
  69. package/loading-indicator/loading-indicator.js.map +1 -0
  70. package/loading-indicator/loading-indicator.props.d.ts +6 -0
  71. package/loading-indicator/loading-indicator.props.js +3 -0
  72. package/loading-indicator/loading-indicator.props.js.map +1 -0
  73. package/loading-indicator/loading-indicator.style.d.ts +39 -0
  74. package/loading-indicator/loading-indicator.style.js +43 -0
  75. package/loading-indicator/loading-indicator.style.js.map +1 -0
  76. package/package.json +59 -0
  77. package/setupTests.d.ts +1 -0
  78. package/setupTests.js +8 -0
  79. package/setupTests.js.map +1 -0
  80. package/tailwind-merge-config.d.ts +2 -0
  81. package/tailwind-merge-config.js +24 -0
  82. package/tailwind-merge-config.js.map +1 -0
  83. package/text/index.d.ts +2 -0
  84. package/text/index.js +6 -0
  85. package/text/index.js.map +1 -0
  86. package/text/text.d.ts +4 -0
  87. package/text/text.js +14 -0
  88. package/text/text.js.map +1 -0
  89. package/text/text.props.d.ts +36 -0
  90. package/text/text.props.js +18 -0
  91. package/text/text.props.js.map +1 -0
  92. package/text/text.style.d.ts +71 -0
  93. package/text/text.style.js +75 -0
  94. package/text/text.style.js.map +1 -0
  95. package/types/index.d.ts +12 -0
  96. package/types/index.js +3 -0
  97. package/types/index.js.map +1 -0
  98. package/ui-kit.css +1144 -0
  99. package/withUiKit.js +130 -0
  100. package/withUiKitV4.js +19 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2025 DocSplain <info@docsplain.ca>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,198 @@
1
+ # PF-Kit Tailwind v4 Migration Guide
2
+
3
+ This guide helps you migrate from Tailwind v3 to v4 while using PF-Kit components.
4
+
5
+ ## Quick Start for Tailwind v4
6
+
7
+ ### Option 1: CSS Import (Recommended for v4)
8
+
9
+ 1. Install the package:
10
+ ```bash
11
+ npm install @doc-splain/ui-kit
12
+ ```
13
+
14
+ 2. Import the CSS in your global styles (e.g., `globals.css` or `app.css`):
15
+ ```css
16
+ @import "@doc-splain/ui-kit/ui-kit.css";
17
+ ```
18
+
19
+ 3. Create a minimal `tailwind.config.js`:
20
+ ```js
21
+ const withUiKitV4 = require('@doc-splain/ui-kit/withUiKitV4');
22
+
23
+ module.exports = withUiKitV4({
24
+ content: [
25
+ "./src/**/*.{js,ts,jsx,tsx}",
26
+ "./pages/**/*.{js,ts,jsx,tsx}",
27
+ "./components/**/*.{js,ts,jsx,tsx}",
28
+ ],
29
+ // Add your custom theme extensions here
30
+ theme: {
31
+ extend: {
32
+ // Your custom configurations
33
+ }
34
+ }
35
+ });
36
+ ```
37
+
38
+ ### Option 2: Configuration-based (For mixed v3/v4 environments)
39
+
40
+ If you need to support both Tailwind v3 and v4 or prefer configuration-based setup:
41
+
42
+ ```js
43
+ const withUiKit = require('@doc-splain/ui-kit/withUiKit'); // v3 compatible
44
+
45
+ module.exports = withUiKit({
46
+ content: [
47
+ "./src/**/*.{js,ts,jsx,tsx}",
48
+ // your content paths
49
+ ],
50
+ theme: {
51
+ fontFamily: {
52
+ 'family-regular': 'regularFont',
53
+ 'family-medium': 'mediumFont',
54
+ 'family-bold': 'boldFont',
55
+ 'family-light': 'lightFont',
56
+ },
57
+ extend: {
58
+ // your extensions
59
+ }
60
+ }
61
+ });
62
+ ```
63
+
64
+ ## What Changed
65
+
66
+ ### Tailwind v3 → v4 Key Differences
67
+
68
+ 1. **CSS-first approach**: Most configuration is now done via CSS custom properties
69
+ 2. **Simplified config**: Less JavaScript configuration needed
70
+ 3. **Better performance**: Faster builds and smaller bundles
71
+ 4. **Native CSS features**: Better support for modern CSS
72
+
73
+ ### PF-Kit Changes
74
+
75
+ - **New**: `ui-kit.css` - Contains all theme definitions as CSS custom properties
76
+ - **New**: `withUiKitV4.js` - Minimal config for Tailwind v4
77
+ - **Maintained**: `withUiKit.js` - Full backward compatibility for v3
78
+
79
+ ## Troubleshooting
80
+
81
+ ### Styles not working properly
82
+
83
+ 1. **Ensure CSS import order**:
84
+ ```css
85
+ /* Wrong */
86
+ @import "tailwindcss";
87
+ @import "@doc-splain/ui-kit/ui-kit.css";
88
+
89
+ /* Correct */
90
+ @import "@doc-splain/ui-kit/ui-kit.css";
91
+ ```
92
+
93
+ 2. **Check Tailwind version**:
94
+ ```bash
95
+ npm list tailwindcss
96
+ ```
97
+ Make sure you're using v4.x.x
98
+
99
+ 3. **Verify content paths** in your config include the UI kit:
100
+ ```js
101
+ content: [
102
+ "./node_modules/@doc-splain/ui-kit/**/*",
103
+ // your other paths
104
+ ]
105
+ ```
106
+
107
+ ### Custom fonts not working
108
+
109
+ Add your font definitions in your global CSS after importing ui-kit.css:
110
+
111
+ ```css
112
+ @import "@doc-splain/ui-kit/ui-kit.css";
113
+
114
+ @font-face {
115
+ font-family: 'fontRegular';
116
+ src: url('./fonts/YourFont-Regular.woff2') format('woff2');
117
+ }
118
+
119
+ @font-face {
120
+ font-family: 'fontBold';
121
+ src: url('./fonts/YourFont-Bold.woff2') format('woff2');
122
+ }
123
+
124
+ /* Continue for medium and light variants */
125
+ ```
126
+
127
+ ### Colors not applying
128
+
129
+ The CSS approach defines colors as custom properties. If you're having issues:
130
+
131
+ 1. Check browser dev tools for CSS custom property values
132
+ 2. Ensure no conflicting CSS is overriding the properties
133
+ 3. Verify the ui-kit.css is being loaded
134
+
135
+ ## Next.js Specific Setup
136
+
137
+ ### App Router (Next.js 13+)
138
+
139
+ 1. In your `app/globals.css`:
140
+ ```css
141
+ @import "@doc-splain/ui-kit/ui-kit.css";
142
+ ```
143
+
144
+ 2. In your `tailwind.config.js`:
145
+ ```js
146
+ const withUiKitV4 = require('@doc-splain/ui-kit/withUiKitV4');
147
+
148
+ module.exports = withUiKitV4({
149
+ content: [
150
+ './pages/**/*.{js,ts,jsx,tsx,mdx}',
151
+ './components/**/*.{js,ts,jsx,tsx,mdx}',
152
+ './app/**/*.{js,ts,jsx,tsx,mdx}',
153
+ ],
154
+ });
155
+ ```
156
+
157
+ ### Pages Router (Next.js 12 and earlier)
158
+
159
+ 1. In your `styles/globals.css`:
160
+ ```css
161
+ @import "@doc-splain/ui-kit/ui-kit.css";
162
+ ```
163
+
164
+ 2. Same `tailwind.config.js` as above
165
+
166
+ ## Migration Checklist
167
+
168
+ - [ ] Update to Tailwind v4
169
+ - [ ] Choose CSS import or config-based approach
170
+ - [ ] Import ui-kit.css in global styles
171
+ - [ ] Update tailwind.config.js to use withUiKitV4
172
+ - [ ] Test all PF-Kit components in your app
173
+ - [ ] Update custom fonts if needed
174
+ - [ ] Verify responsive breakpoints work
175
+ - [ ] Check dark mode functionality
176
+
177
+ ## Support
178
+
179
+ If you encounter issues during migration:
180
+
181
+ 1. Check this guide first
182
+ 2. Verify your Tailwind v4 setup
183
+ 3. Test with a minimal reproduction
184
+ 4. Check the [PF-Kit Storybook](https://pbkit.docsplain.com) for working examples
185
+
186
+ ## Rollback Plan
187
+
188
+ If you need to rollback to Tailwind v3:
189
+
190
+ 1. Downgrade Tailwind: `npm install tailwindcss@^3.4.0`
191
+ 2. Remove ui-kit.css import from global styles
192
+ 3. Switch back to `withUiKit` in your config
193
+ 4. Add back the traditional Tailwind directives:
194
+ ```css
195
+ @tailwind base;
196
+ @tailwind components;
197
+ @tailwind utilities;
198
+ ```
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ <div align="center">
2
+ <img src="https://docsplain.ca/images/logo.png" width="50" alt="DocSplain Core" />
3
+ <h1>DocSplain Core</h1>
4
+ <p><strong>Modern React Components for Rapid Development</strong></p>
5
+ </div>
6
+
7
+ ---
8
+
9
+ ## 🚀 **What is DocSplain Core?**
10
+
11
+ DocSplain Core is a comprehensive React component library built with **React** and **Tailwind CSS**, designed to accelerate your web development workflow. Whether you're building a custom design system or leveraging our pre-built components, DocSplain Core provides the foundation for creating beautiful, responsive applications.
12
+
13
+ ### ✨ **Key Features**
14
+ - 🎨 **Modern Design System** - Carefully crafted components with consistent styling
15
+ - ⚡ **Lightning Fast** - Optimized for performance and developer experience
16
+ - 🔧 **Flexible Configuration** - Supports both Tailwind CSS v3 and v4
17
+ - 📱 **Responsive by Default** - Mobile-first approach with responsive utilities
18
+ - 🎯 **TypeScript Ready** - Full TypeScript support for better development experience
19
+
20
+ ---
21
+
22
+ ## 📦 **Installation**
23
+
24
+ Get started with DocSplain Core in seconds:
25
+
26
+ ```bash
27
+ npm install --save @docsplain-kit/core
28
+ ```
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from './button.props';
3
+ export declare const Button: (props: ButtonProps) => React.JSX.Element;
4
+ export default Button;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ 'use client';
3
+ exports.__esModule = true;
4
+ exports.Button = void 0;
5
+ var tslib_1 = require("tslib");
6
+ var react_1 = tslib_1.__importDefault(require("react"));
7
+ var tailwind_merge_config_1 = require("../tailwind-merge-config");
8
+ var button_style_1 = require("./button.style");
9
+ var loading_indicator_1 = tslib_1.__importDefault(require("../loading-indicator"));
10
+ var text_style_1 = require("../text/text.style");
11
+ var div_1 = tslib_1.__importDefault(require("../div"));
12
+ var Button = function (props) {
13
+ var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.variant, variant = _c === void 0 ? 'filled' : _c, _d = props.shape, shape = _d === void 0 ? 'rectangle' : _d, _e = props.rounded, rounded = _e === void 0 ? 'medium' : _e, className = props.className, onClick = props.onClick, type = props.type, _f = props.disabled, disabled = _f === void 0 ? false : _f, _g = props.loading, loading = _g === void 0 ? false : _g, style = props.style, startAdornment = props.startAdornment, startAdornmentClassName = props.startAdornmentClassName, endAdornment = props.endAdornment, endAdornmentClassName = props.endAdornmentClassName, _h = props.fontType, fontType = _h === void 0 ? 'bold' : _h, href = props.href, dataTestId = props.dataTestId, buttonId = props.buttonId, ariaLabel = props.ariaLabel, ref = props.ref, rest = tslib_1.__rest(props, ["children", "color", "size", "variant", "shape", "rounded", "className", "onClick", "type", "disabled", "loading", "style", "startAdornment", "startAdornmentClassName", "endAdornment", "endAdornmentClassName", "fontType", "href", "dataTestId", "buttonId", "ariaLabel", "ref"]);
14
+ var clickOnButton = function () {
15
+ if (!disabled && onClick && typeof onClick !== 'undefined') {
16
+ onClick();
17
+ }
18
+ };
19
+ var buttonProps = tslib_1.__assign({ href: href, dir: 'ltr', 'data-testid': dataTestId, onClick: clickOnButton, type: type, style: style, className: (0, tailwind_merge_config_1.twMerge)('flex flex-row items-center justify-center hover:transition hover:duration-150 hover:ease-in-out z-4 cursor-pointer', text_style_1.TYPE[fontType], button_style_1.ROUNDED[rounded], button_style_1.SIZES[size], disabled ? "".concat(button_style_1.DISABLED_VARIANTS[variant], " cursor-not-allowed") : (0, button_style_1.COLOR_VARIANTS)({ color: color, variant: variant }), (0, button_style_1.SHAPES)({ shape: shape, size: size }), className), id: buttonId, 'aria-label': ariaLabel }, rest);
20
+ var Children = loading ? (react_1["default"].createElement(loading_indicator_1["default"], { color: 'inherit' })) : (react_1["default"].createElement(react_1["default"].Fragment, null,
21
+ startAdornment ? (react_1["default"].createElement(div_1["default"], { className: "items-center justify-center relative object-cover ".concat(button_style_1.ICON_SIZES[size], " ").concat(startAdornmentClassName) }, startAdornment)) : null,
22
+ children,
23
+ endAdornment ? (react_1["default"].createElement(div_1["default"], { className: "items-center justify-center relative object-cover ".concat(button_style_1.ICON_SIZES[size], " ").concat(endAdornmentClassName) }, endAdornment)) : null));
24
+ if (href && !disabled) {
25
+ try {
26
+ var NextLink = require('next/link');
27
+ return (react_1["default"].createElement(NextLink, tslib_1.__assign({}, buttonProps), Children));
28
+ }
29
+ catch (e) {
30
+ if (e.code === 'MODULE_NOT_FOUND') {
31
+ return (react_1["default"].createElement("a", tslib_1.__assign({}, buttonProps), Children));
32
+ }
33
+ }
34
+ }
35
+ return (react_1["default"].createElement("button", tslib_1.__assign({ ref: ref }, buttonProps), Children));
36
+ };
37
+ exports.Button = Button;
38
+ exports["default"] = exports.Button;
39
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../button/button.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Q,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;YACtC,OAAO,CACL,iCAAC,QAAQ,uBAAK,WAAW,GACtB,QAAQ,CACA,CACZ,CAAC;SACH;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAkB,EAAE;gBACjC,OAAO,CACL,2DAAO,WAAW,GACf,QAAQ,CACP,CACL,CAAC;aACH;SACF;KACF;IAED,OAAO,CACL,8DAAQ,GAAG,EAAE,GAAG,IAAM,WAAW,GAC9B,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC;AAhGW,QAAA,MAAM,UAgGjB;AAEF,qBAAe,cAAM,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { LegacyRef, ReactNode } from 'react';
2
+ import { Colors, Rounded, Sizes } from '../types';
3
+ import { Types } from '../text/text.props';
4
+ export interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement | HTMLAnchorElement>, 'size' | 'ref'> {
5
+ buttonId?: string;
6
+ children?: ReactNode;
7
+ color?: Colors;
8
+ size?: Sizes;
9
+ variant?: Variant;
10
+ shape?: Shape;
11
+ rounded?: Rounded;
12
+ className?: string;
13
+ onClick?: (event?: any) => void;
14
+ onTouchStart?: (event?: any) => void;
15
+ onTouchEnd?: (event?: any) => void;
16
+ onMouseDown?: (event?: any) => void;
17
+ onMouseUp?: (event?: any) => void;
18
+ type?: 'button' | 'submit' | 'reset';
19
+ disabled?: boolean;
20
+ loading?: boolean;
21
+ style?: any;
22
+ startAdornment?: ReactNode;
23
+ startAdornmentClassName?: string;
24
+ endAdornment?: ReactNode;
25
+ endAdornmentClassName?: string;
26
+ fontType?: Types;
27
+ href?: any;
28
+ dataTestId?: string;
29
+ prefetch?: boolean;
30
+ ariaLabel?: string;
31
+ ref?: LegacyRef<HTMLButtonElement>;
32
+ }
33
+ export type Variant = 'text' | 'outlined' | 'filled';
34
+ export type Shape = 'square' | 'rectangle';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=button.props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.props.js","sourceRoot":"","sources":["../../button/button.props.ts"],"names":[],"mappings":""}
@@ -0,0 +1,153 @@
1
+ import { Shape, Variant } from './button.props';
2
+ import { Colors, Sizes } from '../types';
3
+ export declare const SIZES: {
4
+ huge: string;
5
+ large: string;
6
+ medium: string;
7
+ small: string;
8
+ tiny: string;
9
+ };
10
+ export declare const SQUARE_SHAPE_SIZES: {
11
+ huge: string;
12
+ large: string;
13
+ medium: string;
14
+ small: string;
15
+ tiny: string;
16
+ };
17
+ export declare const ROUNDED: {
18
+ full: string;
19
+ huge: string;
20
+ large: string;
21
+ medium: string;
22
+ small: string;
23
+ tiny: string;
24
+ none: string;
25
+ };
26
+ export declare const DISABLED_VARIANTS: {
27
+ text: string;
28
+ outlined: string;
29
+ filled: string;
30
+ };
31
+ export declare const COLORS: {
32
+ primary: string;
33
+ danger: string;
34
+ warning: string;
35
+ secondary: string;
36
+ tertiary: string;
37
+ success: string;
38
+ info: string;
39
+ control: string;
40
+ inherit: string;
41
+ slate: string;
42
+ zinc: string;
43
+ neutral: string;
44
+ stone: string;
45
+ red: string;
46
+ orange: string;
47
+ amber: string;
48
+ yellow: string;
49
+ lime: string;
50
+ green: string;
51
+ emerald: string;
52
+ teal: string;
53
+ cyan: string;
54
+ sky: string;
55
+ blue: string;
56
+ indigo: string;
57
+ violet: string;
58
+ purple: string;
59
+ fuchsia: string;
60
+ pink: string;
61
+ rose: string;
62
+ };
63
+ export declare const OUTLINED_COLORS: {
64
+ primary: string;
65
+ danger: string;
66
+ warning: string;
67
+ secondary: string;
68
+ tertiary: string;
69
+ success: string;
70
+ info: string;
71
+ control: string;
72
+ inherit: string;
73
+ slate: string;
74
+ zinc: string;
75
+ neutral: string;
76
+ stone: string;
77
+ red: string;
78
+ orange: string;
79
+ amber: string;
80
+ yellow: string;
81
+ lime: string;
82
+ green: string;
83
+ emerald: string;
84
+ teal: string;
85
+ cyan: string;
86
+ sky: string;
87
+ blue: string;
88
+ indigo: string;
89
+ violet: string;
90
+ purple: string;
91
+ fuchsia: string;
92
+ pink: string;
93
+ rose: string;
94
+ };
95
+ export declare const TEXT_COLORS: {
96
+ primary: string;
97
+ danger: string;
98
+ warning: string;
99
+ secondary: string;
100
+ tertiary: string;
101
+ success: string;
102
+ info: string;
103
+ control: string;
104
+ inherit: string;
105
+ slate: string;
106
+ zinc: string;
107
+ neutral: string;
108
+ stone: string;
109
+ red: string;
110
+ orange: string;
111
+ amber: string;
112
+ yellow: string;
113
+ lime: string;
114
+ green: string;
115
+ emerald: string;
116
+ teal: string;
117
+ cyan: string;
118
+ sky: string;
119
+ blue: string;
120
+ indigo: string;
121
+ violet: string;
122
+ purple: string;
123
+ fuchsia: string;
124
+ pink: string;
125
+ rose: string;
126
+ };
127
+ export declare const ICON_SIZES: {
128
+ huge: string;
129
+ large: string;
130
+ medium: string;
131
+ small: string;
132
+ tiny: string;
133
+ };
134
+ /**
135
+ *
136
+ * @param size
137
+ * @param variant
138
+ * @constructor
139
+ */
140
+ export declare const COLOR_VARIANTS: ({ color, variant }: {
141
+ color: Colors;
142
+ variant: Variant;
143
+ }) => string;
144
+ /**
145
+ *
146
+ * @param size
147
+ * @param shape
148
+ * @constructor
149
+ */
150
+ export declare const SHAPES: ({ size, shape }: {
151
+ size: Sizes;
152
+ shape: Shape;
153
+ }) => string;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.SHAPES = exports.COLOR_VARIANTS = exports.ICON_SIZES = exports.TEXT_COLORS = exports.OUTLINED_COLORS = exports.COLORS = exports.DISABLED_VARIANTS = exports.ROUNDED = exports.SQUARE_SHAPE_SIZES = exports.SIZES = void 0;
4
+ exports.SIZES = {
5
+ huge: 'h-14 min-h-14 md:!h-16 md:!min-h-16 text-m-lg sm:!text-t-lg md:!text-d-lg px-6 gap-x-3',
6
+ large: 'h-12 min-h-12 md:!h-14 md:!min-h-14 text-m-base sm:!text-d-base md:!text-t-lg px-6 gap-x-3',
7
+ medium: 'h-10 min-h-10 md:!h-12 md:!min-h-12 text-m-sm sm:!text-d-sm md:!text-d-sm px-5 gap-x-2.5',
8
+ small: 'h-8 min-h-8 md:!h-10 md:!min-h-10 text-m-xs sm:!text-t-xs md:!text-d-sm px-4 gap-x-2',
9
+ tiny: 'h-6 min-h-6 md:!h-8 md:!min-h-8 text-m-xs sm:!text-t-xs md:!text-d-xs px-3 gap-x-1.5'
10
+ };
11
+ exports.SQUARE_SHAPE_SIZES = {
12
+ huge: 'min-w-14 max-w-14 w-14 md:!min-w-16 md:!max-w-16 md:!w-16 px-3',
13
+ large: 'min-w-12 max-w-12 w-12 md:!min-w-14 md:!max-w-14 md:!w-14 px-3',
14
+ medium: 'min-w-10 max-w-10 w-10 md:!min-w-12 md:!max-w-12 md:!w-12 px-2.5',
15
+ small: 'min-w-8 max-w-8 w-8 md:!min-w-10 md:!max-w-10 md:!w-10 px-2',
16
+ tiny: 'min-w-6 max-w-6 w-6 md:!min-w-8 md:!max-w-8 md:!w-8 px-1.5'
17
+ };
18
+ exports.ROUNDED = {
19
+ full: 'rounded-full',
20
+ huge: 'rounded-3xl',
21
+ large: 'rounded-2xl',
22
+ medium: 'rounded-lg',
23
+ small: 'rounded-sm',
24
+ tiny: 'rounded-xs',
25
+ none: 'rounded-none'
26
+ };
27
+ exports.DISABLED_VARIANTS = {
28
+ text: 'bg-transparent hover:bg-transparent text-control-light',
29
+ outlined: 'border-control-300 border text-control',
30
+ filled: 'bg-control-100 border-none text-control-dark'
31
+ };
32
+ exports.COLORS = {
33
+ primary: 'bg-primary border-primary !text-white hover:bg-primary-dark active:bg-primary-light',
34
+ danger: 'bg-danger border-danger !text-white hover:bg-danger-dark active:bg-danger-light',
35
+ warning: 'bg-warning border-warning !text-white hover:bg-warning-dark active:bg-warning-light',
36
+ secondary: 'bg-secondary border-secondary !text-white hover:bg-secondary-dark active:bg-secondary-light',
37
+ tertiary: 'bg-tertiary border-tertiary !text-white hover:bg-tertiary-dark active:bg-tertiary-light',
38
+ success: 'bg-success border-success !text-white hover:bg-success-dark active:bg-success-light',
39
+ info: 'bg-info border-info !text-white hover:bg-info-dark active:bg-info-light',
40
+ control: 'bg-control border-control !text-white hover:bg-control-dark active:bg-control-light',
41
+ inherit: 'bg-transparent hover:bg-transparent',
42
+ slate: 'bg-slate-500 border-slate-500 !text-white hover:bg-slate-700 active:bg-slate-300',
43
+ zinc: 'bg-zinc-500 border-zinc-500 !text-white hover:bg-zinc-700 active:bg-zinc-300',
44
+ neutral: 'bg-neutral-500 border-neutral-500 !text-white hover:bg-neutral-700 active:bg-neutral-300',
45
+ stone: 'bg-stone-500 border-stone-500 !text-white hover:bg-stone-700 active:bg-stone-300',
46
+ red: 'bg-red-500 border-red-500 !text-white hover:bg-red-700 active:bg-red-300',
47
+ orange: 'bg-orange-500 border-orange-500 !text-white hover:bg-orange-700 active:bg-orange-300',
48
+ amber: 'bg-amber-500 border-amber-500 !text-white hover:bg-amber-700 active:bg-amber-300',
49
+ yellow: 'bg-yellow-500 border-yellow-500 !text-white hover:bg-yellow-700 active:bg-yellow-300',
50
+ lime: 'bg-lime-500 border-lime-500 !text-white hover:bg-lime-700 active:bg-lime-300',
51
+ green: 'bg-green-500 border-green-500 !text-white hover:bg-green-700 active:bg-green-300',
52
+ emerald: 'bg-emerald-500 border-emerald-500 !text-white hover:bg-emerald-700 active:bg-emerald-300',
53
+ teal: 'bg-teal-500 border-teal-500 !text-white hover:bg-teal-700 active:bg-teal-300',
54
+ cyan: 'bg-cyan-500 border-cyan-500 !text-white hover:bg-cyan-700 active:bg-cyan-300',
55
+ sky: 'bg-sky-500 border-sky-500 !text-white hover:bg-sky-700 active:bg-sky-300',
56
+ blue: 'bg-blue-500 border-blue-500 !text-white hover:bg-blue-700 active:bg-blue-300',
57
+ indigo: 'bg-indigo-500 border-indigo-500 !text-white hover:bg-indigo-700 active:bg-indigo-300',
58
+ violet: 'bg-violet-500 border-violet-500 !text-white hover:bg-violet-700 active:bg-violet-300',
59
+ purple: 'bg-purple-500 border-purple-500 !text-white hover:bg-purple-700 active:bg-purple-300',
60
+ fuchsia: 'bg-fuchsia-500 border-fuchsia-500 !text-white hover:bg-fuchsia-700 active:bg-fuchsia-300',
61
+ pink: 'bg-pink-500 border-pink-500 !text-white hover:bg-pink-700 active:bg-pink-300',
62
+ rose: 'bg-rose-500 border-rose-500 !text-white hover:bg-rose-700 active:bg-rose-300'
63
+ };
64
+ exports.OUTLINED_COLORS = {
65
+ primary: 'border border-primary text-primary hover:bg-primary-100 hover:border-primary-dark hover:text-primary-dark active:border-primary-light active:text-primary-light',
66
+ danger: 'border border-danger text-danger hover:bg-danger-100 hover:border-danger-dark hover:text-danger-dark active:border-danger-light active:text-danger-light',
67
+ warning: 'border border-warning text-warning hover:bg-warning-100 hover:border-warning-dark hover:text-warning-dark active:border-warning-light active:text-warning-light',
68
+ secondary: 'border border-secondary text-secondary hover:bg-secondary-100 hover:border-secondary-dark hover:text-secondary-dark active:border-secondary-light active:text-secondary-light',
69
+ tertiary: 'border border-tertiary text-tertiary hover:bg-tertiary-100 hover:border-tertiary-dark hover:text-tertiary-dark active:border-tertiary-light active:text-tertiary-light',
70
+ success: 'border border-success text-success hover:bg-success-100 hover:border-success-dark hover:text-success-dark active:border-success-light active:text-success-light',
71
+ info: 'border border-info text-info hover:bg-info-100 hover:border-info-dark hover:text-info-dark active:border-info-light active:text-info-light',
72
+ control: 'border border-control text-control hover:bg-control-100 hover:border-control-dark hover:text-control-dark active:border-control-light active:text-control-light',
73
+ inherit: 'bg-transparent hover:bg-transparent',
74
+ slate: 'border border-slate-500 text-slate-500 hover:bg-slate-100 hover:border-slate-700 hover:text-slate-700 active:border-slate-300 active:text-slate-300',
75
+ zinc: 'border border-zinc-500 text-zinc-500 hover:bg-zinc-100 hover:border-zinc-700 hover:text-zinc-700 active:border-zinc-300 active:text-zinc-300',
76
+ neutral: 'border border-neutral-500 text-neutral-500 hover:bg-neutral-100 hover:border-neutral-700 hover:text-neutral-700 active:border-neutral-300 active:text-neutral-300',
77
+ stone: 'border border-stone-500 text-stone-500 hover:bg-stone-100 hover:border-stone-700 hover:text-stone-700 active:border-stone-300 active:text-stone-300',
78
+ red: 'border border-red-500 text-red-500 hover:bg-red-100 hover:border-red-700 hover:text-red-700 active:border-red-300 active:text-red-300',
79
+ orange: 'border border-orange-500 text-orange-500 hover:bg-orange-100 hover:border-orange-700 hover:text-orange-700 active:border-orange-300 active:text-orange-300',
80
+ amber: 'border border-amber-500 text-amber-500 hover:bg-amber-100 hover:border-amber-700 hover:text-amber-700 active:border-amber-300 active:text-amber-300',
81
+ yellow: 'border border-yellow-500 text-yellow-500 hover:bg-yellow-100 hover:border-yellow-700 hover:text-yellow-700 active:border-yellow-300 active:text-yellow-300',
82
+ lime: 'border border-lime-500 text-lime-500 hover:bg-lime-100 hover:border-lime-700 hover:text-lime-700 active:border-lime-300 active:text-lime-300',
83
+ green: 'border border-green-500 text-green-500 hover:bg-green-100 hover:border-green-700 hover:text-green-700 active:border-green-300 active:text-green-300',
84
+ emerald: 'border border-emerald-500 text-emerald-500 hover:bg-emerald-100 hover:border-emerald-700 hover:text-emerald-700 active:border-emerald-300 active:text-emerald-300',
85
+ teal: 'border border-teal-500 text-teal-500 hover:bg-teal-100 hover:border-teal-700 hover:text-teal-700 active:border-teal-300 active:text-teal-300',
86
+ cyan: 'border border-cyan-500 text-cyan-500 hover:bg-cyan-100 hover:border-cyan-700 hover:text-cyan-700 active:border-cyan-300 active:text-cyan-300',
87
+ sky: 'border border-sky-500 text-sky-500 hover:bg-sky-100 hover:border-sky-700 hover:text-sky-700 active:border-sky-300 active:text-sky-300',
88
+ blue: 'border border-blue-500 text-blue-500 hover:bg-blue-100 hover:border-blue-700 hover:text-blue-700 active:border-blue-300 active:text-blue-300',
89
+ indigo: 'border border-indigo-500 text-indigo-500 hover:bg-indigo-100 hover:border-indigo-700 hover:text-indigo-700 active:border-indigo-300 active:text-indigo-300',
90
+ violet: 'border border-violet-500 text-violet-500 hover:bg-violet-100 hover:border-violet-700 hover:text-violet-700 active:border-violet-300 active:text-violet-300',
91
+ purple: 'border border-purple-500 text-purple-500 hover:bg-purple-100 hover:border-purple-700 hover:text-purple-700 active:border-purple-300 active:text-purple-300',
92
+ fuchsia: 'border border-fuchsia-500 text-fuchsia-500 hover:bg-fuchsia-100 hover:border-fuchsia-700 hover:text-fuchsia-700 active:border-fuchsia-300 active:text-fuchsia-300',
93
+ pink: 'border border-pink-500 text-pink-500 hover:bg-pink-100 hover:border-pink-700 hover:text-pink-700 active:border-pink-300 active:text-pink-300',
94
+ rose: 'border border-rose-500 text-rose-500 hover:bg-rose-100 hover:border-rose-700 hover:text-rose-700 active:border-rose-300 active:text-rose-300'
95
+ };
96
+ exports.TEXT_COLORS = {
97
+ primary: 'text-primary hover:text-primary-dark active:text-primary-light',
98
+ danger: 'text-danger hover:text-danger-dark active:text-danger-light',
99
+ warning: 'text-warning hover:text-warning-dark active:text-warning-light',
100
+ secondary: 'text-secondary hover:text-secondary-dark active:text-secondary-light',
101
+ tertiary: 'text-tertiary hover:text-tertiary-dark active:text-tertiary-light',
102
+ success: 'text-success hover:text-success-dark active:text-success-light',
103
+ info: 'text-info hover:text-info-dark active:text-info-light',
104
+ control: 'text-control hover:text-control-dark active:text-control-light',
105
+ inherit: 'text-inherit',
106
+ slate: 'text-slate-500 hover:text-slate-700 active:text-slate-300',
107
+ zinc: 'text-zinc-500 hover:text-zinc-700 active:text-zinc-300',
108
+ neutral: 'text-neutral-500 hover:text-neutral-700 active:text-neutral-300',
109
+ stone: 'text-stone-500 hover:text-stone-700 active:text-stone-300',
110
+ red: 'text-red-500 hover:text-red-700 active:text-red-300',
111
+ orange: 'text-orange-500 hover:text-orange-700 active:text-orange-300',
112
+ amber: 'text-amber-500 hover:text-amber-700 active:text-amber-300',
113
+ yellow: 'text-yellow-500 hover:text-yellow-700 active:text-yellow-300',
114
+ lime: 'text-lime-500 hover:text-lime-700 active:text-lime-300',
115
+ green: 'text-green-500 hover:text-green-700 active:text-green-300',
116
+ emerald: 'text-emerald-500 hover:text-emerald-700 active:text-emerald-300',
117
+ teal: 'text-teal-500 hover:text-teal-700 active:text-teal-300',
118
+ cyan: 'text-cyan-500 hover:text-cyan-700 active:text-cyan-300',
119
+ sky: 'text-sky-500 hover:text-sky-700 active:text-sky-300',
120
+ blue: 'text-blue-500 hover:text-blue-700 active:text-blue-300',
121
+ indigo: 'text-indigo-500 hover:text-indigo-700 active:text-indigo-300',
122
+ violet: 'text-violet-500 hover:text-violet-700 active:text-violet-300',
123
+ purple: 'text-purple-500 hover:text-purple-700 active:text-purple-300',
124
+ fuchsia: 'text-fuchsia-500 hover:text-fuchsia-700 active:text-fuchsia-300',
125
+ pink: 'text-pink-500 hover:text-pink-700 active:text-pink-300',
126
+ rose: 'text-rose-500 hover:text-rose-700 active:text-rose-300'
127
+ };
128
+ exports.ICON_SIZES = {
129
+ huge: 'h-6 min-h-6 max-h-6 w-6 min-w-6 max-w-6',
130
+ large: 'h-6 min-h-6 max-h-6 w-6 min-w-6 max-w-6',
131
+ medium: 'h-5 min-h-5 max-h-5 w-5 min-w-5 max-w-5',
132
+ small: 'h-4 min-h-4 max-h-4 w-4 min-w-4 max-w-4',
133
+ tiny: 'h-3.5 min-h-3.5 max-h-3.5 w-3.5 min-w-3.5 max-w-3.5'
134
+ };
135
+ /**
136
+ *
137
+ * @param size
138
+ * @param variant
139
+ * @constructor
140
+ */
141
+ var COLOR_VARIANTS = function (_a) {
142
+ var color = _a.color, variant = _a.variant;
143
+ if (variant === 'filled') {
144
+ return exports.COLORS[color];
145
+ }
146
+ else if (variant === 'outlined') {
147
+ return exports.OUTLINED_COLORS[color];
148
+ }
149
+ return exports.TEXT_COLORS[color];
150
+ };
151
+ exports.COLOR_VARIANTS = COLOR_VARIANTS;
152
+ /**
153
+ *
154
+ * @param size
155
+ * @param shape
156
+ * @constructor
157
+ */
158
+ var SHAPES = function (_a) {
159
+ var size = _a.size, shape = _a.shape;
160
+ var className = '';
161
+ if (shape === 'square') {
162
+ className = "".concat(exports.SQUARE_SHAPE_SIZES[size], " ").concat(className, " whitespace-nowrap overflow-hidden text-ellipsis");
163
+ }
164
+ return className;
165
+ };
166
+ exports.SHAPES = SHAPES;
167
+ //# sourceMappingURL=button.style.js.map