@scaleflex/ui-tw 0.0.21 → 0.0.22
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/button/button.component.js +15 -7
- package/button/button.utils.d.ts +2 -0
- package/button/button.utils.js +15 -0
- package/form/components/form-field-group.component.d.ts +1 -1
- package/form/components/form-field-group.component.js +2 -2
- package/form/components/form-input-field.component.d.ts +1 -1
- package/form/components/form-input-field.component.js +1 -1
- package/form/components/form-password-field.component.d.ts +1 -1
- package/form/components/form-password-field.component.js +1 -1
- package/form/components/form-switch-field.component.d.ts +1 -1
- package/form/components/form-switch-field.component.js +2 -2
- package/form/components/form-textarea-field.component.d.ts +1 -1
- package/form/components/form-textarea-field.component.js +1 -1
- package/form/form.component.d.ts +1 -1
- package/form/form.component.js +1 -1
- package/form/form.types.d.ts +1 -1
- package/input/components/password-input.component.d.ts +1 -1
- package/input/components/password-input.component.js +1 -1
- package/input/input.component.d.ts +1 -1
- package/input/input.component.js +2 -3
- package/label/label.component.d.ts +1 -1
- package/label/label.component.js +2 -2
- package/package.json +2 -2
- package/switch/switch.component.d.ts +1 -1
- package/switch/switch.component.js +1 -1
- package/textarea/textarea.component.d.ts +1 -1
- package/textarea/textarea.component.js +1 -1
- package/theme.css +58 -43
- package/toaster/toaster.component.d.ts +1 -1
- package/tooltip/tooltip.component.d.ts +1 -1
- package/tooltip/tooltip.component.js +1 -1
- package/tooltip/tooltip.constants.d.ts +2 -2
- package/tooltip/tooltip.constants.js +1 -1
- package/tooltip/tooltip.types.d.ts +1 -1
|
@@ -3,13 +3,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["className", "children", "size", "startIcon", "endIcon", "variant", "loading", "asChild", "disabled"];
|
|
4
4
|
import { Slot } from '@radix-ui/react-slot';
|
|
5
5
|
import SpinnerIcon from '@scaleflex/icons-tw/spinner';
|
|
6
|
-
import { ButtonSize, ButtonVariant, buttonSizeOptions, buttonVariantOptions } from '@scaleflex/ui-tw/button/button.constants';
|
|
7
|
-
import { EndIcon } from '@scaleflex/ui-tw/button/components/end-icon';
|
|
8
|
-
import { StartIcon, startIconVariants } from '@scaleflex/ui-tw/button/components/start-icon';
|
|
9
6
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
10
7
|
import { cva } from 'class-variance-authority';
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import {
|
|
8
|
+
import React, { useRef } from 'react';
|
|
9
|
+
import { ButtonSize, ButtonVariant, buttonSizeOptions, buttonVariantOptions } from './button.constants';
|
|
10
|
+
import { createRipple, getIconSizeInRem } from './button.utils';
|
|
11
|
+
import { EndIcon } from './components/end-icon';
|
|
12
|
+
import { StartIcon, startIconVariants } from './components/start-icon';
|
|
13
13
|
var buttonVariants = cva('', {
|
|
14
14
|
variants: {
|
|
15
15
|
variant: buttonVariantOptions,
|
|
@@ -36,15 +36,23 @@ function Button(_ref) {
|
|
|
36
36
|
_ref$disabled = _ref.disabled,
|
|
37
37
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
38
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
var buttonRef = useRef(null);
|
|
39
40
|
var Comp = asChild ? Slot : 'button';
|
|
41
|
+
var handleClick = function handleClick(e) {
|
|
42
|
+
if (buttonRef.current) {
|
|
43
|
+
createRipple(e, buttonRef.current);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
40
46
|
return /*#__PURE__*/React.createElement(Comp, _extends({
|
|
47
|
+
ref: buttonRef,
|
|
41
48
|
"data-slot": "button",
|
|
42
|
-
className: cn('group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md font-medium whitespace-nowrap transition-all outline-none', 'ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-40', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", buttonVariants({
|
|
49
|
+
className: cn('group/button relative inline-flex shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-md font-medium whitespace-nowrap transition-all outline-none', 'ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-40', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", buttonVariants({
|
|
43
50
|
variant: variant,
|
|
44
51
|
size: size,
|
|
45
52
|
className: className
|
|
46
53
|
}), loading && 'pointer-events-none opacity-30'),
|
|
47
|
-
disabled: disabled
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
onMouseDown: handleClick
|
|
48
56
|
}, rest), startIcon || endIcon || loading ? /*#__PURE__*/React.createElement("span", {
|
|
49
57
|
className: "flex items-center"
|
|
50
58
|
}, startIcon && /*#__PURE__*/React.createElement(StartIcon, {
|
package/button/button.utils.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { ButtonSizeType } from '@scaleflex/ui-tw/button/button.types';
|
|
2
|
+
import type { MouseEvent } from 'react';
|
|
2
3
|
export declare const getIconSizeInRem: (sizeName?: ButtonSizeType | null) => string;
|
|
4
|
+
export declare const createRipple: (event: MouseEvent, container: HTMLElement) => void;
|
package/button/button.utils.js
CHANGED
|
@@ -16,4 +16,19 @@ export var getIconSizeInRem = function getIconSizeInRem(sizeName) {
|
|
|
16
16
|
default:
|
|
17
17
|
return '1rem';
|
|
18
18
|
}
|
|
19
|
+
};
|
|
20
|
+
export var createRipple = function createRipple(event, container) {
|
|
21
|
+
if (!container) return;
|
|
22
|
+
var ripple = document.createElement('span');
|
|
23
|
+
var diameter = Math.max(container.clientWidth, container.clientHeight);
|
|
24
|
+
var radius = diameter / 2;
|
|
25
|
+
ripple.style.width = ripple.style.height = "".concat(diameter, "px");
|
|
26
|
+
ripple.style.left = "".concat(event.clientX - container.getBoundingClientRect().left - radius, "px");
|
|
27
|
+
ripple.style.top = "".concat(event.clientY - container.getBoundingClientRect().top - radius, "px");
|
|
28
|
+
ripple.style.willChange = 'transform, opacity';
|
|
29
|
+
ripple.className = 'absolute z-10 bg-foreground/20 rounded-full pointer-events-none animate-[ripple_500ms_ease-out_forwards]';
|
|
30
|
+
container.appendChild(ripple);
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
return ripple.remove();
|
|
33
|
+
}, 500);
|
|
19
34
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormFieldGroupProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { FormFieldGroupProps } from '../form.types';
|
|
4
4
|
declare function FormFieldGroup<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, size, readOnly, disabled, tooltip, highlight, horizontal, horizontalLabelWidth, children, }: FormFieldGroupProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormFieldGroup };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@scaleflex/ui-tw/form';
|
|
2
|
-
import { labelHeightVariants } from '@scaleflex/ui-tw/form/form.constants';
|
|
3
1
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
4
2
|
import React from 'react';
|
|
3
|
+
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../form.component';
|
|
4
|
+
import { labelHeightVariants } from '../form.constants';
|
|
5
5
|
function FormFieldGroup(_ref) {
|
|
6
6
|
var control = _ref.control,
|
|
7
7
|
name = _ref.name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormInputFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { FormInputFieldProps } from '../form.types';
|
|
4
4
|
declare function FormInputField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ inputProps, ...rest }: FormInputFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormInputField };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["inputProps"];
|
|
4
|
-
import { FormFieldGroup } from '@scaleflex/ui-tw/form';
|
|
5
4
|
import { Input } from '@scaleflex/ui-tw/input';
|
|
6
5
|
import React from 'react';
|
|
6
|
+
import { FormFieldGroup } from './form-field-group.component';
|
|
7
7
|
function FormInputField(_ref) {
|
|
8
8
|
var inputProps = _ref.inputProps,
|
|
9
9
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormInputFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { FormInputFieldProps } from '../form.types';
|
|
4
4
|
declare function FormPasswordField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ inputProps, ...rest }: FormInputFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormPasswordField };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["inputProps"];
|
|
4
|
-
import { FormFieldGroup } from '@scaleflex/ui-tw/form';
|
|
5
4
|
import { PasswordInput } from '@scaleflex/ui-tw/input';
|
|
6
5
|
import React from 'react';
|
|
6
|
+
import { FormFieldGroup } from './form-field-group.component';
|
|
7
7
|
function FormPasswordField(_ref) {
|
|
8
8
|
var inputProps = _ref.inputProps,
|
|
9
9
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormSwitchFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { FormSwitchFieldProps } from '../form.types';
|
|
4
4
|
declare function FormSwitchField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, disabled, tooltip, size, layout, switchProps, }: FormSwitchFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormSwitchField };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from '@scaleflex/ui-tw/form';
|
|
3
|
-
import { SwitchLayout, formSwitchFieldSizeOptions } from '@scaleflex/ui-tw/form/form.constants';
|
|
4
2
|
import { Label } from '@scaleflex/ui-tw/label';
|
|
5
3
|
import { Switch } from '@scaleflex/ui-tw/switch';
|
|
6
4
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
7
5
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
8
6
|
import { cva } from 'class-variance-authority';
|
|
9
7
|
import React from 'react';
|
|
8
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from '../form.component';
|
|
9
|
+
import { SwitchLayout, formSwitchFieldSizeOptions } from '../form.constants';
|
|
10
10
|
var formSwitchFieldVariants = cva('', {
|
|
11
11
|
variants: {
|
|
12
12
|
size: formSwitchFieldSizeOptions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormTextareaFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { FormTextareaFieldProps } from '../form.types';
|
|
4
4
|
declare function FormTextareaField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ textareaProps, ...rest }: FormTextareaFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormTextareaField };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["textareaProps"];
|
|
4
|
-
import { FormFieldGroup } from '@scaleflex/ui-tw/form';
|
|
5
4
|
import { Textarea } from '@scaleflex/ui-tw/textarea';
|
|
6
5
|
import React from 'react';
|
|
6
|
+
import { FormFieldGroup } from './form-field-group.component';
|
|
7
7
|
function FormTextareaField(_ref) {
|
|
8
8
|
var textareaProps = _ref.textareaProps,
|
|
9
9
|
rest = _objectWithoutProperties(_ref, _excluded);
|
package/form/form.component.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
-
import { FormMessageSizeType } from '@scaleflex/ui-tw/form/form.types';
|
|
3
2
|
import { LabelProps } from '@scaleflex/ui-tw/label/label.types';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { ComponentProps } from 'react';
|
|
6
5
|
import { type ControllerProps, type FieldPath, type FieldValues } from 'react-hook-form';
|
|
6
|
+
import { FormMessageSizeType } from './form.types';
|
|
7
7
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
8
8
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
9
9
|
declare const useFormField: () => {
|
package/form/form.component.js
CHANGED
|
@@ -9,12 +9,12 @@ var _excluded = ["className", "horizontal", "firstColumnWidth"],
|
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
import { Slot } from '@radix-ui/react-slot';
|
|
12
|
-
import { FormMessageSize, formMessageSizeOptions } from '@scaleflex/ui-tw/form/form.constants';
|
|
13
12
|
import { Label } from '@scaleflex/ui-tw/label';
|
|
14
13
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
15
14
|
import * as React from 'react';
|
|
16
15
|
import { createContext, useContext, useId } from 'react';
|
|
17
16
|
import { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';
|
|
17
|
+
import { FormMessageSize, formMessageSizeOptions } from './form.constants';
|
|
18
18
|
var Form = FormProvider;
|
|
19
19
|
var FormFieldContext = /*#__PURE__*/createContext({});
|
|
20
20
|
var FormField = function FormField(_ref) {
|
package/form/form.types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FormMessageSize, SwitchLayout } from '@scaleflex/ui-tw/form/form.constants';
|
|
2
1
|
import { InputProps } from '@scaleflex/ui-tw/input';
|
|
3
2
|
import { SwitchProps } from '@scaleflex/ui-tw/switch/switch.types';
|
|
4
3
|
import { TextareaProps } from '@scaleflex/ui-tw/textarea';
|
|
@@ -6,6 +5,7 @@ import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
|
|
|
6
5
|
import type { Values } from '@scaleflex/ui-tw/types/values';
|
|
7
6
|
import { ReactElement, ReactNode } from 'react';
|
|
8
7
|
import { ControllerRenderProps, type FieldPath, FieldValues, Path, UseControllerProps } from 'react-hook-form';
|
|
8
|
+
import { FormMessageSize, SwitchLayout } from './form.constants';
|
|
9
9
|
export type FormMessageSizeType = Values<typeof FormMessageSize>;
|
|
10
10
|
export type SwitchLayoutType = Values<typeof SwitchLayout>;
|
|
11
11
|
export type FormItemContextValue = {
|
|
@@ -4,9 +4,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
var _excluded = ["className", "size", "disabled", "readOnly"];
|
|
5
5
|
import EyeClosed from '@scaleflex/icons-tw/eye-closed';
|
|
6
6
|
import EyeOpen from '@scaleflex/icons-tw/eye-open';
|
|
7
|
-
import { Input } from '@scaleflex/ui-tw/input';
|
|
8
7
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
9
8
|
import React, { useState } from 'react';
|
|
9
|
+
import { Input } from '../input.component';
|
|
10
10
|
export function PasswordInput(_ref) {
|
|
11
11
|
var className = _ref.className,
|
|
12
12
|
size = _ref.size,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InputProps } from '@scaleflex/ui-tw/input/input.types';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { InputProps } from './input.types';
|
|
3
3
|
declare const inputVariants: (props?: ({
|
|
4
4
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
package/input/input.component.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "type", "size", "disabled", "readOnly"];
|
|
4
|
-
import { ButtonSize } from '@scaleflex/ui-tw/button';
|
|
5
|
-
import { InputType, inputSizeOptions } from '@scaleflex/ui-tw/input/input.constants';
|
|
6
4
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
7
5
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
8
6
|
import { cva } from 'class-variance-authority';
|
|
9
7
|
import React from 'react';
|
|
8
|
+
import { InputType, inputSizeOptions } from './input.constants';
|
|
10
9
|
var inputVariants = cva('', {
|
|
11
10
|
variants: {
|
|
12
11
|
size: inputSizeOptions
|
|
13
12
|
},
|
|
14
13
|
defaultVariants: {
|
|
15
|
-
size:
|
|
14
|
+
size: FormSize.Md
|
|
16
15
|
}
|
|
17
16
|
});
|
|
18
17
|
function Input(_ref) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LabelProps } from '@scaleflex/ui-tw/label/label.types';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import { LabelProps } from './label.types';
|
|
3
3
|
declare function Label({ className, size, children, icon, tooltip, ...props }: LabelProps): React.JSX.Element;
|
|
4
4
|
export { Label };
|
package/label/label.component.js
CHANGED
|
@@ -2,12 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "size", "children", "icon", "tooltip"];
|
|
4
4
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
|
-
import { LabelIcon } from '@scaleflex/ui-tw/label/components/label-icon';
|
|
6
|
-
import { labelSizeOptions } from '@scaleflex/ui-tw/label/label.constants';
|
|
7
5
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
8
6
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
9
7
|
import { cva } from 'class-variance-authority';
|
|
10
8
|
import * as React from 'react';
|
|
9
|
+
import { LabelIcon } from './components/label-icon';
|
|
10
|
+
import { labelSizeOptions } from './label.constants';
|
|
11
11
|
var labelVariants = cva('', {
|
|
12
12
|
variants: {
|
|
13
13
|
size: labelSizeOptions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"author": "scaleflex",
|
|
5
5
|
"repository": "github:scaleflex/ui",
|
|
6
6
|
"homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@radix-ui/react-slot": "^1.1.2",
|
|
19
19
|
"@radix-ui/react-switch": "^1.0.1",
|
|
20
20
|
"@radix-ui/react-tooltip": "^1.2.6",
|
|
21
|
-
"@scaleflex/icons-tw": "^0.0.
|
|
21
|
+
"@scaleflex/icons-tw": "^0.0.22",
|
|
22
22
|
"@types/lodash.merge": "^4.6.9",
|
|
23
23
|
"class-variance-authority": "^0.7.1",
|
|
24
24
|
"lodash.merge": "^4.6.2",
|
|
@@ -2,11 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "size"];
|
|
4
4
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
5
|
-
import { switchSizeOptions, switchThumbSizeOptions } from '@scaleflex/ui-tw/switch/switch.constants';
|
|
6
5
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
7
6
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
8
7
|
import { cva } from 'class-variance-authority';
|
|
9
8
|
import * as React from 'react';
|
|
9
|
+
import { switchSizeOptions, switchThumbSizeOptions } from './switch.constants';
|
|
10
10
|
var switchVariants = cva('', {
|
|
11
11
|
variants: {
|
|
12
12
|
size: switchSizeOptions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextareaProps } from '@scaleflex/ui-tw/textarea/textarea.types';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { TextareaProps } from './textarea.types';
|
|
3
3
|
declare const textareaVariants: (props?: ({
|
|
4
4
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "size", "disabled", "readOnly"];
|
|
4
|
-
import { textareaSizeOptions } from '@scaleflex/ui-tw/textarea/textarea.constants';
|
|
5
4
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
6
5
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
8
7
|
import React from 'react';
|
|
8
|
+
import { textareaSizeOptions } from './textarea.constants';
|
|
9
9
|
var textareaVariants = cva('', {
|
|
10
10
|
variants: {
|
|
11
11
|
size: textareaSizeOptions
|
package/theme.css
CHANGED
|
@@ -2,32 +2,34 @@
|
|
|
2
2
|
@import "tw-animate-css";
|
|
3
3
|
|
|
4
4
|
:root {
|
|
5
|
-
--background: oklch(1 0 0);
|
|
6
|
-
--foreground: oklch(0.
|
|
5
|
+
--background: oklch(1 0 0);
|
|
6
|
+
--foreground: oklch(0.37 0.022 248.413);
|
|
7
7
|
--card: oklch(1 0 0);
|
|
8
|
-
--card-foreground: oklch(0.
|
|
9
|
-
--popover: oklch(1 0 0);
|
|
10
|
-
--popover-foreground: oklch(0.
|
|
11
|
-
--primary: oklch(0.578 0.198 268.129);
|
|
12
|
-
--primary-foreground: oklch(1 0 0);
|
|
13
|
-
--secondary: oklch(98.16% 0.002 247.84);
|
|
8
|
+
--card-foreground: oklch(0.37 0.022 248.413);
|
|
9
|
+
--popover: oklch(1 0 0);
|
|
10
|
+
--popover-foreground: oklch(0.37 0.022 248.413);
|
|
11
|
+
--primary: oklch(0.578 0.198 268.129);
|
|
12
|
+
--primary-foreground: oklch(1 0 0);
|
|
13
|
+
--secondary: oklch(98.16% 0.002 247.84);
|
|
14
14
|
--secondary-foreground: oklch(53.03% 0.039 249.89);
|
|
15
|
-
--muted: oklch(0.
|
|
15
|
+
--muted: oklch(0.974 0.006 239.819);
|
|
16
16
|
--muted-foreground: oklch(0.685 0.033 249.82);
|
|
17
|
-
--accent: oklch(0.578 0.198 268.129 / 0.07);
|
|
18
|
-
--accent-foreground: oklch(0.578 0.198 268.129);
|
|
19
|
-
|
|
20
|
-
--success
|
|
21
|
-
--
|
|
22
|
-
--destructive
|
|
23
|
-
--destructive-
|
|
24
|
-
--
|
|
25
|
-
--info
|
|
26
|
-
--
|
|
27
|
-
--warning
|
|
28
|
-
--warning-
|
|
29
|
-
--
|
|
30
|
-
|
|
17
|
+
--accent: oklch(0.578 0.198 268.129 / 0.07);
|
|
18
|
+
--accent-foreground: oklch(0.578 0.198 268.129);
|
|
19
|
+
|
|
20
|
+
--success: oklch(0.637 0.17 151.295);
|
|
21
|
+
--success-foreground: oklch(0.429 0.107 154.754);
|
|
22
|
+
--destructive: oklch(0.577 0.215 27.325);
|
|
23
|
+
--destructive-foreground: oklch(0.472 0.173 26.157);
|
|
24
|
+
--destructive-10: oklch(0.967 0.016 17.438);
|
|
25
|
+
--info: oklch(0.632 0.161 245.564);
|
|
26
|
+
--info-foreground: oklch(0.391 0.091 241.289);
|
|
27
|
+
--warning: oklch(0.734 0.157 69.419);
|
|
28
|
+
--warning-foreground: oklch(0.456 0.095 58.822);
|
|
29
|
+
--warning-10: oklch(0.978 0.025 86.868);
|
|
30
|
+
|
|
31
|
+
--border: oklch(92.86% 0.009 247.92);
|
|
32
|
+
--input: oklch(0.871 0.016 241.798);
|
|
31
33
|
--ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
32
34
|
--shadow: oklch(26.18% 0.024 256.43 / 0.1);
|
|
33
35
|
|
|
@@ -37,21 +39,21 @@
|
|
|
37
39
|
--chart-4: oklch(0.828 0.189 84.429); /* Chart 4 - Bright Lime-Yellow Base - approx #E2E14D */
|
|
38
40
|
--chart-5: oklch(0.769 0.188 70.08); /* Chart 5 - Golden-Yellow Base - approx #E3C442 */
|
|
39
41
|
|
|
40
|
-
--sidebar: oklch(0
|
|
41
|
-
--sidebar-foreground: oklch(
|
|
42
|
-
--sidebar-primary: oklch(0.578 0.198 268.129);
|
|
43
|
-
--sidebar-primary-foreground: oklch(1 0 0);
|
|
44
|
-
--sidebar-accent: oklch(0.
|
|
45
|
-
--sidebar-accent-foreground: oklch(0.
|
|
46
|
-
--sidebar-border: oklch(
|
|
47
|
-
--sidebar-ring: oklch(0.
|
|
42
|
+
--sidebar: oklch(1 0 0);
|
|
43
|
+
--sidebar-foreground: oklch(0.37 0.022 248.413);
|
|
44
|
+
--sidebar-primary: oklch(0.578 0.198 268.129);
|
|
45
|
+
--sidebar-primary-foreground: oklch(1 0 0);
|
|
46
|
+
--sidebar-accent: oklch(0.578 0.198 268.129 / 0.07);
|
|
47
|
+
--sidebar-accent-foreground: oklch(0.578 0.198 268.129);
|
|
48
|
+
--sidebar-border: oklch(92.86% 0.009 247.92);
|
|
49
|
+
--sidebar-ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
48
50
|
|
|
49
|
-
--panel: oklch(0.
|
|
50
|
-
--panel-foreground: oklch(1 0 0);
|
|
51
|
-
--panel-primary: oklch(0.
|
|
52
|
-
--panel-primary-foreground: oklch(1 0 0);
|
|
53
|
-
--panel-input: oklch(1 0 0);
|
|
54
|
-
--panel-ring: oklch(0.
|
|
51
|
+
--panel: oklch(0.45 0.229 265.091);
|
|
52
|
+
--panel-foreground: oklch(1 0 0);
|
|
53
|
+
--panel-primary: oklch(0.578 0.198 268.129);
|
|
54
|
+
--panel-primary-foreground: oklch(1 0 0);
|
|
55
|
+
--panel-input: oklch(1 0 0);
|
|
56
|
+
--panel-ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
:root.dark {
|
|
@@ -72,13 +74,13 @@
|
|
|
72
74
|
--success: oklch(0.6 0.2 154.83);
|
|
73
75
|
--success-foreground: oklch(0.2 0.1 165.45);
|
|
74
76
|
--destructive: oklch(0.55 0.2 27.325);
|
|
75
|
-
--destructive-foreground: oklch(0.
|
|
76
|
-
--destructive-
|
|
77
|
+
--destructive-foreground: oklch(0.704 0.183 22.984);
|
|
78
|
+
--destructive-10: oklch(0.2 0.01 17.438);
|
|
77
79
|
--info: oklch(0.65 0.2 241.34);
|
|
78
80
|
--info-foreground: oklch(0.95 0.01 248.61);
|
|
79
81
|
--warning: oklch(0.7 0.15 69.419);
|
|
80
|
-
--warning-foreground: oklch(0.
|
|
81
|
-
--warning-
|
|
82
|
+
--warning-foreground: oklch(0.756 0.114 77.312);
|
|
83
|
+
--warning-10: oklch(0.3 0.01 86.868);
|
|
82
84
|
--border: oklch(0.3 0.01 247.92);
|
|
83
85
|
--input: oklch(0.4 0.02 248.73);
|
|
84
86
|
--ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
@@ -145,10 +147,10 @@
|
|
|
145
147
|
--color-info: var(--info);
|
|
146
148
|
--color-info-foreground: var(--info-foreground);
|
|
147
149
|
--color-warning: var(--warning);
|
|
148
|
-
--color-warning-
|
|
150
|
+
--color-warning-10: var(--warning-10);
|
|
149
151
|
--color-warning-foreground: var(--warning-foreground);
|
|
150
152
|
--color-destructive: var(--destructive);
|
|
151
|
-
--color-destructive-
|
|
153
|
+
--color-destructive-10: var(--destructive-10);
|
|
152
154
|
--color-destructive-foreground: var(--destructive-foreground);
|
|
153
155
|
|
|
154
156
|
--color-panel: var(--panel);
|
|
@@ -158,3 +160,16 @@
|
|
|
158
160
|
--color-panel-input: var(--panel-input);
|
|
159
161
|
--color-panel-ring: var(--panel-ring);
|
|
160
162
|
}
|
|
163
|
+
|
|
164
|
+
@layer utilities {
|
|
165
|
+
@keyframes ripple {
|
|
166
|
+
0% {
|
|
167
|
+
transform: scale(0.1);
|
|
168
|
+
opacity: 0.8;
|
|
169
|
+
}
|
|
170
|
+
100% {
|
|
171
|
+
transform: scale(2);
|
|
172
|
+
opacity: 0;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
-
import { TooltipContentProps, WithTooltipProps } from '@scaleflex/ui-tw/tooltip/tooltip.types';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { ComponentProps } from 'react';
|
|
4
|
+
import { TooltipContentProps, WithTooltipProps } from './tooltip.types';
|
|
5
5
|
declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
6
6
|
declare function Tooltip({ ...props }: ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
7
7
|
declare function TooltipTrigger({ ...props }: ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
@@ -5,10 +5,10 @@ var _excluded = ["delayDuration"],
|
|
|
5
5
|
_excluded2 = ["className", "sideOffset", "children", "variant"],
|
|
6
6
|
_excluded3 = ["variant", "content", "children"];
|
|
7
7
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
8
|
-
import { TooltipVariant, tooltipVariantOptions } from '@scaleflex/ui-tw/tooltip/tooltip.constants';
|
|
9
8
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
10
9
|
import { cva } from 'class-variance-authority';
|
|
11
10
|
import * as React from 'react';
|
|
11
|
+
import { TooltipVariant, tooltipVariantOptions } from './tooltip.constants';
|
|
12
12
|
function TooltipProvider(_ref) {
|
|
13
13
|
var _ref$delayDuration = _ref.delayDuration,
|
|
14
14
|
delayDuration = _ref$delayDuration === void 0 ? 0 : _ref$delayDuration,
|
|
@@ -5,6 +5,6 @@ export declare const TooltipVariant: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const tooltipVariantOptions: {
|
|
7
7
|
readonly default: "bg-muted text-foreground";
|
|
8
|
-
readonly warning: "bg-warning-
|
|
9
|
-
readonly error: "bg-destructive-
|
|
8
|
+
readonly warning: "bg-warning-10 text-warning-foreground";
|
|
9
|
+
readonly error: "bg-destructive-10 text-destructive-foreground";
|
|
10
10
|
};
|
|
@@ -4,4 +4,4 @@ export var TooltipVariant = {
|
|
|
4
4
|
Error: 'error',
|
|
5
5
|
Warning: 'warning'
|
|
6
6
|
};
|
|
7
|
-
export var tooltipVariantOptions = _defineProperty(_defineProperty(_defineProperty({}, TooltipVariant.Default, 'bg-muted text-foreground'), TooltipVariant.Warning, 'bg-warning-
|
|
7
|
+
export var tooltipVariantOptions = _defineProperty(_defineProperty(_defineProperty({}, TooltipVariant.Default, 'bg-muted text-foreground'), TooltipVariant.Warning, 'bg-warning-10 text-warning-foreground'), TooltipVariant.Error, 'bg-destructive-10 text-destructive-foreground');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
-
import { TooltipVariant } from '@scaleflex/ui-tw/tooltip/tooltip.constants';
|
|
3
2
|
import { ComponentProps, ReactElement } from 'react';
|
|
3
|
+
import { TooltipVariant } from './tooltip.constants';
|
|
4
4
|
export type TooltipVariantType = (typeof TooltipVariant)[keyof typeof TooltipVariant];
|
|
5
5
|
export interface WithTooltipProps extends Omit<ComponentProps<typeof TooltipPrimitive.Content>, 'content'> {
|
|
6
6
|
content?: ReactElement | undefined | string;
|