@scaleflex/ui-tw 0.0.21 → 0.0.24
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 +3 -4
- package/label/label.component.d.ts +1 -1
- package/label/label.component.js +2 -2
- package/package.json +3 -2
- package/styles/ripple.css +12 -0
- package/styles/scrollbar.css +27 -0
- package/styles/theme-map.css +52 -0
- package/styles/theme.css +9 -0
- package/styles/variables.css +111 -0
- package/switch/switch.component.d.ts +1 -1
- package/switch/switch.component.js +2 -2
- package/textarea/textarea.component.d.ts +1 -1
- package/textarea/textarea.component.js +2 -2
- 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
- package/theme.css +0 -160
|
@@ -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) {
|
|
@@ -31,7 +30,7 @@ function Input(_ref) {
|
|
|
31
30
|
"data-slot": "input",
|
|
32
31
|
disabled: disabled,
|
|
33
32
|
readOnly: readOnly,
|
|
34
|
-
className: cn('border-input text-foreground bg-background flex w-full min-w-0 rounded-md border shadow-xs transition-[color,box-shadow] outline-none', 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', 'focus-visible:ring-ring ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', 'read-only:bg-secondary read-only:text-foreground read-only:cursor-default', 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive', 'group-data-[highlight=true]:border-warning group-data-[highlight=true]:focus-visible:ring-warning/20', inputVariants({
|
|
33
|
+
className: cn('border-input text-foreground bg-background flex w-full min-w-0 rounded-md border shadow-xs transition-[color,box-shadow] outline-none', 'focus-visible:border-secondary-foreground/50 placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground hover:border-secondary-foreground/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', 'focus-visible:ring-ring ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', 'read-only:bg-secondary read-only:text-foreground read-only:cursor-default', 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive hover:aria-invalid:border-destructive/60 focus-visible:aria-invalid:border-destructive', 'focus-visible:group-data-[highlight=true]:border-warning group-data-[highlight=true]:border-warning hover:group-data-[highlight=true]:border-warning/60 group-data-[highlight=true]:focus-visible:ring-warning/20', inputVariants({
|
|
35
34
|
size: size,
|
|
36
35
|
className: className
|
|
37
36
|
}))
|
|
@@ -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.24",
|
|
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.24",
|
|
22
22
|
"@types/lodash.merge": "^4.6.9",
|
|
23
23
|
"class-variance-authority": "^0.7.1",
|
|
24
24
|
"lodash.merge": "^4.6.2",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/prop-types": "^15.7.3",
|
|
32
32
|
"postcss": "^8.5.3",
|
|
33
|
+
"tailwind-scrollbar": "^4.0.2",
|
|
33
34
|
"typescript": "^5.2.2"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* Firefox scrollbar colors */
|
|
2
|
+
* {
|
|
3
|
+
scrollbar-width: thin;
|
|
4
|
+
scrollbar-color: #ccd6de transparent;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* WebKit scrollbar styling */
|
|
8
|
+
::-webkit-scrollbar {
|
|
9
|
+
width: 12px;
|
|
10
|
+
height: 12px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
::-webkit-scrollbar-track {
|
|
14
|
+
background: transparent;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
::-webkit-scrollbar-thumb {
|
|
18
|
+
background-color: #ccd6de;
|
|
19
|
+
background-clip: content-box;
|
|
20
|
+
border: 4px solid transparent;
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Optional: hide corner square */
|
|
25
|
+
::-webkit-scrollbar-corner {
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
--color-background: var(--background);
|
|
3
|
+
--color-foreground: var(--foreground);
|
|
4
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
5
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
6
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
7
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
8
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
9
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
10
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
11
|
+
--color-sidebar: var(--sidebar);
|
|
12
|
+
--color-chart-5: var(--chart-5);
|
|
13
|
+
--color-chart-4: var(--chart-4);
|
|
14
|
+
--color-chart-3: var(--chart-3);
|
|
15
|
+
--color-chart-2: var(--chart-2);
|
|
16
|
+
--color-chart-1: var(--chart-1);
|
|
17
|
+
--color-ring: var(--ring);
|
|
18
|
+
--color-input: var(--input);
|
|
19
|
+
--color-border: var(--border);
|
|
20
|
+
--color-shadow: var(--shadow);
|
|
21
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
22
|
+
--color-accent: var(--accent);
|
|
23
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
24
|
+
--color-muted: var(--muted);
|
|
25
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
26
|
+
--color-secondary: var(--secondary);
|
|
27
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
28
|
+
--color-primary: var(--primary);
|
|
29
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
30
|
+
--color-popover: var(--popover);
|
|
31
|
+
--color-card-foreground: var(--card-foreground);
|
|
32
|
+
--color-card: var(--card);
|
|
33
|
+
|
|
34
|
+
--color-success: var(--success);
|
|
35
|
+
--color-success-foreground: var(--success-foreground);
|
|
36
|
+
--color-info: var(--info);
|
|
37
|
+
--color-info-foreground: var(--info-foreground);
|
|
38
|
+
--color-warning: var(--warning);
|
|
39
|
+
--color-warning-10: var(--warning-10);
|
|
40
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
41
|
+
--color-destructive: var(--destructive);
|
|
42
|
+
--color-destructive-10: var(--destructive-10);
|
|
43
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
44
|
+
|
|
45
|
+
--color-panel: var(--panel);
|
|
46
|
+
--color-panel-foreground: var(--panel-foreground);
|
|
47
|
+
--color-panel-primary: var(--panel-primary);
|
|
48
|
+
--color-panel-primary-foreground: var(--panel-primary-foreground);
|
|
49
|
+
--color-panel-border: var(--panel-border);
|
|
50
|
+
--color-panel-input: var(--panel-input);
|
|
51
|
+
--color-panel-ring: var(--panel-ring);
|
|
52
|
+
}
|
package/styles/theme.css
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--background: oklch(1 0 0);
|
|
3
|
+
--foreground: oklch(0.37 0.022 248.413);
|
|
4
|
+
--card: oklch(1 0 0);
|
|
5
|
+
--card-foreground: oklch(0.37 0.022 248.413);
|
|
6
|
+
--popover: oklch(1 0 0);
|
|
7
|
+
--popover-foreground: oklch(0.37 0.022 248.413);
|
|
8
|
+
--primary: oklch(0.578 0.198 268.129);
|
|
9
|
+
--primary-foreground: oklch(1 0 0);
|
|
10
|
+
--secondary: oklch(98.16% 0.002 247.84);
|
|
11
|
+
--secondary-foreground: oklch(53.03% 0.039 249.89);
|
|
12
|
+
--muted: oklch(0.974 0.006 239.819);
|
|
13
|
+
--muted-foreground: oklch(0.685 0.033 249.82);
|
|
14
|
+
--accent: oklch(0.578 0.198 268.129 / 0.07);
|
|
15
|
+
--accent-foreground: oklch(0.578 0.198 268.129);
|
|
16
|
+
|
|
17
|
+
--success: oklch(0.637 0.17 151.295);
|
|
18
|
+
--success-foreground: oklch(0.429 0.107 154.754);
|
|
19
|
+
--destructive: oklch(0.577 0.215 27.325);
|
|
20
|
+
--destructive-foreground: oklch(0.472 0.173 26.157);
|
|
21
|
+
--destructive-10: oklch(0.967 0.016 17.438);
|
|
22
|
+
--info: oklch(0.632 0.161 245.564);
|
|
23
|
+
--info-foreground: oklch(0.391 0.091 241.289);
|
|
24
|
+
--warning: oklch(0.734 0.157 69.419);
|
|
25
|
+
--warning-foreground: oklch(0.456 0.095 58.822);
|
|
26
|
+
--warning-10: oklch(0.978 0.025 86.868);
|
|
27
|
+
|
|
28
|
+
--border: oklch(92.86% 0.009 247.92);
|
|
29
|
+
--input: oklch(0.871 0.016 241.798);
|
|
30
|
+
--ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
31
|
+
--shadow: oklch(26.18% 0.024 256.43 / 0.1);
|
|
32
|
+
|
|
33
|
+
--chart-1: oklch(0.646 0.222 41.116); /* Chart 1 - Orange/Yellow Base - approx #DA9834 */
|
|
34
|
+
--chart-2: oklch(0.6 0.118 184.704); /* Chart 2 - Teal/Greenish-Blue Base - approx #4BA3AD */
|
|
35
|
+
--chart-3: oklch(0.398 0.07 227.392); /* Chart 3 - Muted Blue Base - approx #435C9A */
|
|
36
|
+
--chart-4: oklch(0.828 0.189 84.429); /* Chart 4 - Bright Lime-Yellow Base - approx #E2E14D */
|
|
37
|
+
--chart-5: oklch(0.769 0.188 70.08); /* Chart 5 - Golden-Yellow Base - approx #E3C442 */
|
|
38
|
+
|
|
39
|
+
--sidebar: oklch(1 0 0);
|
|
40
|
+
--sidebar-foreground: oklch(0.37 0.022 248.413);
|
|
41
|
+
--sidebar-primary: oklch(0.578 0.198 268.129);
|
|
42
|
+
--sidebar-primary-foreground: oklch(1 0 0);
|
|
43
|
+
--sidebar-accent: oklch(0.578 0.198 268.129 / 0.07);
|
|
44
|
+
--sidebar-accent-foreground: oklch(0.578 0.198 268.129);
|
|
45
|
+
--sidebar-border: oklch(92.86% 0.009 247.92);
|
|
46
|
+
--sidebar-ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
47
|
+
|
|
48
|
+
--panel: oklch(0.45 0.229 265.091);
|
|
49
|
+
--panel-foreground: oklch(1 0 0);
|
|
50
|
+
--panel-primary: oklch(0.578 0.198 268.129);
|
|
51
|
+
--panel-primary-foreground: oklch(1 0 0);
|
|
52
|
+
--panel-border: oklch(0.9103 0.0177 246.73);
|
|
53
|
+
--panel-input: oklch(1 0 0);
|
|
54
|
+
--panel-ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:root.dark {
|
|
58
|
+
--background: oklch(0.13 0.027 261.692);
|
|
59
|
+
--foreground: oklch(0.95 0.01 264.55);
|
|
60
|
+
--card: oklch(0.25 0.01 264.55);
|
|
61
|
+
--card-foreground: oklch(0.95 0.01 264.55);
|
|
62
|
+
--popover: oklch(0.25 0.01 264.55);
|
|
63
|
+
--popover-foreground: oklch(0.95 0.01 264.55);
|
|
64
|
+
--primary: oklch(0.6 0.2 268.129);
|
|
65
|
+
--primary-foreground: oklch(0.95 0.01 264.55);
|
|
66
|
+
--secondary: oklch(0.13 0.027 261.692);
|
|
67
|
+
--secondary-foreground: oklch(0.9 0.01 264.55);
|
|
68
|
+
--muted: oklch(0.3 0.01 285);
|
|
69
|
+
--muted-foreground: oklch(0.75 0.01 249.82);
|
|
70
|
+
--accent: oklch(0.6 0.2 268.129 / 0.07);
|
|
71
|
+
--accent-foreground: oklch(0.95 0.01 264.55);
|
|
72
|
+
|
|
73
|
+
--success: oklch(0.6 0.2 154.83);
|
|
74
|
+
--success-foreground: oklch(0.2 0.1 165.45);
|
|
75
|
+
--destructive: oklch(0.55 0.2 27.325);
|
|
76
|
+
--destructive-foreground: oklch(0.704 0.183 22.984);
|
|
77
|
+
--destructive-10: oklch(0.2 0.01 17.438);
|
|
78
|
+
--info: oklch(0.65 0.2 241.34);
|
|
79
|
+
--info-foreground: oklch(0.95 0.01 248.61);
|
|
80
|
+
--warning: oklch(0.7 0.15 69.419);
|
|
81
|
+
--warning-foreground: oklch(0.756 0.114 77.312);
|
|
82
|
+
--warning-10: oklch(0.3 0.01 86.868);
|
|
83
|
+
|
|
84
|
+
--border: oklch(0.3 0.01 247.92);
|
|
85
|
+
--input: oklch(0.4 0.02 248.73);
|
|
86
|
+
--ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
87
|
+
--shadow: oklch(0 0 0 / 0.2);
|
|
88
|
+
|
|
89
|
+
--chart-1: oklch(0.7 0.2 41.116);
|
|
90
|
+
--chart-2: oklch(0.65 0.1 184.704);
|
|
91
|
+
--chart-3: oklch(0.6 0.07 227.392);
|
|
92
|
+
--chart-4: oklch(0.75 0.18 84.429);
|
|
93
|
+
--chart-5: oklch(0.7 0.18 70.08);
|
|
94
|
+
|
|
95
|
+
--sidebar: oklch(0.45 0.229 265.091); /* Background stateless #153DD1 */
|
|
96
|
+
--sidebar-foreground: oklch(1 0 0); /* Text Primary #ffffff */
|
|
97
|
+
--sidebar-primary: oklch(0.578 0.198 268.129); /* Accent Stateless #6879EB */
|
|
98
|
+
--sidebar-primary-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
99
|
+
--sidebar-accent: oklch(0.9641 0.0065 231.29); /* Background active #F3F7FA */
|
|
100
|
+
--sidebar-accent-foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
101
|
+
--sidebar-border: oklch(0.9103 0.0177 246.73); /* Borders Secondary #DFE7ED */
|
|
102
|
+
--sidebar-ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
103
|
+
|
|
104
|
+
--panel: oklch(0.28 0.15 278.91);
|
|
105
|
+
--panel-foreground: oklch(0.98 0.01 264.55);
|
|
106
|
+
--panel-primary: oklch(0.35 0.18 278.91);
|
|
107
|
+
--panel-primary-foreground: oklch(1 0 0);
|
|
108
|
+
--panel-border: oklch(0.2 0.01 268.16);
|
|
109
|
+
--panel-input: oklch(0.2 0.01 264.55);
|
|
110
|
+
--panel-ring: oklch(0.6 0.2 280.88);
|
|
111
|
+
}
|
|
@@ -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
|
|
@@ -30,7 +30,7 @@ function Switch(_ref) {
|
|
|
30
30
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
31
|
return /*#__PURE__*/React.createElement(SwitchPrimitive.Root, _extends({
|
|
32
32
|
"data-slot": "switch",
|
|
33
|
-
className: cn('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none', 'disabled:cursor-not-allowed disabled:opacity-50', 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input', 'ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', switchVariants({
|
|
33
|
+
className: cn('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none', 'hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50', 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input', 'ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', switchVariants({
|
|
34
34
|
size: size
|
|
35
35
|
}), className)
|
|
36
36
|
}, props), /*#__PURE__*/React.createElement(SwitchPrimitive.Thumb, {
|
|
@@ -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
|
|
@@ -27,7 +27,7 @@ function Textarea(_ref) {
|
|
|
27
27
|
"data-slot": "textarea",
|
|
28
28
|
disabled: disabled,
|
|
29
29
|
readOnly: readOnly,
|
|
30
|
-
className: cn('field-sizing-content', 'border-input text-foreground bg-background flex w-full rounded-md border shadow-xs transition-[color,box-shadow] outline-none', 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', 'focus-visible:ring-ring ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', 'read-only:bg-secondary read-only:text-foreground read-only:cursor-default', 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive', 'group-data-[highlight=true]:border-warning group-data-[highlight=true]:focus-visible:ring-warning/20', textareaVariants({
|
|
30
|
+
className: cn('field-sizing-content resize-y', 'border-input text-foreground bg-background flex w-full rounded-md border shadow-xs transition-[color,box-shadow] outline-none', 'focus-visible:border-secondary-foreground/50 placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground hover:border-secondary-foreground/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', 'focus-visible:ring-ring ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', 'read-only:bg-secondary read-only:text-foreground read-only:cursor-default', 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive hover:aria-invalid:border-destructive/60 focus-visible:aria-invalid:border-destructive', 'focus-visible:group-data-[highlight=true]:border-warning group-data-[highlight=true]:border-warning hover:group-data-[highlight=true]:border-warning/60 group-data-[highlight=true]:focus-visible:ring-warning/20', textareaVariants({
|
|
31
31
|
size: size,
|
|
32
32
|
className: className
|
|
33
33
|
}))
|
|
@@ -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;
|
package/theme.css
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@import "tw-animate-css";
|
|
3
|
-
|
|
4
|
-
:root {
|
|
5
|
-
--background: oklch(1 0 0); /* Background stateless #ffffff */
|
|
6
|
-
--foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
7
|
-
--card: oklch(1 0 0);
|
|
8
|
-
--card-foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
9
|
-
--popover: oklch(1 0 0); /* Background stateless #ffffff */
|
|
10
|
-
--popover-foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
11
|
-
--primary: oklch(0.578 0.198 268.129); /* Accent Stateless #496CED */
|
|
12
|
-
--primary-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
13
|
-
--secondary: oklch(98.16% 0.002 247.84); /* Background active #F8F9FA */
|
|
14
|
-
--secondary-foreground: oklch(53.03% 0.039 249.89);
|
|
15
|
-
--muted: oklch(0.95 0.01 285); /* Background active #F3F7FA */
|
|
16
|
-
--muted-foreground: oklch(0.685 0.033 249.82);
|
|
17
|
-
--accent: oklch(0.578 0.198 268.129 / 0.07); /* Background active #F3F7FA */
|
|
18
|
-
--accent-foreground: oklch(0.578 0.198 268.129); /* Text Primary #37414B */
|
|
19
|
-
--success: oklch(0.7487 0.1799 154.83); /* #26C17A */
|
|
20
|
-
--success-foreground: oklch(0.4238 0.1235 165.45); /* #006D3B */
|
|
21
|
-
--destructive: oklch(0.577 0.215 27.325); /* #DC2626 */
|
|
22
|
-
--destructive-foreground: oklch(0.3963 0.1994 27.40); /* #82181A */
|
|
23
|
-
--destructive-4: oklch(0.967 0.016 17.438); /* #FFF0F0 */
|
|
24
|
-
--info: oklch(0.6632 0.1896 241.34); /* #0090E4 */
|
|
25
|
-
--info-foreground: oklch(0.3902 0.1177 248.61); /* #024A71 */
|
|
26
|
-
--warning: oklch(0.734 0.157 69.419); /* #E7940F */
|
|
27
|
-
--warning-foreground: oklch(0.4429 0.1617 63.95); /* #733E0A */
|
|
28
|
-
--warning-4: oklch(0.978 0.025 86.868); /* #FFF7E5 */
|
|
29
|
-
--border: oklch(92.86% 0.009 247.92); /* Borders Secondary #E3E8ED */
|
|
30
|
-
--input: oklch(0.8625 0.0257 248.73); /* Border Primary Stateless #CCD6DE */
|
|
31
|
-
--ring: oklch(0.578 0.198 268.129 / 0.7);
|
|
32
|
-
--shadow: oklch(26.18% 0.024 256.43 / 0.1);
|
|
33
|
-
|
|
34
|
-
--chart-1: oklch(0.646 0.222 41.116); /* Chart 1 - Orange/Yellow Base - approx #DA9834 */
|
|
35
|
-
--chart-2: oklch(0.6 0.118 184.704); /* Chart 2 - Teal/Greenish-Blue Base - approx #4BA3AD */
|
|
36
|
-
--chart-3: oklch(0.398 0.07 227.392); /* Chart 3 - Muted Blue Base - approx #435C9A */
|
|
37
|
-
--chart-4: oklch(0.828 0.189 84.429); /* Chart 4 - Bright Lime-Yellow Base - approx #E2E14D */
|
|
38
|
-
--chart-5: oklch(0.769 0.188 70.08); /* Chart 5 - Golden-Yellow Base - approx #E3C442 */
|
|
39
|
-
|
|
40
|
-
--sidebar: oklch(0.45 0.229 265.091); /* Background stateless #153DD1 */
|
|
41
|
-
--sidebar-foreground: oklch(1 0 0); /* Text Primary #ffffff */
|
|
42
|
-
--sidebar-primary: oklch(0.578 0.198 268.129); /* Accent Stateless #6879EB */
|
|
43
|
-
--sidebar-primary-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
44
|
-
--sidebar-accent: oklch(0.9641 0.0065 231.29); /* Background active #F3F7FA */
|
|
45
|
-
--sidebar-accent-foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
46
|
-
--sidebar-border: oklch(0.9103 0.0177 246.73); /* Borders Secondary #DFE7ED */
|
|
47
|
-
--sidebar-ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
48
|
-
|
|
49
|
-
--panel: oklch(0.5202 0.2024 278.91); /* Background Accent Active #4958BC */
|
|
50
|
-
--panel-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
51
|
-
--panel-primary: oklch(0.5202 0.2024 278.91); /* Background Accent Active #4958BC */
|
|
52
|
-
--panel-primary-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
53
|
-
--panel-input: oklch(1 0 0); /* Background stateless #ffffff */
|
|
54
|
-
--panel-ring: oklch(0.6662 0.2007 280.88); /* Borders Base #6879EB */
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
:root.dark {
|
|
58
|
-
--background: oklch(0.13 0.027 261.692);
|
|
59
|
-
--foreground: oklch(0.95 0.01 264.55);
|
|
60
|
-
--card: oklch(0.25 0.01 264.55);
|
|
61
|
-
--card-foreground: oklch(0.95 0.01 264.55);
|
|
62
|
-
--popover: oklch(0.25 0.01 264.55);
|
|
63
|
-
--popover-foreground: oklch(0.95 0.01 264.55);
|
|
64
|
-
--primary: oklch(0.6 0.2 268.129);
|
|
65
|
-
--primary-foreground: oklch(0.95 0.01 264.55);
|
|
66
|
-
--secondary: oklch(0.13 0.027 261.692);
|
|
67
|
-
--secondary-foreground: oklch(0.9 0.01 264.55);
|
|
68
|
-
--muted: oklch(0.3 0.01 285);
|
|
69
|
-
--muted-foreground: oklch(0.75 0.01 249.82);
|
|
70
|
-
--accent: oklch(0.6 0.2 268.129 / 0.07);
|
|
71
|
-
--accent-foreground: oklch(0.95 0.01 264.55);
|
|
72
|
-
--success: oklch(0.6 0.2 154.83);
|
|
73
|
-
--success-foreground: oklch(0.2 0.1 165.45);
|
|
74
|
-
--destructive: oklch(0.55 0.2 27.325);
|
|
75
|
-
--destructive-foreground: oklch(0.9 0.01 264.55);
|
|
76
|
-
--destructive-4: oklch(0.2 0.01 17.438);
|
|
77
|
-
--info: oklch(0.65 0.2 241.34);
|
|
78
|
-
--info-foreground: oklch(0.95 0.01 248.61);
|
|
79
|
-
--warning: oklch(0.7 0.15 69.419);
|
|
80
|
-
--warning-foreground: oklch(0.2 0.1 63.95);
|
|
81
|
-
--warning-4: oklch(0.3 0.01 86.868);
|
|
82
|
-
--border: oklch(0.3 0.01 247.92);
|
|
83
|
-
--input: oklch(0.4 0.02 248.73);
|
|
84
|
-
--ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
85
|
-
--shadow: oklch(0 0 0 / 0.2);
|
|
86
|
-
|
|
87
|
-
--chart-1: oklch(0.7 0.2 41.116);
|
|
88
|
-
--chart-2: oklch(0.65 0.1 184.704);
|
|
89
|
-
--chart-3: oklch(0.6 0.07 227.392);
|
|
90
|
-
--chart-4: oklch(0.75 0.18 84.429);
|
|
91
|
-
--chart-5: oklch(0.7 0.18 70.08);
|
|
92
|
-
|
|
93
|
-
--sidebar: oklch(0.45 0.229 265.091); /* Background stateless #153DD1 */
|
|
94
|
-
--sidebar-foreground: oklch(1 0 0); /* Text Primary #ffffff */
|
|
95
|
-
--sidebar-primary: oklch(0.578 0.198 268.129); /* Accent Stateless #6879EB */
|
|
96
|
-
--sidebar-primary-foreground: oklch(1 0 0); /* Text Button Primary #ffffff */
|
|
97
|
-
--sidebar-accent: oklch(0.9641 0.0065 231.29); /* Background active #F3F7FA */
|
|
98
|
-
--sidebar-accent-foreground: oklch(0.3687 0.0313 264.55); /* Text Primary #37414B */
|
|
99
|
-
--sidebar-border: oklch(0.9103 0.0177 246.73); /* Borders Secondary #DFE7ED */
|
|
100
|
-
--sidebar-ring: oklch(0.6 0.2 268.129 / 0.7);
|
|
101
|
-
|
|
102
|
-
--panel: oklch(0.28 0.15 278.91);
|
|
103
|
-
--panel-foreground: oklch(0.98 0.01 264.55);
|
|
104
|
-
--panel-primary: oklch(0.35 0.18 278.91);
|
|
105
|
-
--panel-primary-foreground: oklch(1 0 0);
|
|
106
|
-
--panel-input: oklch(0.2 0.01 264.55);
|
|
107
|
-
--panel-ring: oklch(0.6 0.2 280.88);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@theme inline {
|
|
111
|
-
--color-background: var(--background);
|
|
112
|
-
--color-foreground: var(--foreground);
|
|
113
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
114
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
115
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
116
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
117
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
118
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
119
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
120
|
-
--color-sidebar: var(--sidebar);
|
|
121
|
-
--color-chart-5: var(--chart-5);
|
|
122
|
-
--color-chart-4: var(--chart-4);
|
|
123
|
-
--color-chart-3: var(--chart-3);
|
|
124
|
-
--color-chart-2: var(--chart-2);
|
|
125
|
-
--color-chart-1: var(--chart-1);
|
|
126
|
-
--color-ring: var(--ring);
|
|
127
|
-
--color-input: var(--input);
|
|
128
|
-
--color-border: var(--border);
|
|
129
|
-
--color-shadow: var(--shadow);
|
|
130
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
131
|
-
--color-accent: var(--accent);
|
|
132
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
133
|
-
--color-muted: var(--muted);
|
|
134
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
135
|
-
--color-secondary: var(--secondary);
|
|
136
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
137
|
-
--color-primary: var(--primary);
|
|
138
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
139
|
-
--color-popover: var(--popover);
|
|
140
|
-
--color-card-foreground: var(--card-foreground);
|
|
141
|
-
--color-card: var(--card);
|
|
142
|
-
|
|
143
|
-
--color-success: var(--success);
|
|
144
|
-
--color-success-foreground: var(--success-foreground);
|
|
145
|
-
--color-info: var(--info);
|
|
146
|
-
--color-info-foreground: var(--info-foreground);
|
|
147
|
-
--color-warning: var(--warning);
|
|
148
|
-
--color-warning-4: var(--warning-4);
|
|
149
|
-
--color-warning-foreground: var(--warning-foreground);
|
|
150
|
-
--color-destructive: var(--destructive);
|
|
151
|
-
--color-destructive-4: var(--destructive-4);
|
|
152
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
153
|
-
|
|
154
|
-
--color-panel: var(--panel);
|
|
155
|
-
--color-panel-foreground: var(--panel-foreground);
|
|
156
|
-
--color-panel-primary: var(--panel-primary);
|
|
157
|
-
--color-panel-primary-foreground: var(--panel-primary-foreground);
|
|
158
|
-
--color-panel-input: var(--panel-input);
|
|
159
|
-
--color-panel-ring: var(--panel-ring);
|
|
160
|
-
}
|