@raystack/apsara 0.48.5 → 0.49.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.
- package/dist/components/amount/amount.cjs +39 -17
- package/dist/components/amount/amount.cjs.map +1 -1
- package/dist/components/amount/amount.d.ts +2 -1
- package/dist/components/amount/amount.d.ts.map +1 -1
- package/dist/components/amount/amount.js +39 -17
- package/dist/components/amount/amount.js.map +1 -1
- package/dist/components/calendar/range-picker.cjs +19 -18
- package/dist/components/calendar/range-picker.cjs.map +1 -1
- package/dist/components/calendar/range-picker.d.ts +5 -4
- package/dist/components/calendar/range-picker.d.ts.map +1 -1
- package/dist/components/calendar/range-picker.js +19 -18
- package/dist/components/calendar/range-picker.js.map +1 -1
- package/dist/components/color-picker/color-picker-alpha.cjs +15 -0
- package/dist/components/color-picker/color-picker-alpha.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-alpha.d.ts +5 -0
- package/dist/components/color-picker/color-picker-alpha.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-alpha.js +13 -0
- package/dist/components/color-picker/color-picker-alpha.js.map +1 -0
- package/dist/components/color-picker/color-picker-area.cjs +73 -0
- package/dist/components/color-picker/color-picker-area.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-area.d.ts +4 -0
- package/dist/components/color-picker/color-picker-area.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-area.js +71 -0
- package/dist/components/color-picker/color-picker-area.js.map +1 -0
- package/dist/components/color-picker/color-picker-hue.cjs +15 -0
- package/dist/components/color-picker/color-picker-hue.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-hue.d.ts +5 -0
- package/dist/components/color-picker/color-picker-hue.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-hue.js +13 -0
- package/dist/components/color-picker/color-picker-hue.js.map +1 -0
- package/dist/components/color-picker/color-picker-input.cjs +16 -0
- package/dist/components/color-picker/color-picker-input.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-input.d.ts +4 -0
- package/dist/components/color-picker/color-picker-input.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-input.js +14 -0
- package/dist/components/color-picker/color-picker-input.js.map +1 -0
- package/dist/components/color-picker/color-picker-mode.cjs +16 -0
- package/dist/components/color-picker/color-picker-mode.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-mode.d.ts +8 -0
- package/dist/components/color-picker/color-picker-mode.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-mode.js +14 -0
- package/dist/components/color-picker/color-picker-mode.js.map +1 -0
- package/dist/components/color-picker/color-picker-root.cjs +53 -0
- package/dist/components/color-picker/color-picker-root.cjs.map +1 -0
- package/dist/components/color-picker/color-picker-root.d.ts +25 -0
- package/dist/components/color-picker/color-picker-root.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-root.js +50 -0
- package/dist/components/color-picker/color-picker-root.js.map +1 -0
- package/dist/components/color-picker/color-picker.cjs +19 -0
- package/dist/components/color-picker/color-picker.cjs.map +1 -0
- package/dist/components/color-picker/color-picker.js +17 -0
- package/dist/components/color-picker/color-picker.js.map +1 -0
- package/dist/components/color-picker/color-picker.module.css.cjs +8 -0
- package/dist/components/color-picker/color-picker.module.css.cjs.map +1 -0
- package/dist/components/color-picker/color-picker.module.css.js +4 -0
- package/dist/components/color-picker/color-picker.module.css.js.map +1 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.d.ts.map +1 -0
- package/dist/components/color-picker/utils.cjs +18 -0
- package/dist/components/color-picker/utils.cjs.map +1 -0
- package/dist/components/color-picker/utils.d.ts +11 -0
- package/dist/components/color-picker/utils.d.ts.map +1 -0
- package/dist/components/color-picker/utils.js +15 -0
- package/dist/components/color-picker/utils.js.map +1 -0
- package/dist/components/filter-chip/filter-chip.cjs +4 -5
- package/dist/components/filter-chip/filter-chip.cjs.map +1 -1
- package/dist/components/filter-chip/filter-chip.d.ts.map +1 -1
- package/dist/components/filter-chip/filter-chip.js +4 -5
- package/dist/components/filter-chip/filter-chip.js.map +1 -1
- package/dist/components/filter-chip/filter-chip.module.css.cjs +1 -1
- package/dist/components/filter-chip/filter-chip.module.css.js +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.cjs +986 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.js +982 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.js.map +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/index.cjs +86 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/index.js +82 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/index.js.map +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/route.cjs +103 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/route.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/route.js +99 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/route.js.map +1 -0
- package/dist/node_modules/.pnpm/color-name@2.0.0/node_modules/color-name/index.cjs +157 -0
- package/dist/node_modules/.pnpm/color-name@2.0.0/node_modules/color-name/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color-name@2.0.0/node_modules/color-name/index.js +153 -0
- package/dist/node_modules/.pnpm/color-name@2.0.0/node_modules/color-name/index.js.map +1 -0
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.cjs +235 -0
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js +231 -0
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js.map +1 -0
- package/dist/node_modules/.pnpm/color@5.0.0/node_modules/color/index.cjs +501 -0
- package/dist/node_modules/.pnpm/color@5.0.0/node_modules/color/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color@5.0.0/node_modules/color/index.js +497 -0
- package/dist/node_modules/.pnpm/color@5.0.0/node_modules/color/index.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/dist/components/textfield/index.d.ts +0 -2
- package/dist/components/textfield/index.d.ts.map +0 -1
- package/dist/components/textfield/textfield.cjs +0 -44
- package/dist/components/textfield/textfield.cjs.map +0 -1
- package/dist/components/textfield/textfield.d.ts +0 -33
- package/dist/components/textfield/textfield.d.ts.map +0 -1
- package/dist/components/textfield/textfield.js +0 -42
- package/dist/components/textfield/textfield.js.map +0 -1
- package/dist/components/textfield/textfield.module.css.cjs +0 -8
- package/dist/components/textfield/textfield.module.css.cjs.map +0 -1
- package/dist/components/textfield/textfield.module.css.js +0 -4
- package/dist/components/textfield/textfield.module.css.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raystack/apsara",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.1",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"engines": {
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"@tanstack/table-core": "^8.9.2",
|
|
113
113
|
"class-variance-authority": "^0.7.1",
|
|
114
114
|
"cmdk": "^0.2.0",
|
|
115
|
+
"color": "^5.0.0",
|
|
115
116
|
"dayjs": "^1.11.11",
|
|
116
117
|
"radix-ui": "^1.4.2",
|
|
117
118
|
"react": "^18.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/textfield/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
-
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var flex = require('../flex/flex.cjs');
|
|
7
|
-
var textfield_module = require('./textfield.module.css.cjs');
|
|
8
|
-
|
|
9
|
-
const textfield = index.cva(textfield_module.default.textfield, {
|
|
10
|
-
variants: {
|
|
11
|
-
size: {
|
|
12
|
-
small: textfield_module.default["textfield-sm"],
|
|
13
|
-
medium: textfield_module.default["textfield-md"],
|
|
14
|
-
},
|
|
15
|
-
state: {
|
|
16
|
-
invalid: textfield_module.default["textfield-invalid"],
|
|
17
|
-
valid: textfield_module.default["textfield-valid"],
|
|
18
|
-
},
|
|
19
|
-
hasLeadingElement: {
|
|
20
|
-
true: textfield_module.default["textfield-leading"],
|
|
21
|
-
},
|
|
22
|
-
hasTrailingElement: {
|
|
23
|
-
true: textfield_module.default["textfield-trailing"],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
size: "small",
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const TextField = React.forwardRef(({ leading, trailing, className, src, size, state, style, iconClass, ...props }, ref) => {
|
|
31
|
-
const hasLeadingElement = Boolean(leading);
|
|
32
|
-
const hasTrailingElement = Boolean(trailing);
|
|
33
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [hasLeadingElement ? (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { style: { left: "8px" }, className: index.cx(textfield_module.default.leadingIcon, iconClass?.leadingIcon), children: leading })) : null, jsxRuntime.jsxRuntimeExports.jsx("input", { className: index.cx(textfield({
|
|
34
|
-
size,
|
|
35
|
-
state,
|
|
36
|
-
className,
|
|
37
|
-
hasLeadingElement,
|
|
38
|
-
hasTrailingElement,
|
|
39
|
-
})), ...props, ref: ref }), hasTrailingElement ? (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { style: { right: "8px" }, className: index.cx(textfield_module.default.trailingIcon, iconClass?.trailingIcon), children: trailing })) : null] }));
|
|
40
|
-
});
|
|
41
|
-
TextField.displayName = "TextField";
|
|
42
|
-
|
|
43
|
-
exports.TextField = TextField;
|
|
44
|
-
//# sourceMappingURL=textfield.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.cjs","sources":["../../../components/textfield/textfield.tsx"],"sourcesContent":["import { cva, cx, VariantProps } from \"class-variance-authority\";\nimport { forwardRef, InputHTMLAttributes, PropsWithChildren } from \"react\";\n\nimport { Flex } from \"../flex\";\nimport styles from \"./textfield.module.css\";\n\nconst textfield = cva(styles.textfield, {\n variants: {\n size: {\n small: styles[\"textfield-sm\"],\n medium: styles[\"textfield-md\"],\n },\n\n state: {\n invalid: styles[\"textfield-invalid\"],\n valid: styles[\"textfield-valid\"],\n },\n\n hasLeadingElement: {\n true: styles[\"textfield-leading\"],\n },\n hasTrailingElement: {\n true: styles[\"textfield-trailing\"],\n },\n },\n defaultVariants: {\n size: \"small\",\n },\n});\n\nexport type TextfieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> &\n PropsWithChildren<VariantProps<typeof textfield>> & {\n leading?: React.ReactElement;\n trailing?: React.ReactElement;\n iconClass?: { leadingIcon?: string; trailingIcon?: string };\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextfieldProps>(\n (\n {\n leading,\n trailing,\n className,\n src,\n size,\n state,\n style,\n iconClass,\n ...props\n },\n ref\n ) => {\n const hasLeadingElement = Boolean(leading);\n const hasTrailingElement = Boolean(trailing);\n\n return (\n <Flex align=\"center\" style={{ position: \"relative\", width: \"100%\" }}>\n {hasLeadingElement ? (\n <Flex\n style={{ left: \"8px\" }}\n className={cx(styles.leadingIcon, iconClass?.leadingIcon)}\n >\n {leading}\n </Flex>\n ) : null}\n\n <input\n className={cx(\n textfield({\n size,\n state,\n className,\n hasLeadingElement,\n hasTrailingElement,\n })\n )}\n {...props}\n ref={ref}\n />\n\n {hasTrailingElement ? (\n <Flex\n style={{ right: \"8px\" }}\n className={cx(styles.trailingIcon, iconClass?.trailingIcon)}\n >\n {trailing}\n </Flex>\n ) : null}\n </Flex>\n );\n }\n);\n\nTextField.displayName = \"TextField\";\n"],"names":["cva","styles","forwardRef","_jsxs","Flex","_jsx","cx"],"mappings":";;;;;;;;AAMA,MAAM,SAAS,GAAGA,SAAG,CAACC,wBAAM,CAAC,SAAS,EAAE;AACtC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAEA,wBAAM,CAAC,cAAc,CAAC;AAC7B,YAAA,MAAM,EAAEA,wBAAM,CAAC,cAAc,CAAC;AAC/B,SAAA;AAED,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAEA,wBAAM,CAAC,mBAAmB,CAAC;AACpC,YAAA,KAAK,EAAEA,wBAAM,CAAC,iBAAiB,CAAC;AACjC,SAAA;AAED,QAAA,iBAAiB,EAAE;AACjB,YAAA,IAAI,EAAEA,wBAAM,CAAC,mBAAmB,CAAC;AAClC,SAAA;AACD,QAAA,kBAAkB,EAAE;AAClB,YAAA,IAAI,EAAEA,wBAAM,CAAC,oBAAoB,CAAC;AACnC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;AACd,KAAA;AACF,CAAA,CAAC,CAAC;AAYI,MAAM,SAAS,GAAGC,gBAAU,CACjC,CACE,EACE,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3C,IAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE7C,IAAA,QACEC,iCAAA,CAACC,SAAI,EAAA,EAAC,KAAK,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,CAChE,iBAAiB,IAChBC,gCAAA,CAACD,SAAI,EAAA,EACH,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EACtB,SAAS,EAAEE,QAAE,CAACL,wBAAM,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,EAExD,QAAA,EAAA,OAAO,EACH,CAAA,IACL,IAAI,EAERI,gCAAA,CAAA,OAAA,EAAA,EACE,SAAS,EAAEC,QAAE,CACX,SAAS,CAAC;oBACR,IAAI;oBACJ,KAAK;oBACL,SAAS;oBACT,iBAAiB;oBACjB,kBAAkB;iBACnB,CAAC,CACH,KACG,KAAK,EACT,GAAG,EAAE,GAAG,GACR,EAED,kBAAkB,IACjBD,gCAAC,CAAAD,SAAI,IACH,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EACvB,SAAS,EAAEE,QAAE,CAACL,wBAAM,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,EAE1D,QAAA,EAAA,QAAQ,GACJ,IACL,IAAI,CACH,EAAA,CAAA,EACP;AACJ,CAAC,EACD;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
|
-
import { InputHTMLAttributes, PropsWithChildren } from "react";
|
|
3
|
-
declare const textfield: (props?: ({
|
|
4
|
-
size?: "small" | "medium" | null | undefined;
|
|
5
|
-
state?: "invalid" | "valid" | null | undefined;
|
|
6
|
-
hasLeadingElement?: boolean | null | undefined;
|
|
7
|
-
hasTrailingElement?: boolean | null | undefined;
|
|
8
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
-
export type TextfieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & PropsWithChildren<VariantProps<typeof textfield>> & {
|
|
10
|
-
leading?: React.ReactElement;
|
|
11
|
-
trailing?: React.ReactElement;
|
|
12
|
-
iconClass?: {
|
|
13
|
-
leadingIcon?: string;
|
|
14
|
-
trailingIcon?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const TextField: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & VariantProps<(props?: ({
|
|
18
|
-
size?: "small" | "medium" | null | undefined;
|
|
19
|
-
state?: "invalid" | "valid" | null | undefined;
|
|
20
|
-
hasLeadingElement?: boolean | null | undefined;
|
|
21
|
-
hasTrailingElement?: boolean | null | undefined;
|
|
22
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
23
|
-
children?: import("react").ReactNode;
|
|
24
|
-
} & {
|
|
25
|
-
leading?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
26
|
-
trailing?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
27
|
-
iconClass?: {
|
|
28
|
-
leadingIcon?: string | undefined;
|
|
29
|
-
trailingIcon?: string | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=textfield.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.d.ts","sourceRoot":"","sources":["../../../components/textfield/textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAc,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK3E,QAAA,MAAM,SAAS;;;;;8EAsBb,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP,GACC,iBAAiB,CAAC,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC,GAAG;IAClD,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,SAAS,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7D,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;;;;oDAsDrB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
import { Flex } from '../flex/flex.js';
|
|
5
|
-
import styles from './textfield.module.css.js';
|
|
6
|
-
|
|
7
|
-
const textfield = cva(styles.textfield, {
|
|
8
|
-
variants: {
|
|
9
|
-
size: {
|
|
10
|
-
small: styles["textfield-sm"],
|
|
11
|
-
medium: styles["textfield-md"],
|
|
12
|
-
},
|
|
13
|
-
state: {
|
|
14
|
-
invalid: styles["textfield-invalid"],
|
|
15
|
-
valid: styles["textfield-valid"],
|
|
16
|
-
},
|
|
17
|
-
hasLeadingElement: {
|
|
18
|
-
true: styles["textfield-leading"],
|
|
19
|
-
},
|
|
20
|
-
hasTrailingElement: {
|
|
21
|
-
true: styles["textfield-trailing"],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
size: "small",
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
const TextField = forwardRef(({ leading, trailing, className, src, size, state, style, iconClass, ...props }, ref) => {
|
|
29
|
-
const hasLeadingElement = Boolean(leading);
|
|
30
|
-
const hasTrailingElement = Boolean(trailing);
|
|
31
|
-
return (jsxRuntimeExports.jsxs(Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [hasLeadingElement ? (jsxRuntimeExports.jsx(Flex, { style: { left: "8px" }, className: cx(styles.leadingIcon, iconClass?.leadingIcon), children: leading })) : null, jsxRuntimeExports.jsx("input", { className: cx(textfield({
|
|
32
|
-
size,
|
|
33
|
-
state,
|
|
34
|
-
className,
|
|
35
|
-
hasLeadingElement,
|
|
36
|
-
hasTrailingElement,
|
|
37
|
-
})), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports.jsx(Flex, { style: { right: "8px" }, className: cx(styles.trailingIcon, iconClass?.trailingIcon), children: trailing })) : null] }));
|
|
38
|
-
});
|
|
39
|
-
TextField.displayName = "TextField";
|
|
40
|
-
|
|
41
|
-
export { TextField };
|
|
42
|
-
//# sourceMappingURL=textfield.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.js","sources":["../../../components/textfield/textfield.tsx"],"sourcesContent":["import { cva, cx, VariantProps } from \"class-variance-authority\";\nimport { forwardRef, InputHTMLAttributes, PropsWithChildren } from \"react\";\n\nimport { Flex } from \"../flex\";\nimport styles from \"./textfield.module.css\";\n\nconst textfield = cva(styles.textfield, {\n variants: {\n size: {\n small: styles[\"textfield-sm\"],\n medium: styles[\"textfield-md\"],\n },\n\n state: {\n invalid: styles[\"textfield-invalid\"],\n valid: styles[\"textfield-valid\"],\n },\n\n hasLeadingElement: {\n true: styles[\"textfield-leading\"],\n },\n hasTrailingElement: {\n true: styles[\"textfield-trailing\"],\n },\n },\n defaultVariants: {\n size: \"small\",\n },\n});\n\nexport type TextfieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> &\n PropsWithChildren<VariantProps<typeof textfield>> & {\n leading?: React.ReactElement;\n trailing?: React.ReactElement;\n iconClass?: { leadingIcon?: string; trailingIcon?: string };\n };\n\nexport const TextField = forwardRef<HTMLInputElement, TextfieldProps>(\n (\n {\n leading,\n trailing,\n className,\n src,\n size,\n state,\n style,\n iconClass,\n ...props\n },\n ref\n ) => {\n const hasLeadingElement = Boolean(leading);\n const hasTrailingElement = Boolean(trailing);\n\n return (\n <Flex align=\"center\" style={{ position: \"relative\", width: \"100%\" }}>\n {hasLeadingElement ? (\n <Flex\n style={{ left: \"8px\" }}\n className={cx(styles.leadingIcon, iconClass?.leadingIcon)}\n >\n {leading}\n </Flex>\n ) : null}\n\n <input\n className={cx(\n textfield({\n size,\n state,\n className,\n hasLeadingElement,\n hasTrailingElement,\n })\n )}\n {...props}\n ref={ref}\n />\n\n {hasTrailingElement ? (\n <Flex\n style={{ right: \"8px\" }}\n className={cx(styles.trailingIcon, iconClass?.trailingIcon)}\n >\n {trailing}\n </Flex>\n ) : null}\n </Flex>\n );\n }\n);\n\nTextField.displayName = \"TextField\";\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAMA,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE;AACtC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC;AAC7B,YAAA,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;AAC/B,SAAA;AAED,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAE,MAAM,CAAC,mBAAmB,CAAC;AACpC,YAAA,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC;AACjC,SAAA;AAED,QAAA,iBAAiB,EAAE;AACjB,YAAA,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAClC,SAAA;AACD,QAAA,kBAAkB,EAAE;AAClB,YAAA,IAAI,EAAE,MAAM,CAAC,oBAAoB,CAAC;AACnC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;AACd,KAAA;AACF,CAAA,CAAC,CAAC;AAYI,MAAM,SAAS,GAAG,UAAU,CACjC,CACE,EACE,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3C,IAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE7C,IAAA,QACEA,sBAAA,CAAC,IAAI,EAAA,EAAC,KAAK,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,CAChE,iBAAiB,IAChBC,qBAAA,CAAC,IAAI,EAAA,EACH,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EACtB,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,EAExD,QAAA,EAAA,OAAO,EACH,CAAA,IACL,IAAI,EAERA,qBAAA,CAAA,OAAA,EAAA,EACE,SAAS,EAAE,EAAE,CACX,SAAS,CAAC;oBACR,IAAI;oBACJ,KAAK;oBACL,SAAS;oBACT,iBAAiB;oBACjB,kBAAkB;iBACnB,CAAC,CACH,KACG,KAAK,EACT,GAAG,EAAE,GAAG,GACR,EAED,kBAAkB,IACjBA,qBAAC,CAAA,IAAI,IACH,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EACvB,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,EAE1D,QAAA,EAAA,QAAQ,GACJ,IACL,IAAI,CACH,EAAA,CAAA,EACP;AACJ,CAAC,EACD;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var styles = {"textfield":"textfield-module_textfield__cySak","textfield-sm":"textfield-module_textfield-sm__qV3UP","textfield-md":"textfield-module_textfield-md__NjPcU","textfield-invalid":"textfield-module_textfield-invalid__XJ0Kh","textfield-valid":"textfield-module_textfield-valid__v1-gi","textfield-leading":"textfield-module_textfield-leading__DZR7m","textfield-trailing":"textfield-module_textfield-trailing__PWZP5","leadingIcon":"textfield-module_leadingIcon__2Qz-5","trailingIcon":"textfield-module_trailingIcon__qsW-P","textfield___sm":"textfield-module_textfield-sm__qV3UP","textfield___md":"textfield-module_textfield-md__NjPcU","textfield___invalid":"textfield-module_textfield-invalid__XJ0Kh","textfield___valid":"textfield-module_textfield-valid__v1-gi","textfield___leading":"textfield-module_textfield-leading__DZR7m","textfield___trailing":"textfield-module_textfield-trailing__PWZP5"};
|
|
6
|
-
|
|
7
|
-
exports.default = styles;
|
|
8
|
-
//# sourceMappingURL=textfield.module.css.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var styles = {"textfield":"textfield-module_textfield__cySak","textfield-sm":"textfield-module_textfield-sm__qV3UP","textfield-md":"textfield-module_textfield-md__NjPcU","textfield-invalid":"textfield-module_textfield-invalid__XJ0Kh","textfield-valid":"textfield-module_textfield-valid__v1-gi","textfield-leading":"textfield-module_textfield-leading__DZR7m","textfield-trailing":"textfield-module_textfield-trailing__PWZP5","leadingIcon":"textfield-module_leadingIcon__2Qz-5","trailingIcon":"textfield-module_trailingIcon__qsW-P","textfield___sm":"textfield-module_textfield-sm__qV3UP","textfield___md":"textfield-module_textfield-md__NjPcU","textfield___invalid":"textfield-module_textfield-invalid__XJ0Kh","textfield___valid":"textfield-module_textfield-valid__v1-gi","textfield___leading":"textfield-module_textfield-leading__DZR7m","textfield___trailing":"textfield-module_textfield-trailing__PWZP5"};
|
|
2
|
-
|
|
3
|
-
export { styles as default };
|
|
4
|
-
//# sourceMappingURL=textfield.module.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|