@audius/harmony 0.0.25 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/dist/components/button/BaseButton/BaseButton.d.ts +2 -2
- package/dist/components/button/BaseButton/types.d.ts +2 -2
- package/dist/components/button/BaseButton/types.d.ts.map +1 -1
- package/dist/components/button/Button/Button.d.ts.map +1 -1
- package/dist/components/button/Button/Button.js +15 -2
- package/dist/components/button/Button/Button.js.map +1 -1
- package/dist/components/button/Button/types.d.ts +1 -1
- package/dist/components/button/Button/types.d.ts.map +1 -1
- package/dist/components/hint/Hint.d.ts +2 -0
- package/dist/components/hint/Hint.d.ts.map +1 -1
- package/dist/components/hint/Hint.js +6 -2
- package/dist/components/hint/Hint.js.map +1 -1
- package/dist/components/icon.d.ts +1 -2
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/input/PasswordInput/PasswordInput.js +1 -0
- package/dist/components/input/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/input/SelectablePill/SelectablePill.d.ts.map +1 -1
- package/dist/components/input/SelectablePill/SelectablePill.js +8 -6
- package/dist/components/input/SelectablePill/SelectablePill.js.map +1 -1
- package/dist/components/input/TextInput/index.d.ts +1 -1
- package/dist/components/input/TextInput/index.d.ts.map +1 -1
- package/dist/components/input/TextInput/types.d.ts +1 -1
- package/dist/components/input/TextInput/types.js.map +1 -1
- package/dist/components/input/TokenAmountInput/TokenAmountInput.js +1 -0
- package/dist/components/input/TokenAmountInput/TokenAmountInput.js.map +1 -1
- package/dist/components/text/Text/Text.d.ts.map +1 -1
- package/dist/components/text/Text/Text.js +11 -7
- package/dist/components/text/Text/Text.js.map +1 -1
- package/dist/components/text/Text/constants.d.ts +13 -0
- package/dist/components/text/Text/constants.d.ts.map +1 -1
- package/dist/components/text/Text/constants.js +13 -0
- package/dist/components/text/Text/constants.js.map +1 -1
- package/dist/components/text/Text/types.d.ts +1 -0
- package/dist/components/text/Text/types.d.ts.map +1 -1
- package/dist/components/text-link/TextLink.d.ts +14 -2
- package/dist/components/text-link/TextLink.d.ts.map +1 -1
- package/dist/components/text-link/TextLink.js +10 -7
- package/dist/components/text-link/TextLink.js.map +1 -1
- package/dist/components/text-link/index.d.ts +1 -0
- package/dist/components/text-link/index.d.ts.map +1 -1
- package/dist/components/text-link/types.d.ts +6 -2
- package/dist/components/text-link/types.d.ts.map +1 -1
- package/dist/foundations/spacing/spacing.d.ts +1 -0
- package/dist/foundations/spacing/spacing.d.ts.map +1 -1
- package/dist/foundations/spacing/spacing.js.map +1 -1
- package/dist/foundations/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/foundations/theme/ThemeProvider.js +2 -7
- package/dist/foundations/theme/ThemeProvider.js.map +1 -1
- package/dist/harmony.css +1 -1
- package/dist/icons/specialIcons.d.ts +0 -2
- package/dist/icons/specialIcons.d.ts.map +1 -1
- package/dist/icons/specialIcons.js +1 -5
- package/dist/icons/specialIcons.js.map +1 -1
- package/dist/icons/utilityIcons.d.ts +2 -0
- package/dist/icons/utilityIcons.d.ts.map +1 -1
- package/dist/icons/utilityIcons.js +5 -1
- package/dist/icons/utilityIcons.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -20
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img height="288px" src="
|
|
3
|
-
<img height="288px" src="
|
|
2
|
+
<img height="288px" src="https://github.com/AudiusProject/audius-protocol/blob/main/packages/harmony/src/storybook/assets/harmonyLogoDark.png#gh-dark-mode-only">
|
|
3
|
+
<img height="288px" src="https://github.com/AudiusProject/audius-protocol/blob/main/packages/harmony/src/storybook/assets/harmonyLogo.png?raw=true#gh-light-mode-only">
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
Harmony is design system focused on collaboration, reusability, and scalability.
|
|
@@ -22,13 +22,7 @@ Full documentation can be found here: [Harmony Docs](https://harmony.audius.co)
|
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
|
-
Install `@audius/harmony
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install --save @emotion/react @emotion/styled @radix-ui/react-slot @react-spring/web classnames lodash react-lottie react-merge-refs react-perfect-scrollbar react-use react-use-measure
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Then install `@audius/harmony`
|
|
25
|
+
Install `@audius/harmony`:
|
|
32
26
|
|
|
33
27
|
```bash
|
|
34
28
|
npm install --save @audius/harmony
|
|
@@ -48,18 +42,15 @@ Setup the ThemeProvider exported by Harmony
|
|
|
48
42
|
import { ThemeProvider as HarmonyThemeProvider } from '@audius/harmony'
|
|
49
43
|
|
|
50
44
|
const App = () => {
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<HarmonyThemeProvider theme='day'>
|
|
54
|
-
...
|
|
55
|
-
</HarmonyThemeProvider>
|
|
56
|
-
)
|
|
45
|
+
return <HarmonyThemeProvider theme='day'>...</HarmonyThemeProvider>
|
|
57
46
|
}
|
|
58
47
|
```
|
|
59
48
|
|
|
60
49
|
In order use emotion yourself, follow their documentation for [setting up the css-prop](https://emotion.sh/docs/css-prop)
|
|
61
50
|
|
|
62
|
-
If using typescript
|
|
51
|
+
If using typescript you will need to:
|
|
52
|
+
|
|
53
|
+
1. Add an emotion.d.ts file and include the following for access to harmony's theme type
|
|
63
54
|
|
|
64
55
|
```ts
|
|
65
56
|
import '@emotion/react'
|
|
@@ -68,18 +59,28 @@ import type { HarmonyTheme } from '@audius/harmony'
|
|
|
68
59
|
declare module '@emotion/react' {
|
|
69
60
|
export interface Theme extends HarmonyTheme {}
|
|
70
61
|
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. Update your tsconfig to specify the jsxImportLocation:
|
|
71
65
|
|
|
66
|
+
```ts
|
|
67
|
+
{
|
|
68
|
+
"compilerOptions": {
|
|
69
|
+
"jsxImportSource": "@emotion/react",
|
|
70
|
+
...
|
|
71
|
+
}
|
|
72
|
+
}
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
## Usage
|
|
75
76
|
|
|
76
77
|
```tsx
|
|
77
|
-
import { Button,
|
|
78
|
+
import { Button, Flex } from '@audius/harmony'
|
|
78
79
|
|
|
79
80
|
const App = () => {
|
|
80
81
|
return (
|
|
81
82
|
<Flex gap='m'>
|
|
82
|
-
<Button variant=
|
|
83
|
+
<Button variant='secondary'>Click This!</Button>
|
|
83
84
|
<Button>Click That!</Button>
|
|
84
85
|
</Flex>
|
|
85
86
|
)
|
|
@@ -97,4 +98,3 @@ npm run storybook
|
|
|
97
98
|
## Contribution
|
|
98
99
|
|
|
99
100
|
A Contribution Guide is [available here](https://www.notion.so/audiusproject/Submitting-for-Design-Updates-52a8bc3bb68747818a96d2721bace27f).
|
|
100
|
-
|
|
@@ -5,8 +5,8 @@ import { CSSObject } from '@emotion/react';
|
|
|
5
5
|
* `Button` or `PlainButton`.
|
|
6
6
|
*/
|
|
7
7
|
export declare const BaseButton: (props: {
|
|
8
|
-
iconLeft?: import("../..").IconComponent | undefined;
|
|
9
|
-
iconRight?: import("../..").IconComponent | undefined;
|
|
8
|
+
iconLeft?: import("../..").IconComponent | null | undefined;
|
|
9
|
+
iconRight?: import("../..").IconComponent | null | undefined;
|
|
10
10
|
isStaticIcon?: boolean | undefined;
|
|
11
11
|
isLoading?: boolean | undefined;
|
|
12
12
|
widthToHideText?: number | undefined;
|
|
@@ -26,11 +26,11 @@ export type BaseButtonProps = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Optional icon element to include on the left side of the button
|
|
28
28
|
*/
|
|
29
|
-
iconLeft?: IconComponent;
|
|
29
|
+
iconLeft?: IconComponent | null;
|
|
30
30
|
/**
|
|
31
31
|
* Optional icon element to include on the right side of the button
|
|
32
32
|
*/
|
|
33
|
-
iconRight?: IconComponent;
|
|
33
|
+
iconRight?: IconComponent | null;
|
|
34
34
|
/**
|
|
35
35
|
* When true, do not override icon's fill colors
|
|
36
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/button/BaseButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAA;AAEhF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtD,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;AAEhE;;;KAGK;AACL,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/button/BaseButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAA;AAEhF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtD,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;AAEhE;;;KAGK;AACL,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,eAAe,GACjB,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button/Button.tsx"],"names":[],"mappings":";AAaA;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button/Button.tsx"],"names":[],"mappings":";AAaA;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;sNA+PlB,CAAA"}
|
|
@@ -88,6 +88,16 @@ var Button = forwardRef(function Button(props, ref) {
|
|
|
88
88
|
var tertiaryStyles = __assign(__assign(__assign({ backgroundColor: type === 'dark' ? 'rgba(50, 51, 77, 0.6)' : 'rgb(255, 255, 255, 0.85)', color: themeColors.text.default, backdropFilter: 'blur(6px)', boxShadow: "0 0 0 1px inset ".concat(themeColors.border.default, ", ").concat(shadows.near), '&:hover': tertiaryHoverStyles, '&:active': tertiaryActiveStyles }, (_isHovered && tertiaryHoverStyles)), (_isPressed && tertiaryActiveStyles)), (isDisabled && {
|
|
89
89
|
opacity: 0.45
|
|
90
90
|
}));
|
|
91
|
+
var commonHoverStyles = {
|
|
92
|
+
backgroundColor: themeColors.neutral.n25
|
|
93
|
+
};
|
|
94
|
+
var commonActiveStyles = {
|
|
95
|
+
backgroundColor: themeColors.neutral.n100
|
|
96
|
+
};
|
|
97
|
+
var commonStyles = __assign(__assign(__assign({ backgroundColor: themeColors.special.white, color: themeColors.text.default, boxShadow: "0 0 0 1px inset ".concat(themeColors.border.strong), '&:hover': commonHoverStyles, '&:active': commonActiveStyles }, (_isHovered && commonHoverStyles)), (_isPressed && commonActiveStyles)), (isDisabled && {
|
|
98
|
+
backgroundColor: themeColors.neutral.n150,
|
|
99
|
+
boxShadow: 'none'
|
|
100
|
+
}));
|
|
91
101
|
var destructiveHoverStyles = {
|
|
92
102
|
backgroundColor: themeColors.special.red,
|
|
93
103
|
color: themeColors.static.white
|
|
@@ -117,7 +127,9 @@ var Button = forwardRef(function Button(props, ref) {
|
|
|
117
127
|
? tertiaryStyles
|
|
118
128
|
: variant === 'destructive'
|
|
119
129
|
? destructiveStyles
|
|
120
|
-
:
|
|
130
|
+
: variant === 'common'
|
|
131
|
+
? commonStyles
|
|
132
|
+
: primaryStyles)), { '::before': {
|
|
121
133
|
zIndex: -1,
|
|
122
134
|
content: '""',
|
|
123
135
|
position: 'absolute',
|
|
@@ -126,7 +138,8 @@ var Button = forwardRef(function Button(props, ref) {
|
|
|
126
138
|
right: 0,
|
|
127
139
|
bottom: 0,
|
|
128
140
|
backgroundColor: 'rgba(0, 0, 0, 0)'
|
|
129
|
-
} }), (variant !== 'tertiary' &&
|
|
141
|
+
} }), (variant !== 'tertiary' &&
|
|
142
|
+
variant !== 'common' && __assign(__assign({ ':hover': hoverStyles, ':active': activeStyles }, (_isHovered && hoverStyles)), (_isPressed && activeStyles))));
|
|
130
143
|
var iconCss = size === 'small'
|
|
131
144
|
? smallIconStyles
|
|
132
145
|
: size === 'large'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../src/components/button/Button/Button.tsx"],"sourcesContent":["import { CSSProperties, forwardRef } from 'react'\n\nimport { CSSObject, useTheme } from '@emotion/react'\n\nimport { toCSSVariableName } from '../../../utils/styles'\nimport { BaseButton } from '../BaseButton/BaseButton'\n\nimport { ButtonProps } from './types'\n\ntype CSSCustomProperties = CSSProperties & {\n [index: `--${string}`]: any\n}\n\n/**\n * Buttons allow users to trigger an action or event with a single click.\n * For example, you can use a button for allowing the functionality of\n * submitting a form, opening a dialog, canceling an action, or performing\n * a delete operation.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(props, ref) {\n const {\n color,\n hexColor,\n variant = 'primary',\n size = 'default',\n disabled,\n ...baseProps\n } = props\n const { _isHovered, _isPressed, isLoading } = baseProps\n const isDisabled = disabled || isLoading\n const {\n type,\n color: themeColors,\n cornerRadius,\n shadows,\n spacing,\n typography\n } = useTheme()\n\n // Size Styles\n const smallStyles: CSSObject = {\n gap: spacing.xs,\n height: spacing.unit8,\n paddingInline: spacing.m,\n fontSize: typography.size.s,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.s,\n textTransform: 'capitalize'\n }\n const smallIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit4,\n height: spacing.unit4\n }\n\n const defaultStyles: CSSObject = {\n gap: spacing.s,\n height: spacing.unit12,\n paddingInline: spacing.xl,\n fontSize: typography.size.l,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.l,\n textTransform: 'capitalize'\n }\n const defaultIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit5,\n height: spacing.unit5\n }\n\n const largeStyles: CSSObject = {\n gap: spacing.s,\n height: spacing.unit16,\n paddingInline: spacing.xl,\n fontSize: typography.size.xl,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.m,\n letterSpacing: '0.25px',\n textTransform: 'uppercase'\n }\n const largeIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit6,\n height: spacing.unit6\n }\n\n // Variant Styles\n const primaryStyles: CSSObject = {\n '&:hover': { color: themeColors.static.white },\n\n ...((_isHovered || _isPressed) && { color: themeColors.static.white }),\n ...(isDisabled && {\n backgroundColor: themeColors.neutral.n150,\n boxShadow: 'none'\n })\n }\n\n const secondaryHoverStyles: CSSObject = {\n backgroundColor: themeColors.primary.primary,\n color: themeColors.static.white\n }\n const secondaryStyles: CSSObject = {\n backgroundColor: 'transparent',\n color: themeColors.text.default,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}`,\n\n '&:hover': secondaryHoverStyles,\n '&:active': secondaryHoverStyles,\n\n ...((_isHovered || _isPressed) && secondaryHoverStyles),\n ...(isDisabled && {\n backgroundColor: themeColors.neutral.n150,\n color: themeColors.static.white,\n boxShadow: 'none'\n })\n }\n\n const tertiaryHoverStyles: CSSObject = {\n backgroundColor: themeColors.background.white,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}, ${shadows.mid}`,\n color: themeColors.text.default\n }\n const tertiaryActiveStyles: CSSObject = {\n backgroundColor: themeColors.background.surface2,\n backdropFilter: 'none',\n color: themeColors.text.default,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}`\n }\n const tertiaryStyles: CSSObject = {\n backgroundColor:\n type === 'dark' ? 'rgba(50, 51, 77, 0.6)' : 'rgb(255, 255, 255, 0.85)',\n color: themeColors.text.default,\n backdropFilter: 'blur(6px)',\n boxShadow: `0 0 0 1px inset ${themeColors.border.default}, ${shadows.near}`,\n\n '&:hover': tertiaryHoverStyles,\n '&:active': tertiaryActiveStyles,\n\n ...(_isHovered && tertiaryHoverStyles),\n ...(_isPressed && tertiaryActiveStyles),\n ...(isDisabled && {\n opacity: 0.45\n })\n }\n\n const destructiveHoverStyles: CSSObject = {\n backgroundColor: themeColors.special.red,\n color: themeColors.static.white\n }\n const destructiveStyles: CSSObject = {\n backgroundColor: 'transparent',\n color: themeColors.special.red,\n boxShadow: `0 0 0 1px inset ${themeColors.special.red}`,\n\n '&:hover': destructiveHoverStyles,\n '&:active': destructiveHoverStyles,\n\n ...((_isHovered || _isPressed) && destructiveHoverStyles),\n ...(isDisabled && {\n opacity: 0.45\n })\n }\n\n const hoverStyles: CSSObject = {\n boxShadow: shadows.mid,\n '&::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.2)'\n }\n }\n const activeStyles: CSSObject = {\n boxShadow: 'none',\n '&::before': {\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\n }\n }\n\n const buttonCss: CSSObject = {\n backgroundColor: themeColors.primary.primary,\n color: themeColors.static.white,\n boxSizing: 'border-box',\n border: 'none',\n borderRadius: cornerRadius.s,\n boxShadow: shadows.near,\n\n ...(size === 'small'\n ? smallStyles\n : size === 'large'\n ? largeStyles\n : defaultStyles),\n\n ...(variant === 'secondary'\n ? secondaryStyles\n : variant === 'tertiary'\n ? tertiaryStyles\n : variant === 'destructive'\n ? destructiveStyles\n : primaryStyles),\n\n '::before': {\n zIndex: -1,\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0)'\n },\n\n ...(variant !== 'tertiary' && {\n ':hover': hoverStyles,\n ':active': activeStyles,\n ...(_isHovered && hoverStyles),\n ...(_isPressed && activeStyles)\n })\n }\n\n const iconCss =\n size === 'small'\n ? smallIconStyles\n : size === 'large'\n ? largeIconStyles\n : defaultIconStyles\n\n const style: CSSCustomProperties =\n variant === 'primary' && !isDisabled\n ? {\n backgroundColor:\n hexColor ||\n (color ? `var(${toCSSVariableName(color)})` : undefined)\n }\n : {}\n\n return (\n <BaseButton\n ref={ref}\n disabled={isDisabled}\n styles={{\n button: buttonCss,\n icon: iconCss\n }}\n style={style}\n {...baseProps}\n />\n )\n }\n)\n"],"names":["_jsx"],"mappings":";;;;;;;AAaA;;;;;AAKG;AACU,IAAA,MAAM,GAAG,UAAU,CAC9B,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG,EAAA;AAEtB,IAAA,IAAA,KAAK,GAMH,KAAK,CANF,KAAA,EACL,QAAQ,GAKN,KAAK,CALC,QAAA,EACR,KAIE,KAAK,CAAA,OAJY,EAAnB,OAAO,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,SAAS,GAAA,EAAA,EACnB,EAGE,GAAA,KAAK,KAHS,EAAhB,IAAI,mBAAG,SAAS,GAAA,EAAA,EAChB,QAAQ,GAEN,KAAK,CAAA,QAFC,EACL,SAAS,GAAA,MAAA,CACV,KAAK,EAPH,CAAA,OAAA,EAAA,UAAA,EAAA,SAAA,EAAA,MAAA,EAAA,UAAA,CAOL,CADa,CACL;AACD,IAAA,IAAA,UAAU,GAA4B,SAAS,CAAA,UAArC,EAAE,UAAU,GAAgB,SAAS,CAAA,UAAzB,EAAE,SAAS,GAAK,SAAS,UAAd,CAAc;AACvD,IAAA,IAAM,UAAU,GAAG,QAAQ,IAAI,SAAS,CAAA;IAClC,IAAA,EAAA,GAOF,QAAQ,EAAE,EANZ,IAAI,GAAA,EAAA,CAAA,IAAA,EACG,WAAW,GAAA,EAAA,CAAA,KAAA,EAClB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,UAAU,GAAA,EAAA,CAAA,UACE,CAAA;;AAGd,IAAA,IAAM,WAAW,GAAc;QAC7B,GAAG,EAAE,OAAO,CAAC,EAAE;QACf,MAAM,EAAE,OAAO,CAAC,KAAK;QACrB,aAAa,EAAE,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,EAAE,CAAC;AACR,YAAA,MAAM,EAAE,CAAC;AACT,YAAA,eAAe,EAAE,kBAAkB;SACpC,EAEE,CAAA,GAAC,OAAO,KAAK,UAAU,IAAA,QAAA,CAAA,QAAA,CAAA,EACxB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,YAAY,EAAA,GACnB,UAAU,IAAI,WAAW,EAAC,GAC1B,UAAU,IAAI,YAAY,EAC/B,EACF,CAAA;AAED,IAAA,IAAM,OAAO,GACX,IAAI,KAAK,OAAO;AACd,UAAE,eAAe;UACf,IAAI,KAAK,OAAO;AAClB,cAAE,eAAe;cACf,iBAAiB,CAAA;AAEvB,IAAA,IAAM,KAAK,GACT,OAAO,KAAK,SAAS,IAAI,CAAC,UAAU;AAClC,UAAE;AACE,YAAA,eAAe,EACb,QAAQ;AACR,iBAAC,KAAK,GAAG,cAAO,iBAAiB,CAAC,KAAK,CAAC,EAAG,GAAA,CAAA,GAAG,SAAS,CAAC;AAC3D,SAAA;UACD,EAAE,CAAA;AAER,IAAA,QACEA,GAAA,CAAC,UAAU,EAAA,QAAA,CAAA,EACT,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE;AACN,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,IAAI,EAAE,OAAO;AACd,SAAA,EACD,KAAK,EAAE,KAAK,IACR,SAAS,CAAA,CACb,EACH;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/button/Button/Button.tsx"],"sourcesContent":["import { CSSProperties, forwardRef } from 'react'\n\nimport { CSSObject, useTheme } from '@emotion/react'\n\nimport { toCSSVariableName } from '../../../utils/styles'\nimport { BaseButton } from '../BaseButton/BaseButton'\n\nimport { ButtonProps } from './types'\n\ntype CSSCustomProperties = CSSProperties & {\n [index: `--${string}`]: any\n}\n\n/**\n * Buttons allow users to trigger an action or event with a single click.\n * For example, you can use a button for allowing the functionality of\n * submitting a form, opening a dialog, canceling an action, or performing\n * a delete operation.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(props, ref) {\n const {\n color,\n hexColor,\n variant = 'primary',\n size = 'default',\n disabled,\n ...baseProps\n } = props\n const { _isHovered, _isPressed, isLoading } = baseProps\n const isDisabled = disabled || isLoading\n const {\n type,\n color: themeColors,\n cornerRadius,\n shadows,\n spacing,\n typography\n } = useTheme()\n\n // Size Styles\n const smallStyles: CSSObject = {\n gap: spacing.xs,\n height: spacing.unit8,\n paddingInline: spacing.m,\n fontSize: typography.size.s,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.s,\n textTransform: 'capitalize'\n }\n const smallIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit4,\n height: spacing.unit4\n }\n\n const defaultStyles: CSSObject = {\n gap: spacing.s,\n height: spacing.unit12,\n paddingInline: spacing.xl,\n fontSize: typography.size.l,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.l,\n textTransform: 'capitalize'\n }\n const defaultIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit5,\n height: spacing.unit5\n }\n\n const largeStyles: CSSObject = {\n gap: spacing.s,\n height: spacing.unit16,\n paddingInline: spacing.xl,\n fontSize: typography.size.xl,\n fontWeight: typography.weight.bold,\n lineHeight: typography.lineHeight.m,\n letterSpacing: '0.25px',\n textTransform: 'uppercase'\n }\n const largeIconStyles: CSSObject = {\n zIndex: 1,\n width: spacing.unit6,\n height: spacing.unit6\n }\n\n // Variant Styles\n const primaryStyles: CSSObject = {\n '&:hover': { color: themeColors.static.white },\n\n ...((_isHovered || _isPressed) && { color: themeColors.static.white }),\n ...(isDisabled && {\n backgroundColor: themeColors.neutral.n150,\n boxShadow: 'none'\n })\n }\n\n const secondaryHoverStyles: CSSObject = {\n backgroundColor: themeColors.primary.primary,\n color: themeColors.static.white\n }\n const secondaryStyles: CSSObject = {\n backgroundColor: 'transparent',\n color: themeColors.text.default,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}`,\n\n '&:hover': secondaryHoverStyles,\n '&:active': secondaryHoverStyles,\n\n ...((_isHovered || _isPressed) && secondaryHoverStyles),\n ...(isDisabled && {\n backgroundColor: themeColors.neutral.n150,\n color: themeColors.static.white,\n boxShadow: 'none'\n })\n }\n\n const tertiaryHoverStyles: CSSObject = {\n backgroundColor: themeColors.background.white,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}, ${shadows.mid}`,\n color: themeColors.text.default\n }\n const tertiaryActiveStyles: CSSObject = {\n backgroundColor: themeColors.background.surface2,\n backdropFilter: 'none',\n color: themeColors.text.default,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}`\n }\n const tertiaryStyles: CSSObject = {\n backgroundColor:\n type === 'dark' ? 'rgba(50, 51, 77, 0.6)' : 'rgb(255, 255, 255, 0.85)',\n color: themeColors.text.default,\n backdropFilter: 'blur(6px)',\n boxShadow: `0 0 0 1px inset ${themeColors.border.default}, ${shadows.near}`,\n\n '&:hover': tertiaryHoverStyles,\n '&:active': tertiaryActiveStyles,\n\n ...(_isHovered && tertiaryHoverStyles),\n ...(_isPressed && tertiaryActiveStyles),\n ...(isDisabled && {\n opacity: 0.45\n })\n }\n\n const commonHoverStyles: CSSObject = {\n backgroundColor: themeColors.neutral.n25\n }\n\n const commonActiveStyles: CSSObject = {\n backgroundColor: themeColors.neutral.n100\n }\n\n const commonStyles: CSSObject = {\n backgroundColor: themeColors.special.white,\n color: themeColors.text.default,\n boxShadow: `0 0 0 1px inset ${themeColors.border.strong}`,\n\n '&:hover': commonHoverStyles,\n '&:active': commonActiveStyles,\n\n ...(_isHovered && commonHoverStyles),\n ...(_isPressed && commonActiveStyles),\n ...(isDisabled && {\n backgroundColor: themeColors.neutral.n150,\n boxShadow: 'none'\n })\n }\n\n const destructiveHoverStyles: CSSObject = {\n backgroundColor: themeColors.special.red,\n color: themeColors.static.white\n }\n const destructiveStyles: CSSObject = {\n backgroundColor: 'transparent',\n color: themeColors.special.red,\n boxShadow: `0 0 0 1px inset ${themeColors.special.red}`,\n\n '&:hover': destructiveHoverStyles,\n '&:active': destructiveHoverStyles,\n\n ...((_isHovered || _isPressed) && destructiveHoverStyles),\n ...(isDisabled && {\n opacity: 0.45\n })\n }\n\n const hoverStyles: CSSObject = {\n boxShadow: shadows.mid,\n '&::before': {\n backgroundColor: 'rgba(255, 255, 255, 0.2)'\n }\n }\n const activeStyles: CSSObject = {\n boxShadow: 'none',\n '&::before': {\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\n }\n }\n\n const buttonCss: CSSObject = {\n backgroundColor: themeColors.primary.primary,\n color: themeColors.static.white,\n boxSizing: 'border-box',\n border: 'none',\n borderRadius: cornerRadius.s,\n boxShadow: shadows.near,\n\n ...(size === 'small'\n ? smallStyles\n : size === 'large'\n ? largeStyles\n : defaultStyles),\n\n ...(variant === 'secondary'\n ? secondaryStyles\n : variant === 'tertiary'\n ? tertiaryStyles\n : variant === 'destructive'\n ? destructiveStyles\n : variant === 'common'\n ? commonStyles\n : primaryStyles),\n\n '::before': {\n zIndex: -1,\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0)'\n },\n\n ...(variant !== 'tertiary' &&\n variant !== 'common' && {\n ':hover': hoverStyles,\n ':active': activeStyles,\n ...(_isHovered && hoverStyles),\n ...(_isPressed && activeStyles)\n })\n }\n\n const iconCss =\n size === 'small'\n ? smallIconStyles\n : size === 'large'\n ? largeIconStyles\n : defaultIconStyles\n\n const style: CSSCustomProperties =\n variant === 'primary' && !isDisabled\n ? {\n backgroundColor:\n hexColor ||\n (color ? `var(${toCSSVariableName(color)})` : undefined)\n }\n : {}\n\n return (\n <BaseButton\n ref={ref}\n disabled={isDisabled}\n styles={{\n button: buttonCss,\n icon: iconCss\n }}\n style={style}\n {...baseProps}\n />\n )\n }\n)\n"],"names":["_jsx"],"mappings":";;;;;;;AAaA;;;;;AAKG;AACU,IAAA,MAAM,GAAG,UA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EAAE;AACN,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,IAAI,EAAE,OAAO;AACd,SAAA,EACD,KAAK,EAAE,KAAK,IACR,SAAS,CAAA,CACb,EACH;AACH,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
import type { SpecialColors } from "../../../foundations/color";
|
|
3
3
|
import { BaseButtonProps } from '../BaseButton/types';
|
|
4
4
|
export type HTMLButtonProps = ComponentPropsWithoutRef<'button'>;
|
|
5
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive';
|
|
5
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'common';
|
|
6
6
|
export type ButtonSize = 'small' | 'default' | 'large';
|
|
7
7
|
export type ButtonProps = {
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAyB;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;AAEhE,MAAM,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAyB;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;AAEhE,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,UAAU,GACV,aAAa,GACb,QAAQ,CAAA;AAEZ,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtD,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAA;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import type { IconComponent } from "../icon";
|
|
2
3
|
import { PaperProps } from "../layout/Paper";
|
|
3
4
|
type HintProps = {
|
|
4
5
|
icon: IconComponent;
|
|
6
|
+
actions?: ReactNode;
|
|
5
7
|
} & PaperProps;
|
|
6
8
|
export declare const Hint: (props: HintProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hint.d.ts","sourceRoot":"","sources":["../../../src/components/hint/Hint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAuB;
|
|
1
|
+
{"version":3,"file":"Hint.d.ts","sourceRoot":"","sources":["../../../src/components/hint/Hint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAuB;AAEpD,OAAO,EAAS,UAAU,EAAE,wBAA+B;AAG3D,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,GAAG,UAAU,CAAA;AAKd,eAAO,MAAM,IAAI,UAAW,SAAS,qDA2BpC,CAAA"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../_virtual/_tslib.js';
|
|
2
2
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import '../layout/Box/Box.js';
|
|
4
|
+
import '@emotion/react';
|
|
5
|
+
import { Flex } from '../layout/Flex/Flex.js';
|
|
3
6
|
import { Paper } from '../layout/Paper/Paper.js';
|
|
7
|
+
import '../layout/Popup/Popup.js';
|
|
4
8
|
import { Text } from '../text/Text/Text.js';
|
|
5
9
|
|
|
6
10
|
/*
|
|
7
11
|
* A way of informing the user of important details in line in a prominent way.
|
|
8
12
|
*/
|
|
9
13
|
var Hint = function (props) {
|
|
10
|
-
var Icon = props.icon, children = props.children, other = __rest(props, ["icon", "children"]);
|
|
11
|
-
return (jsxs(Paper, __assign({ role: 'alert',
|
|
14
|
+
var Icon = props.icon, children = props.children, actions = props.actions, other = __rest(props, ["icon", "children", "actions"]);
|
|
15
|
+
return (jsxs(Paper, __assign({ role: 'alert', backgroundColor: 'surface2', ph: 'l', pv: 'm', direction: 'column', gap: 'm', shadow: 'flat', border: 'strong' }, other, { children: [jsxs(Flex, __assign({ gap: 'l', alignItems: 'center' }, { children: [jsx(Icon, { size: 'l', color: 'default' }), jsx(Text, __assign({ variant: 'body', color: 'default' }, { children: children }))] })), actions ? (jsx(Flex, __assign({ pl: 'unit10', gap: 'l' }, { children: actions }))) : null] })));
|
|
12
16
|
};
|
|
13
17
|
|
|
14
18
|
export { Hint };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hint.js","sources":["../../../src/components/hint/Hint.tsx"],"sourcesContent":["import type { IconComponent } from 'components/icon'\nimport { Paper, PaperProps } from 'components/layout/Paper'\nimport { Text } from 'components/text'\n\ntype HintProps = {\n icon: IconComponent\n} & PaperProps\n\n/*\n * A way of informing the user of important details in line in a prominent way.\n */\nexport const Hint = (props: HintProps) => {\n const { icon: Icon, children, ...other } = props\n return (\n <Paper\n role='alert'\n
|
|
1
|
+
{"version":3,"file":"Hint.js","sources":["../../../src/components/hint/Hint.tsx"],"sourcesContent":["import { ReactNode } from 'react'\n\nimport type { IconComponent } from 'components/icon'\nimport { Flex } from 'components/layout'\nimport { Paper, PaperProps } from 'components/layout/Paper'\nimport { Text } from 'components/text'\n\ntype HintProps = {\n icon: IconComponent\n actions?: ReactNode\n} & PaperProps\n\n/*\n * A way of informing the user of important details in line in a prominent way.\n */\nexport const Hint = (props: HintProps) => {\n const { icon: Icon, children, actions, ...other } = props\n return (\n <Paper\n role='alert'\n backgroundColor='surface2'\n ph='l'\n pv='m'\n direction='column'\n gap='m'\n shadow='flat'\n border='strong'\n {...other}\n >\n <Flex gap='l' alignItems='center'>\n <Icon size='l' color='default' />\n <Text variant='body' color='default'>\n {children}\n </Text>\n </Flex>\n {actions ? (\n <Flex pl='unit10' gap='l'>\n {actions}\n </Flex>\n ) : null}\n </Paper>\n )\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;AAYA;;AAEG;AACI,IAAM,IAAI,GAAG,UAAC,KAAgB,EAAA;IAC3B,IAAM,IAAI,GAAkC,KAAK,CAAA,IAAvC,EAAE,QAAQ,GAAwB,KAAK,CAA7B,QAAA,EAAE,OAAO,GAAe,KAAK,QAApB,EAAK,KAAK,UAAK,KAAK,EAAnD,CAA2C,MAAA,EAAA,UAAA,EAAA,SAAA,CAAA,CAAF,CAAU;IACzD,QACEA,KAAC,KAAK,EAAA,QAAA,CAAA,EACJ,IAAI,EAAC,OAAO,EACZ,eAAe,EAAC,UAAU,EAC1B,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,GAAG,EACN,SAAS,EAAC,QAAQ,EAClB,GAAG,EAAC,GAAG,EACP,MAAM,EAAC,MAAM,EACb,MAAM,EAAC,QAAQ,EACX,EAAA,KAAK,eAETA,IAAC,CAAA,IAAI,aAAC,GAAG,EAAC,GAAG,EAAC,UAAU,EAAC,QAAQ,EAC/B,EAAA,EAAA,QAAA,EAAA,CAAAC,GAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,SAAS,EAAG,CAAA,EACjCA,GAAC,CAAA,IAAI,aAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,SAAS,EAAA,EAAA,EAAA,QAAA,EACjC,QAAQ,EAAA,CAAA,CACJ,CACF,EAAA,CAAA,CAAA,EACN,OAAO,IACNA,GAAA,CAAC,IAAI,EAAC,QAAA,CAAA,EAAA,EAAE,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,EAAA,EAAA,EAAA,QAAA,EACtB,OAAO,EAAA,CAAA,CACH,IACL,IAAI,CACF,EAAA,CAAA,CAAA,EACT;AACH;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, SVGProps } from 'react';
|
|
2
2
|
import type { IconColors } from '../foundations/color/semantic';
|
|
3
3
|
import type { ShadowOptions } from '../foundations/shadows';
|
|
4
|
-
import {
|
|
5
|
-
type IconSize = keyof typeof iconSizes;
|
|
4
|
+
import { IconSize } from '../foundations/spacing';
|
|
6
5
|
type SVGBaseProps = SVGProps<SVGSVGElement>;
|
|
7
6
|
export type IconProps = {
|
|
8
7
|
color?: IconColors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/components/icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/components/icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,KAAK,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;AAE3C,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB,CAAA;AAED,KAAK,YAAY,GAAG,YAAY,GAAG,SAAS,CAAA;AAE5C,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC,CAAA"}
|
|
@@ -11,6 +11,7 @@ import '../../button/FollowButton/FollowButton.js';
|
|
|
11
11
|
import '../../button/FilterButton/FilterButton.js';
|
|
12
12
|
import { IconButton } from '../../button/IconButton/IconButton.js';
|
|
13
13
|
import { TextInput } from '../TextInput/TextInput.js';
|
|
14
|
+
import '../TextInput/types.js';
|
|
14
15
|
|
|
15
16
|
var messages = {
|
|
16
17
|
hidePasswordInput: 'Hide password input',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sources":["../../../../src/components/input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { useToggle } from 'react-use'\n\nimport { IconButton } from 'components/button'\nimport { IconVisibilityHidden, IconVisibilityPublic } from 'icons'\n\nimport { TextInput } from '../TextInput'\n\nimport type { PasswordInputProps } from './types'\n\nconst messages = {\n hidePasswordInput: 'Hide password input',\n showPasswordInput: 'Show password input'\n}\n\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, ref) => {\n const { hideVisibilityToggle, ...restProps } = props\n const [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false)\n const VisibilityIcon = isPasswordVisible\n ? IconVisibilityPublic\n : IconVisibilityHidden\n\n return (\n <TextInput\n ref={ref}\n type={isPasswordVisible ? 'text' : 'password'}\n endAdornment={\n hideVisibilityToggle ? null : (\n <IconButton\n icon={VisibilityIcon}\n color='subdued'\n onClick={toggleIsPasswordVisible}\n aria-label={\n isPasswordVisible\n ? messages.hidePasswordInput\n : messages.showPasswordInput\n }\n ripple\n />\n )\n }\n {...restProps}\n />\n )\n }\n)\n"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sources":["../../../../src/components/input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { useToggle } from 'react-use'\n\nimport { IconButton } from 'components/button'\nimport { IconVisibilityHidden, IconVisibilityPublic } from 'icons'\n\nimport { TextInput } from '../TextInput'\n\nimport type { PasswordInputProps } from './types'\n\nconst messages = {\n hidePasswordInput: 'Hide password input',\n showPasswordInput: 'Show password input'\n}\n\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, ref) => {\n const { hideVisibilityToggle, ...restProps } = props\n const [isPasswordVisible, toggleIsPasswordVisible] = useToggle(false)\n const VisibilityIcon = isPasswordVisible\n ? IconVisibilityPublic\n : IconVisibilityHidden\n\n return (\n <TextInput\n ref={ref}\n type={isPasswordVisible ? 'text' : 'password'}\n endAdornment={\n hideVisibilityToggle ? null : (\n <IconButton\n icon={VisibilityIcon}\n color='subdued'\n onClick={toggleIsPasswordVisible}\n aria-label={\n isPasswordVisible\n ? messages.hidePasswordInput\n : messages.showPasswordInput\n }\n ripple\n />\n )\n }\n {...restProps}\n />\n )\n }\n)\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAM,QAAQ,GAAG;AACf,IAAA,iBAAiB,EAAE,qBAAqB;AACxC,IAAA,iBAAiB,EAAE,qBAAqB;CACzC,CAAA;IAEY,aAAa,GAAG,UAAU,CACrC,UAAC,KAAK,EAAE,GAAG,EAAA;IACD,IAAA,oBAAoB,GAAmB,KAAK,CAAxB,oBAAA,EAAK,SAAS,GAAA,MAAA,CAAK,KAAK,EAA9C,CAAsC,sBAAA,CAAA,CAAF,CAAU;IAC9C,IAAA,EAAA,GAA+C,SAAS,CAAC,KAAK,CAAC,EAA9D,iBAAiB,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,uBAAuB,GAAA,EAAA,CAAA,CAAA,CAAoB,CAAA;IACrE,IAAM,cAAc,GAAG,iBAAiB;AACtC,UAAE,oBAAoB;UACpB,oBAAoB,CAAA;IAExB,QACEA,IAAC,SAAS,EAAA,QAAA,CAAA,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,UAAU,EAC7C,YAAY,EACV,oBAAoB,GAAG,IAAI,IACzBA,GAAA,CAAC,UAAU,EACT,EAAA,IAAI,EAAE,cAAc,EACpB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,uBAAuB,EAAA,YAAA,EAE9B,iBAAiB;kBACb,QAAQ,CAAC,iBAAiB;AAC5B,kBAAE,QAAQ,CAAC,iBAAiB,EAEhC,MAAM,EACN,IAAA,EAAA,CAAA,CACH,EAEC,EAAA,SAAS,CACb,CAAA,EACH;AACH,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectablePill.d.ts","sourceRoot":"","sources":["../../../../src/components/input/SelectablePill/SelectablePill.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"SelectablePill.d.ts","sourceRoot":"","sources":["../../../../src/components/input/SelectablePill/SelectablePill.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AASlD,eAAO,MAAM,cAAc,UAAW,mBAAmB,qDAuIxD,CAAA"}
|
|
@@ -7,12 +7,15 @@ import { Text } from '../../text/Text/Text.js';
|
|
|
7
7
|
|
|
8
8
|
var RadioInput = function (props) {
|
|
9
9
|
var _a = useRadioGroup(props), name = _a.name, checked = _a.checked, onChange = _a.onChange;
|
|
10
|
-
|
|
11
|
-
return (jsx(HiddenInput, __assign({}, props, { name: name, checked: checked !== null && checked !== void 0 ? checked : isSelected, onChange: onChange })));
|
|
10
|
+
return (jsx(HiddenInput, __assign({}, props, { name: name, checked: checked, onChange: onChange })));
|
|
12
11
|
};
|
|
13
12
|
var SelectablePill = function (props) {
|
|
14
|
-
var
|
|
13
|
+
var _a;
|
|
14
|
+
var isSelectedProp = props.isSelected, _b = props.size, size = _b === void 0 ? 'small' : _b, _isHovered = props._isHovered, Icon = props.icon, className = props.className, other = __rest(props, ["isSelected", "size", "_isHovered", "icon", "className"]);
|
|
15
15
|
var disabled = other.disabled, type = other.type;
|
|
16
|
+
var isSelected = type === 'checkbox' || type === 'radio'
|
|
17
|
+
? (_a = other.checked) !== null && _a !== void 0 ? _a : isSelectedProp
|
|
18
|
+
: isSelectedProp;
|
|
16
19
|
var theme = useTheme();
|
|
17
20
|
var spacing = theme.spacing;
|
|
18
21
|
var hoverCss = __assign({ backgroundColor: theme.color.secondary.s200, color: theme.color.static.white, border: "1px solid ".concat(theme.color.secondary.secondary) }, (size === 'large' && {
|
|
@@ -51,11 +54,10 @@ var SelectablePill = function (props) {
|
|
|
51
54
|
var pillContent = (jsxs(Fragment, { children: [Icon ? jsx(Icon, { css: iconCss }) : null, 'label' in other ? (jsx(Text, __assign({ variant: size === 'oversized' ? 'heading' : 'body', tag: 'span', css: size === 'oversized' && { textTransform: 'uppercase' } }, { children: other.label }))) : null] }));
|
|
52
55
|
switch (type) {
|
|
53
56
|
case 'checkbox': {
|
|
54
|
-
|
|
55
|
-
return (jsxs("label", __assign({}, rootProps, { children: [pillContent, jsx(HiddenInput, __assign({}, rest, { checked: checked !== null && checked !== void 0 ? checked : isSelected }))] })));
|
|
57
|
+
return (jsxs("label", __assign({}, rootProps, { children: [pillContent, jsx(HiddenInput, __assign({}, other, { checked: isSelected }))] })));
|
|
56
58
|
}
|
|
57
59
|
case 'radio': {
|
|
58
|
-
return (jsxs("label", __assign({}, rootProps, { children: [pillContent, jsx(RadioInput, __assign({}, other, {
|
|
60
|
+
return (jsxs("label", __assign({}, rootProps, { children: [pillContent, jsx(RadioInput, __assign({}, other, { checked: isSelected }))] })));
|
|
59
61
|
}
|
|
60
62
|
case 'button':
|
|
61
63
|
case 'reset':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectablePill.js","sources":["../../../../src/components/input/SelectablePill/SelectablePill.tsx"],"sourcesContent":["import { ComponentProps } from 'react'\n\nimport { CSSObject, useTheme } from '@emotion/react'\n\nimport { HiddenInput } from 'components/common/HiddenInput'\nimport { useRadioGroup } from 'components/radio-group/useRadioGroup'\nimport { Text } from 'components/text'\n\nimport type { SelectablePillProps } from './types'\n\nconst RadioInput = (
|
|
1
|
+
{"version":3,"file":"SelectablePill.js","sources":["../../../../src/components/input/SelectablePill/SelectablePill.tsx"],"sourcesContent":["import { ComponentProps } from 'react'\n\nimport { CSSObject, useTheme } from '@emotion/react'\n\nimport { HiddenInput } from 'components/common/HiddenInput'\nimport { useRadioGroup } from 'components/radio-group/useRadioGroup'\nimport { Text } from 'components/text'\n\nimport type { SelectablePillProps } from './types'\n\nconst RadioInput = (props: ComponentProps<'input'>) => {\n const { name, checked, onChange } = useRadioGroup(props)\n return (\n <HiddenInput {...props} name={name} checked={checked} onChange={onChange} />\n )\n}\n\nexport const SelectablePill = (props: SelectablePillProps) => {\n const {\n isSelected: isSelectedProp,\n size = 'small',\n _isHovered,\n icon: Icon,\n className,\n ...other\n } = props\n\n const { disabled, type } = other\n const isSelected =\n type === 'checkbox' || type === 'radio'\n ? other.checked ?? isSelectedProp\n : isSelectedProp\n\n const theme = useTheme()\n const { spacing } = theme\n\n const hoverCss: CSSObject = {\n backgroundColor: theme.color.secondary.s200,\n color: theme.color.static.white,\n border: `1px solid ${theme.color.secondary.secondary}`,\n ...(size === 'large' && {\n backgroundColor: theme.color.secondary.s100,\n border: `1px solid ${theme.color.secondary.s200}`,\n boxShadow: 'none'\n })\n }\n\n const activeCss: CSSObject = {\n backgroundColor: theme.color.secondary.s400,\n color: theme.color.static.white,\n border: `1px solid ${theme.color.secondary.s400}`,\n\n ...(size === 'large' && {\n boxShadow: 'none'\n })\n }\n\n const rootCss: CSSObject = {\n display: 'inline-flex',\n position: 'relative',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing.xs,\n color: theme.color.text.default,\n backgroundColor: theme.color.background.white,\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'all 0.12s ease-out',\n textWrap: 'nowrap',\n border: `1px solid ${theme.color.border.strong}`,\n borderRadius: theme.cornerRadius['2xl'],\n ...(size === 'small' && {\n height: theme.spacing.xl,\n paddingInline: theme.spacing.m\n }),\n ...(size === 'large' && {\n height: theme.spacing['2xl'],\n paddingInline: theme.spacing.l,\n boxShadow: theme.shadows.near\n }),\n ...(size === 'oversized' && {\n height: spacing.unit12,\n padding: spacing.m,\n borderWidth: 2\n }),\n ...(disabled && { opacity: 0.45 }),\n ...(_isHovered && hoverCss),\n ...(isSelected && activeCss),\n ...((disabled || _isHovered) && {\n pointerEvents: 'none'\n }),\n ':hover': hoverCss,\n ':active': activeCss\n }\n\n const iconCss = {\n width: spacing.l,\n height: spacing.l,\n\n '& path': {\n fill: 'currentColor'\n }\n }\n\n const rootProps = {\n css: rootCss,\n className\n }\n\n const pillContent = (\n <>\n {Icon ? <Icon css={iconCss} /> : null}\n {'label' in other ? (\n <Text\n variant={size === 'oversized' ? 'heading' : 'body'}\n tag='span'\n css={size === 'oversized' && { textTransform: 'uppercase' }}\n >\n {other.label}\n </Text>\n ) : null}\n </>\n )\n\n switch (type) {\n case 'checkbox': {\n return (\n <label {...rootProps}>\n {pillContent}\n <HiddenInput {...other} checked={isSelected} />\n </label>\n )\n }\n case 'radio': {\n return (\n <label {...rootProps}>\n {pillContent}\n <RadioInput {...other} checked={isSelected} />\n </label>\n )\n }\n case 'button':\n case 'reset':\n case 'submit':\n default: {\n return (\n <button {...rootProps} {...other}>\n {pillContent}\n </button>\n )\n }\n }\n}\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;AAUA,IAAM,UAAU,GAAG,UAAC,KAA8B,EAAA;AAC1C,IAAA,IAAA,EAA8B,GAAA,aAAa,CAAC,KAAK,CAAC,EAAhD,IAAI,GAAA,EAAA,CAAA,IAAA,EAAE,OAAO,GAAA,EAAA,CAAA,OAAA,EAAE,QAAQ,cAAyB,CAAA;AACxD,IAAA,QACEA,GAAC,CAAA,WAAW,eAAK,KAAK,EAAA,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAA,CAAA,CAAI,EAC7E;AACH,CAAC,CAAA;AAEM,IAAM,cAAc,GAAG,UAAC,KAA0B,EAAA;;AAErD,IAAA,IAAY,cAAc,GAMxB,KAAK,CAAA,UANmB,EAC1B,EAKE,GAAA,KAAK,CALO,IAAA,EAAd,IAAI,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,OAAO,GAAA,EAAA,EACd,UAAU,GAIR,KAAK,CAJG,UAAA,EACJ,IAAI,GAGR,KAAK,CAHG,IAAA,EACV,SAAS,GAEP,KAAK,CAFE,SAAA,EACN,KAAK,GACN,MAAA,CAAA,KAAK,EAPH,CAAA,YAAA,EAAA,MAAA,EAAA,YAAA,EAAA,MAAA,EAAA,WAAA,CAOL,CADS,CACD;IAED,IAAA,QAAQ,GAAW,KAAK,CAAA,QAAhB,EAAE,IAAI,GAAK,KAAK,CAAA,IAAV,CAAU;IAChC,IAAM,UAAU,GACd,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,OAAO;AACrC,UAAE,CA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,OAAO,EAAE,UAAU,EAAI,CAAA,CAAA,CAAA,EAAA,CAAA,CACxC,EACT;AACF,SAAA;AACD,QAAA,KAAK,QAAQ,CAAC;AACd,QAAA,KAAK,OAAO,CAAC;AACb,QAAA,KAAK,QAAQ,CAAC;AACd,QAAA,SAAS;YACP,QACEA,2BAAY,SAAS,EAAM,KAAK,EAC7B,EAAA,QAAA,EAAA,WAAW,EACL,CAAA,CAAA,EACV;AACF,SAAA;AACF,KAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/TextInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/TextInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -50,7 +50,7 @@ export type TextInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'size' | 'r
|
|
|
50
50
|
*/
|
|
51
51
|
hideLabel?: boolean;
|
|
52
52
|
/**
|
|
53
|
-
* Label Text. Required
|
|
53
|
+
* Label Text. Required due to accessibility. If hideLabel is true, the label is set via aria-label
|
|
54
54
|
*/
|
|
55
55
|
label: string;
|
|
56
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/components/input/TextInput/types.ts"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react'\n\nimport type { IconComponent, IconProps } from '../../icon'\n\nexport enum TextInputSize {\n SMALL = 'small',\n DEFAULT = 'default'\n}\n\ntype InternalProps = {\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the incorrect error state for the storybook docs\n */\n _incorrectError?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the hover state for the storybook docs\n */\n _isHovered?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the focus state for the storybook docs\n */\n _isFocused?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Disabled pointer events for storybook docs\n */\n _disablePointerEvents?: boolean\n}\n\nexport type TextInputProps = Omit<\n ComponentPropsWithoutRef<'input'>,\n // Omitting required purely for storybook docs\n 'size' | 'required'\n> & {\n /**\n * Input sizes. NOTE: small inputs will not show the label\n * @default default\n */\n size?: TextInputSize\n /**\n * Toggles warning state (turns border warning color). NOTE: this is not used any where at the moment\n */\n warning?: boolean\n /**\n * Toggles error state\n */\n error?: boolean\n /**\n * Hides the label. If the label is hidden the placeholder will show by default instead.\n * @default false\n */\n hideLabel?: boolean\n /**\n * Label Text. Required
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/components/input/TextInput/types.ts"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react'\n\nimport type { IconComponent, IconProps } from '../../icon'\n\nexport enum TextInputSize {\n SMALL = 'small',\n DEFAULT = 'default'\n}\n\ntype InternalProps = {\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the incorrect error state for the storybook docs\n */\n _incorrectError?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the hover state for the storybook docs\n */\n _isHovered?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Toggles the focus state for the storybook docs\n */\n _isFocused?: boolean\n /**\n * @ignore\n * This prop is for internal use only.\n * Disabled pointer events for storybook docs\n */\n _disablePointerEvents?: boolean\n}\n\nexport type TextInputProps = Omit<\n ComponentPropsWithoutRef<'input'>,\n // Omitting required purely for storybook docs\n 'size' | 'required'\n> & {\n /**\n * Input sizes. NOTE: small inputs will not show the label\n * @default default\n */\n size?: TextInputSize\n /**\n * Toggles warning state (turns border warning color). NOTE: this is not used any where at the moment\n */\n warning?: boolean\n /**\n * Toggles error state\n */\n error?: boolean\n /**\n * Hides the label. If the label is hidden the placeholder will show by default instead.\n * @default false\n */\n hideLabel?: boolean\n /**\n * Label Text. Required due to accessibility. If hideLabel is true, the label is set via aria-label\n */\n label: string\n /**\n * ClassName on the div wrapping the whole input container (doesn't include assistive text)\n */\n inputRootClassName?: string\n /**\n * Helper text (or JSX) that shows up below the input\n */\n helperText?: string | ReactNode\n /**\n * Floating text on the lefthand side of the input.\n */\n startAdornmentText?: string\n /**\n * Floating text on the righthand side of the input\n */\n endAdornmentText?: string\n /**\n * Floating icon on the lefthand side of the input. Note: will float to the left of the label & content\n */\n startIcon?: IconComponent\n /**\n * Floating icon on the righthand side of the input\n */\n endIcon?: IconComponent\n /**\n * Override props to supply the start or end Icon\n */\n IconProps?: Partial<IconProps>\n /**\n * @hidden\n * Floating component on the righthand side of the input. Meant for internal use only.\n */\n endAdornment?: ReactNode\n /**\n * Required or not. Will add an * to the label if required\n */\n required?: boolean\n /**\n * 0-1 number representating a percentage threshold to show the max character text. Default is 0.7 (70%)\n * @default 0.7\n */\n showMaxLengthThreshold?: number\n /**\n * 0-1 number representating a percentage threshold to turn the character limit text orange. Default is 0.9 (90%)\n * @default 0.9\n */\n maxLengthWarningThreshold?: number\n} & InternalProps\n"],"names":[],"mappings":"IAIY,cAGX;AAHD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,GAGxB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -4,6 +4,7 @@ import { forwardRef, useCallback } from 'react';
|
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
import { useControlled } from '../../../hooks/useControlled.js';
|
|
6
6
|
import { TextInput } from '../TextInput/TextInput.js';
|
|
7
|
+
import '../TextInput/types.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Format a number to have commas
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenAmountInput.js","sources":["../../../../src/components/input/TokenAmountInput/TokenAmountInput.tsx"],"sourcesContent":["import { ChangeEventHandler, Ref, forwardRef, useCallback } from 'react'\n\nimport BN from 'bn.js'\n\nimport { useControlled } from 'hooks/useControlled'\n\nimport { TextInput } from '../TextInput'\n\nimport { TokenAmountInputProps } from './types'\n\n/**\n * Format a number to have commas\n */\nconst formatNumberCommas = (num: number | string) => {\n const parts = num.toString().split('.')\n return (\n parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',') +\n (parts[1] !== undefined ? '.' + parts[1] : '')\n )\n}\n\nexport const TokenAmountInput = forwardRef(\n (props: TokenAmountInputProps, ref: Ref<HTMLInputElement>) => {\n const {\n tokenLabel,\n decimals = 0,\n isWhole = false,\n value: valueProp,\n onChange,\n ...other\n } = props\n\n const [value, setValueState] = useControlled({\n controlledProp: valueProp ? formatNumberCommas(valueProp) : valueProp,\n defaultValue: '',\n componentName: 'TokenAmountInput'\n })\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = useCallback(\n (e) => {\n const input = e.target.value.replace(/[^0-9.]+/g, '')\n // Regex to grab the whole and decimal parts of the number, stripping duplicate '.' characters\n const match = input.match(/^(?<whole>\\d*)(?<dot>.)?(?<decimal>\\d*)/)\n const { whole, decimal, dot } = match?.groups || {}\n\n // Conditionally render the decimal part, and only for the number of decimals specified\n const stringAmount =\n dot && decimals && !isWhole\n ? `${whole}.${decimal.substring(0, decimals)}`\n : whole\n\n // Also add the BN to the onChange event for convenience\n let amount = new BN(whole)\n amount = amount.mul(new BN(10 ** decimals))\n amount = amount.add(new BN(decimal.padEnd(decimals, '0')))\n setValueState(formatNumberCommas(stringAmount))\n if (onChange) {\n onChange(stringAmount, amount)\n }\n },\n [decimals, isWhole, setValueState, onChange]\n )\n return (\n <TextInput\n ref={ref}\n {...other}\n value={value}\n onChange={handleChange}\n endAdornmentText={tokenLabel}\n />\n )\n }\n)\n"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TokenAmountInput.js","sources":["../../../../src/components/input/TokenAmountInput/TokenAmountInput.tsx"],"sourcesContent":["import { ChangeEventHandler, Ref, forwardRef, useCallback } from 'react'\n\nimport BN from 'bn.js'\n\nimport { useControlled } from 'hooks/useControlled'\n\nimport { TextInput } from '../TextInput'\n\nimport { TokenAmountInputProps } from './types'\n\n/**\n * Format a number to have commas\n */\nconst formatNumberCommas = (num: number | string) => {\n const parts = num.toString().split('.')\n return (\n parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',') +\n (parts[1] !== undefined ? '.' + parts[1] : '')\n )\n}\n\nexport const TokenAmountInput = forwardRef(\n (props: TokenAmountInputProps, ref: Ref<HTMLInputElement>) => {\n const {\n tokenLabel,\n decimals = 0,\n isWhole = false,\n value: valueProp,\n onChange,\n ...other\n } = props\n\n const [value, setValueState] = useControlled({\n controlledProp: valueProp ? formatNumberCommas(valueProp) : valueProp,\n defaultValue: '',\n componentName: 'TokenAmountInput'\n })\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = useCallback(\n (e) => {\n const input = e.target.value.replace(/[^0-9.]+/g, '')\n // Regex to grab the whole and decimal parts of the number, stripping duplicate '.' characters\n const match = input.match(/^(?<whole>\\d*)(?<dot>.)?(?<decimal>\\d*)/)\n const { whole, decimal, dot } = match?.groups || {}\n\n // Conditionally render the decimal part, and only for the number of decimals specified\n const stringAmount =\n dot && decimals && !isWhole\n ? `${whole}.${decimal.substring(0, decimals)}`\n : whole\n\n // Also add the BN to the onChange event for convenience\n let amount = new BN(whole)\n amount = amount.mul(new BN(10 ** decimals))\n amount = amount.add(new BN(decimal.padEnd(decimals, '0')))\n setValueState(formatNumberCommas(stringAmount))\n if (onChange) {\n onChange(stringAmount, amount)\n }\n },\n [decimals, isWhole, setValueState, onChange]\n )\n return (\n <TextInput\n ref={ref}\n {...other}\n value={value}\n onChange={handleChange}\n endAdornmentText={tokenLabel}\n />\n )\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,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,UAAU,EAC5B,CAAA,CAAA,EACH;AACH,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/components/text/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4B,MAAM,OAAO,CAAA;AAU7D,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/components/text/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4B,MAAM,OAAO,CAAA;AAU7D,eAAO,MAAM,IAAI,4WAoEhB,CAAA"}
|
|
@@ -8,10 +8,10 @@ import { variantTagMap, variantStylesMap } from './constants.js';
|
|
|
8
8
|
|
|
9
9
|
var Text = forwardRef(function (props, ref) {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
var children = props.children, variant = props.variant, _c = props.strength, strength = _c === void 0 ? 'default' : _c, _d = props.size, size = _d === void 0 ? 'm' : _d, color = props.color, shadow = props.shadow, tag = props.tag, asChild = props.asChild, textAlign = props.textAlign, other = __rest(props, ["children", "variant", "strength", "size", "color", "shadow", "tag", "asChild", "textAlign"]);
|
|
11
|
+
var children = props.children, variant = props.variant, _c = props.strength, strength = _c === void 0 ? 'default' : _c, _d = props.size, size = _d === void 0 ? 'm' : _d, color = props.color, shadow = props.shadow, tag = props.tag, asChild = props.asChild, textAlign = props.textAlign, ellipses = props.ellipses, other = __rest(props, ["children", "variant", "strength", "size", "color", "shadow", "tag", "asChild", "textAlign", "ellipses"]);
|
|
12
12
|
var theme = useTheme();
|
|
13
13
|
var variantConfig = variant && variantStylesMap[variant];
|
|
14
|
-
var
|
|
14
|
+
var css = __assign(__assign(__assign(__assign(__assign(__assign({ fontFamily: "'Avenir Next LT Pro', 'Helvetica Neue', Helvetica,\n Arial, sans-serif", position: 'relative', boxSizing: 'border-box' }, (color &&
|
|
15
15
|
color === 'heading' && {
|
|
16
16
|
// inline is necessary to prevent text clipping
|
|
17
17
|
display: 'inline',
|
|
@@ -19,19 +19,23 @@ var Text = forwardRef(function (props, ref) {
|
|
|
19
19
|
WebkitTextFillColor: 'transparent',
|
|
20
20
|
backgroundClip: 'text',
|
|
21
21
|
backgroundImage: theme.color.text.heading
|
|
22
|
-
})), (color && color !== 'heading' && { color: theme.color.text[color] })), (variantConfig && __assign(
|
|
22
|
+
})), (color && color !== 'heading' && { color: theme.color.text[color] })), (variantConfig && __assign({
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
fontSize: typography.size[variantConfig.fontSize[size]],
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
lineHeight: typography.lineHeight[variantConfig.lineHeight[size]],
|
|
27
27
|
// @ts-ignore
|
|
28
|
-
fontWeight: typography.weight[variantConfig.fontWeight[strength]] }, ('css' in variantConfig && variantConfig.css)), (shadow && {
|
|
28
|
+
fontWeight: typography.weight[variantConfig.fontWeight[strength]] }, ('css' in variantConfig && variantConfig.css)))), (shadow && {
|
|
29
29
|
textShadow: typography.shadow[shadow]
|
|
30
|
-
})), { textAlign: textAlign })
|
|
30
|
+
})), { textAlign: textAlign }), (ellipses && {
|
|
31
|
+
overflow: 'hidden',
|
|
32
|
+
textOverflow: 'ellipsis',
|
|
33
|
+
whiteSpace: 'nowrap'
|
|
34
|
+
}));
|
|
31
35
|
// @ts-ignore
|
|
32
36
|
var variantTag = variant && ((_a = variantTagMap[variant]) === null || _a === void 0 ? void 0 : _a[size]);
|
|
33
|
-
var Tag = asChild ? Slot : (_b = tag !== null && tag !== void 0 ? tag : variantTag) !== null && _b !== void 0 ? _b : '
|
|
34
|
-
return (jsx(Tag, __assign({ ref: ref, css:
|
|
37
|
+
var Tag = asChild ? Slot : (_b = tag !== null && tag !== void 0 ? tag : variantTag) !== null && _b !== void 0 ? _b : 'span';
|
|
38
|
+
return (jsx(Tag, __assign({ ref: ref, css: css }, other, { children: children })));
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
export { Text };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../../src/components/text/Text/Text.tsx"],"sourcesContent":["import { ElementType, ForwardedRef, forwardRef } from 'react'\n\nimport { useTheme } from '@emotion/react'\nimport { Slot } from '@radix-ui/react-slot'\n\nimport { typography } from '../../../foundations/typography'\n\nimport { variantStylesMap, variantTagMap } from './constants'\nimport type { TextProps } from './types'\n\nexport const Text = forwardRef(\n <TextComponentType extends ElementType = 'p'>(\n props: TextProps<TextComponentType>,\n ref: ForwardedRef<TextComponentType>\n ) => {\n const {\n children,\n variant,\n strength = 'default',\n size = 'm',\n color,\n shadow,\n tag,\n asChild,\n textAlign,\n ...other\n } = props\n\n const theme = useTheme()\n\n const variantConfig = variant && variantStylesMap[variant]\n const
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../../src/components/text/Text/Text.tsx"],"sourcesContent":["import { ElementType, ForwardedRef, forwardRef } from 'react'\n\nimport { useTheme } from '@emotion/react'\nimport { Slot } from '@radix-ui/react-slot'\n\nimport { typography } from '../../../foundations/typography'\n\nimport { variantStylesMap, variantTagMap } from './constants'\nimport type { TextProps } from './types'\n\nexport const Text = forwardRef(\n <TextComponentType extends ElementType = 'p'>(\n props: TextProps<TextComponentType>,\n ref: ForwardedRef<TextComponentType>\n ) => {\n const {\n children,\n variant,\n strength = 'default',\n size = 'm',\n color,\n shadow,\n tag,\n asChild,\n textAlign,\n ellipses,\n ...other\n } = props\n\n const theme = useTheme()\n\n const variantConfig = variant && variantStylesMap[variant]\n const css = {\n fontFamily: `'Avenir Next LT Pro', 'Helvetica Neue', Helvetica,\n Arial, sans-serif`,\n position: 'relative',\n boxSizing: 'border-box',\n ...(color &&\n color === 'heading' && {\n // inline is necessary to prevent text clipping\n display: 'inline',\n color: theme.color.secondary.secondary,\n WebkitTextFillColor: 'transparent',\n backgroundClip: 'text',\n backgroundImage: theme.color.text.heading\n }),\n ...(color && color !== 'heading' && { color: theme.color.text[color] }),\n ...(variantConfig && {\n // @ts-ignore\n fontSize: typography.size[variantConfig.fontSize[size]],\n // @ts-ignore\n lineHeight: typography.lineHeight[variantConfig.lineHeight[size]],\n // @ts-ignore\n fontWeight: typography.weight[variantConfig.fontWeight[strength]],\n ...('css' in variantConfig && variantConfig.css)\n }),\n ...(shadow && {\n textShadow: typography.shadow[shadow]\n }),\n textAlign,\n ...(ellipses && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n })\n }\n\n // @ts-ignore\n const variantTag = variant && variantTagMap[variant]?.[size]\n\n const Tag: ElementType = asChild ? Slot : tag ?? variantTag ?? 'span'\n\n return (\n <Tag ref={ref} css={css} {...other}>\n {children}\n </Tag>\n )\n }\n)\n"],"names":["_jsx"],"mappings":";;;;;;;;IAUa,IAAI,GAAG,UAAU,CAC5B,UACE,KAAmC,EACnC,GAAoC,EAAA;;AAGlC,IAAA,IAAA,QAAQ,GAWN,KAAK,CAAA,QAXC,EACR,OAAO,GAUL,KAAK,CAVA,OAAA,EACP,EASE,GAAA,KAAK,SATa,EAApB,QAAQ,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,SAAS,GAAA,EAAA,EACpB,EAQE,GAAA,KAAK,CARG,IAAA,EAAV,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,GAAG,GAAA,EAAA,EACV,KAAK,GAOH,KAAK,CAAA,KAPF,EACL,MAAM,GAMJ,KAAK,CAND,MAAA,EACN,GAAG,GAKD,KAAK,CAAA,GALJ,EACH,OAAO,GAIL,KAAK,QAJA,EACP,SAAS,GAGP,KAAK,CAHE,SAAA,EACT,QAAQ,GAEN,KAAK,CAAA,QAFC,EACL,KAAK,GACN,MAAA,CAAA,KAAK,EAZH,CAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,SAAA,EAAA,WAAA,EAAA,UAAA,C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