@audius/harmony 0.0.34 → 0.1.0
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/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 +1 -1
- package/dist/components/button/FilterButton/FilterButton.d.ts.map +1 -1
- package/dist/components/button/FilterButton/FilterButton.js +62 -68
- package/dist/components/button/FilterButton/FilterButton.js.map +1 -1
- package/dist/components/button/FilterButton/types.d.ts +38 -23
- package/dist/components/button/FilterButton/types.d.ts.map +1 -1
- package/dist/components/button/IconButton/IconButton.d.ts +2 -2
- package/dist/components/button/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/button/IconButton/IconButton.js +4 -3
- package/dist/components/button/IconButton/IconButton.js.map +1 -1
- package/dist/components/button/OptionsFilterButton/OptionsFilterButton.d.ts +18 -0
- package/dist/components/button/OptionsFilterButton/OptionsFilterButton.d.ts.map +1 -0
- package/dist/components/button/OptionsFilterButton/OptionsFilterButton.js +123 -0
- package/dist/components/button/OptionsFilterButton/OptionsFilterButton.js.map +1 -0
- package/dist/components/button/{FilterButton/FilterButton.stories.d.ts → OptionsFilterButton/OptionsFilterButton.stories.d.ts} +4 -4
- package/dist/components/button/OptionsFilterButton/OptionsFilterButton.stories.d.ts.map +1 -0
- package/dist/components/button/OptionsFilterButton/SelectPopupKeyHandler.d.ts +18 -0
- package/dist/components/button/OptionsFilterButton/SelectPopupKeyHandler.d.ts.map +1 -0
- package/dist/components/button/OptionsFilterButton/SelectPopupKeyHandler.js +82 -0
- package/dist/components/button/OptionsFilterButton/SelectPopupKeyHandler.js.map +1 -0
- package/dist/components/button/OptionsFilterButton/types.d.ts +62 -0
- package/dist/components/button/OptionsFilterButton/types.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.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.js +1 -1
- package/dist/components/input/SelectablePill/SelectablePill.js.map +1 -1
- package/dist/components/modal/Modal.js +1 -1
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalHeader.js +1 -0
- package/dist/components/modal/ModalHeader.js.map +1 -1
- package/dist/components/music-badge/MusicBadge.d.ts +25 -0
- package/dist/components/music-badge/MusicBadge.d.ts.map +1 -0
- package/dist/components/music-badge/MusicBadge.js +40 -0
- package/dist/components/music-badge/MusicBadge.js.map +1 -0
- package/dist/components/music-badge/MusicBadge.stories.d.ts +7 -0
- package/dist/components/music-badge/MusicBadge.stories.d.ts.map +1 -0
- package/dist/components/music-badge/index.d.ts +3 -0
- package/dist/components/music-badge/index.d.ts.map +1 -0
- package/dist/components/pill/Pill.d.ts +2 -2
- package/dist/components/popup/Popup.d.ts.map +1 -1
- package/dist/components/popup/Popup.js +3 -0
- package/dist/components/popup/Popup.js.map +1 -1
- package/dist/components/text/Text.d.ts.map +1 -1
- package/dist/components/text/Text.js +6 -5
- package/dist/components/text/Text.js.map +1 -1
- package/dist/foundations/color/color.d.ts +9 -0
- package/dist/foundations/color/color.d.ts.map +1 -1
- package/dist/foundations/color/primitive.d.ts +6 -0
- package/dist/foundations/color/primitive.d.ts.map +1 -1
- package/dist/foundations/color/primitive.js +6 -0
- package/dist/foundations/color/primitive.js.map +1 -1
- package/dist/foundations/color/semantic.d.ts +3 -0
- package/dist/foundations/color/semantic.d.ts.map +1 -1
- package/dist/foundations/color/semantic.js +2 -1
- package/dist/foundations/color/semantic.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/dist/components/button/FilterButton/FilterButton.stories.d.ts.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __assign } from '../../_virtual/_tslib.js';
|
|
2
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useTheme } from '@emotion/react';
|
|
4
|
+
import Color from 'color';
|
|
5
|
+
import { Flex } from '../layout/Flex/Flex.js';
|
|
6
|
+
import { Text } from '../text/Text.js';
|
|
7
|
+
|
|
8
|
+
var MusicBadge = function (props) {
|
|
9
|
+
var _a = props.variant, variant = _a === void 0 ? 'default' : _a, _b = props.size, size = _b === void 0 ? 'm' : _b, Icon = props.icon, colorProp = props.color, children = props.children;
|
|
10
|
+
var color = useTheme().color;
|
|
11
|
+
var gap = size === 'm' ? 's' : 'xs';
|
|
12
|
+
var height = size === 'm' ? '2xl' : 'xl';
|
|
13
|
+
var backgroundColor = colorProp
|
|
14
|
+
? color.special[colorProp]
|
|
15
|
+
: variant === 'default'
|
|
16
|
+
? color.background.default
|
|
17
|
+
: color.background.accent;
|
|
18
|
+
var textColor = colorProp
|
|
19
|
+
? color.special[colorProp]
|
|
20
|
+
: variant === 'default'
|
|
21
|
+
? color.text.default
|
|
22
|
+
: color.text.accent;
|
|
23
|
+
var iconColor = colorProp
|
|
24
|
+
? color.special[colorProp]
|
|
25
|
+
: variant === 'default'
|
|
26
|
+
? color.icon.default
|
|
27
|
+
: color.icon.accent;
|
|
28
|
+
var borderColor = colorProp
|
|
29
|
+
? Color(color.special[colorProp]).fade(0.5).toString()
|
|
30
|
+
: variant === 'default'
|
|
31
|
+
? color.border.strong
|
|
32
|
+
: color.border.accent;
|
|
33
|
+
return (jsxs(Flex, __assign({ alignItems: 'center', justifyContent: 'center', borderRadius: 's', border: 'strong', gap: gap, h: height, ph: size, css: {
|
|
34
|
+
backgroundColor: Color(backgroundColor).fade(0.92).toString(),
|
|
35
|
+
borderColor: borderColor
|
|
36
|
+
} }, { children: [Icon ? jsx(Icon, { size: size, fill: iconColor }) : null, jsx(Text, __assign({ variant: 'label', size: size, css: { color: textColor } }, { children: children }))] })));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { MusicBadge };
|
|
40
|
+
//# sourceMappingURL=MusicBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MusicBadge.js","sources":["../../../src/components/music-badge/MusicBadge.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef } from 'react'\n\nimport { useTheme } from '@emotion/react'\nimport Color from 'color'\n\nimport type { IconComponent } from 'components/icon'\nimport { SpecialColors } from 'foundations'\n\nimport { Flex } from '../layout/Flex'\nimport { Text } from '../text/Text'\n\nexport type MusicBadgeVariant = 'default' | 'accent'\nexport type MusicBadgeSize = 's' | 'm'\n\nexport type MusicBadgeProps = {\n /**\n * The type of the MusicBadge\n */\n variant?: MusicBadgeVariant\n /**\n * The size of the MusicBadge\n */\n size?: 's' | 'm'\n /**\n * The icon to display in the left of the MusicBadge\n */\n icon?: IconComponent\n /**\n * Override the colors of the MusicBadge\n */\n color?: SpecialColors\n} & ComponentPropsWithoutRef<'div'>\n\nexport const MusicBadge = (props: MusicBadgeProps) => {\n const {\n variant = 'default',\n size = 'm',\n icon: Icon,\n color: colorProp,\n children\n } = props\n const { color } = useTheme()\n\n const gap = size === 'm' ? 's' : 'xs'\n const height = size === 'm' ? '2xl' : 'xl'\n\n const backgroundColor = colorProp\n ? color.special[colorProp]\n : variant === 'default'\n ? color.background.default\n : color.background.accent\n const textColor = colorProp\n ? color.special[colorProp]\n : variant === 'default'\n ? color.text.default\n : color.text.accent\n const iconColor = colorProp\n ? color.special[colorProp]\n : variant === 'default'\n ? color.icon.default\n : color.icon.accent\n const borderColor = colorProp\n ? Color(color.special[colorProp]).fade(0.5).toString()\n : variant === 'default'\n ? color.border.strong\n : color.border.accent\n\n return (\n <Flex\n alignItems='center'\n justifyContent='center'\n borderRadius='s'\n border='strong'\n gap={gap}\n h={height}\n ph={size}\n css={{\n backgroundColor: Color(backgroundColor).fade(0.92).toString(),\n borderColor\n }}\n >\n {Icon ? <Icon size={size} fill={iconColor} /> : null}\n <Text variant='label' size={size} css={{ color: textColor }}>\n {children}\n </Text>\n </Flex>\n )\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAiCO,IAAM,UAAU,GAAG,UAAC,KAAsB,EAAA;AAE7C,IAAA,IAAA,EAKE,GAAA,KAAK,CALY,OAAA,EAAnB,OAAO,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,SAAS,GAAA,EAAA,EACnB,EAIE,GAAA,KAAK,CAJG,IAAA,EAAV,IAAI,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,GAAG,GAAA,EAAA,EACJ,IAAI,GAGR,KAAK,CAAA,IAHG,EACH,SAAS,GAEd,KAAK,CAAA,KAFS,EAChB,QAAQ,GACN,KAAK,SADC,CACD;AACD,IAAA,IAAA,KAAK,GAAK,QAAQ,EAAE,MAAf,CAAe;AAE5B,IAAA,IAAM,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;AACrC,IAAA,IAAM,MAAM,GAAG,IAAI,KAAK,GAAG,GAAG,KAAK,GAAG,IAAI,CAAA;IAE1C,IAAM,eAAe,GAAG,SAAS;AAC/B,UAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;UACxB,OAAO,KAAK,SAAS;AACvB,cAAE,KAAK,CAAC,UAAU,CAAC,OAAO;AAC1B,cAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAA;IAC3B,IAAM,SAAS,GAAG,SAAS;AACzB,UAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;UACxB,OAAO,KAAK,SAAS;AACvB,cAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACpB,cAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IACrB,IAAM,SAAS,GAAG,SAAS;AACzB,UAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;UACxB,OAAO,KAAK,SAAS;AACvB,cAAE,KAAK,CAAC,IAAI,CAAC,OAAO;AACpB,cAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IACrB,IAAM,WAAW,GAAG,SAAS;AAC3B,UAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;UACpD,OAAO,KAAK,SAAS;AACvB,cAAE,KAAK,CAAC,MAAM,CAAC,MAAM;AACrB,cAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAA;AAEvB,IAAA,QACEA,IAAA,CAAC,IAAI,EAAA,QAAA,CAAA,EACH,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,EACvB,YAAY,EAAC,GAAG,EAChB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAE,GAAG,EACR,CAAC,EAAE,MAAM,EACT,EAAE,EAAE,IAAI,EACR,GAAG,EAAE;AACH,YAAA,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;AAC7D,YAAA,WAAW,EAAA,WAAA;AACZ,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAEA,IAAI,GAAGC,GAAC,CAAA,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAA,CAAI,GAAG,IAAI,EACpDA,GAAA,CAAC,IAAI,EAAC,QAAA,CAAA,EAAA,OAAO,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAA,EAAA,EAAA,QAAA,EACxD,QAAQ,EACJ,CAAA,CAAA,CAAA,EAAA,CAAA,CACF,EACR;AACH;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MusicBadge } from './MusicBadge';
|
|
3
|
+
declare const meta: Meta<typeof MusicBadge>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MusicBadge>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=MusicBadge.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MusicBadge.stories.d.ts","sourceRoot":"","sources":["../../../src/components/music-badge/MusicBadge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAItD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAGjC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/music-badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -18,8 +18,8 @@ export declare const Pill: (props: {
|
|
|
18
18
|
minWidth?: number | undefined;
|
|
19
19
|
fullWidth?: boolean | undefined;
|
|
20
20
|
styles?: {
|
|
21
|
-
button
|
|
22
|
-
icon
|
|
21
|
+
button?: CSSObject | undefined;
|
|
22
|
+
icon?: CSSObject | undefined;
|
|
23
23
|
} | undefined;
|
|
24
24
|
asChild?: boolean | undefined;
|
|
25
25
|
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":";AAuBA,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,SAAS,CAAA;AA+JjD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":";AAuBA,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,SAAS,CAAA;AA+JjD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,sKAyPhB,CAAA"}
|
|
@@ -11,6 +11,7 @@ import { IconClose } from '../../icons/utilityIcons.js';
|
|
|
11
11
|
import '@emotion/css';
|
|
12
12
|
import '../button/FollowButton/FollowButton.js';
|
|
13
13
|
import '../button/FilterButton/FilterButton.js';
|
|
14
|
+
import '../button/OptionsFilterButton/OptionsFilterButton.js';
|
|
14
15
|
import '../button/IconButton/IconButton.js';
|
|
15
16
|
import '../button/UnstyledButton.js';
|
|
16
17
|
import { useClickOutside } from '../../hooks/useClickOutside.js';
|
|
@@ -242,11 +243,13 @@ var Popup = forwardRef(function Popup(props, ref) {
|
|
|
242
243
|
return function () { };
|
|
243
244
|
}, [isVisible, handleClose]);
|
|
244
245
|
useEffect(function () {
|
|
246
|
+
var _a;
|
|
245
247
|
if (popupState === 'closed' && isVisibleProp) {
|
|
246
248
|
setPopupState('opening');
|
|
247
249
|
}
|
|
248
250
|
else if (popupState === 'open' && !isVisibleProp) {
|
|
249
251
|
setPopupState('closing');
|
|
252
|
+
(_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
250
253
|
}
|
|
251
254
|
}, [isVisibleProp, popupState]);
|
|
252
255
|
var transitions = useTransition(isVisibleProp, null, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.js","sources":["../../../src/components/popup/Popup.tsx"],"sourcesContent":["import {\n forwardRef,\n MutableRefObject,\n Ref,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react'\n\nimport { useTheme } from '@emotion/react'\nimport cn from 'classnames'\nimport ReactDOM from 'react-dom'\nimport { useTransition, animated } from 'react-spring'\n\nimport { PlainButton } from 'components/button'\nimport { IconClose } from 'icons'\nimport { ModalState } from 'utils/modalState'\n\nimport { useClickOutside } from '../../hooks/useClickOutside'\nimport { getScrollParent } from '../../utils/getScrollParent'\n\nimport styles from './Popup.module.css'\nimport type { PopupProps, Origin } from './types'\n\nconst messages = {\n close: 'close popup'\n}\n\n/**\n * Number of pixels between the edge of the container and the popup\n * before the popup needs to reposition itself to be in view.\n */\nconst CONTAINER_INSET_PADDING = 16\n\n/**\n * Figures out whether the specified position would overflow the window\n * and picks a better position accordingly\n * @param {Origin} anchorOrigin where the origin is on the trigger\n * @param {Origin} transformOrigin where the origin is on the popup\n * @param {DOMRect} anchorRect the position and size of the trigger\n * @param {DOMRect} wrapperRect the position and size of the popup\n * @return {{ anchorOrigin: Origin, transformOrigin: Origin }} the new origin after accounting for overflow\n */\nconst getComputedOrigins = (\n anchorOrigin: Origin,\n transformOrigin: Origin,\n anchorRect: DOMRect,\n wrapperRect: DOMRect,\n portal: HTMLElement,\n containerRef?: MutableRefObject<HTMLDivElement | undefined>\n) => {\n if (!anchorRect || !wrapperRect) return { anchorOrigin, transformOrigin }\n\n let containerWidth, containerHeight\n if (containerRef && containerRef.current) {\n containerWidth =\n containerRef.current.getBoundingClientRect().width -\n CONTAINER_INSET_PADDING\n containerHeight =\n containerRef.current.getBoundingClientRect().height -\n CONTAINER_INSET_PADDING\n } else {\n containerWidth =\n portal.getBoundingClientRect().width - CONTAINER_INSET_PADDING\n containerHeight =\n portal.getBoundingClientRect().height - CONTAINER_INSET_PADDING\n }\n\n // Get new wrapper position\n const anchorTranslation = getOriginTranslation(anchorOrigin, anchorRect)\n const wrapperTranslation = getOriginTranslation(transformOrigin, wrapperRect)\n const wrapperX = anchorRect.x + anchorTranslation.x - wrapperTranslation.x\n const wrapperY = anchorRect.y + anchorTranslation.y - wrapperTranslation.y\n\n // Check bounds of the wrapper in new position are inside container\n const overflowRight = wrapperX + wrapperRect.width > containerWidth\n const overflowLeft = wrapperX < 0\n const overflowBottom = wrapperY + wrapperRect.height > containerHeight\n const overflowTop = wrapperY < 0\n\n // For all overflows, flip the position\n if (overflowRight) {\n anchorOrigin.horizontal = 'left'\n transformOrigin.horizontal = 'right'\n }\n if (overflowLeft) {\n anchorOrigin.horizontal = 'right'\n transformOrigin.horizontal = 'left'\n }\n if (overflowTop) {\n anchorOrigin.vertical = 'bottom'\n transformOrigin.vertical = 'top'\n }\n if (overflowBottom) {\n anchorOrigin.vertical = 'top'\n transformOrigin.vertical = 'bottom'\n }\n return { anchorOrigin, transformOrigin }\n}\n\n/**\n * Figures out whether the specified position would still overflow the window\n * after being computed and adds extra offsets\n */\nconst getAdjustedPosition = (\n top: number,\n left: number,\n wrapperRect: DOMRect,\n portal: HTMLElement\n): { adjustedTop: number; adjustedLeft: number } => {\n if (!wrapperRect) return { adjustedTop: 0, adjustedLeft: 0 }\n\n const containerWidth =\n portal.getBoundingClientRect().width - CONTAINER_INSET_PADDING\n const containerHeight =\n portal.getBoundingClientRect().height - CONTAINER_INSET_PADDING\n // Account for the portal being a scrollable container.\n // This will happen if the document body itself is what scrolls.\n const containerTop = -1 * portal.getBoundingClientRect().top\n\n const overflowRight = left + wrapperRect.width > containerWidth\n const overflowLeft = left < 0\n const overflowBottom = top + wrapperRect.height > containerHeight\n const overflowTop = top < 0\n\n const adjusted = { adjustedTop: containerTop, adjustedLeft: 0 }\n if (overflowRight) {\n adjusted.adjustedLeft =\n adjusted.adjustedLeft - (left + wrapperRect.width - containerWidth)\n }\n if (overflowLeft) {\n adjusted.adjustedLeft = adjusted.adjustedLeft + wrapperRect.width\n }\n if (overflowTop) {\n adjusted.adjustedTop =\n adjusted.adjustedTop - (top + wrapperRect.height - containerHeight)\n }\n if (overflowBottom) {\n adjusted.adjustedTop = adjusted.adjustedTop + wrapperRect.height\n }\n return adjusted\n}\n\n/**\n * Gets the x, y offsets for the given origin using the dimensions\n * @param origin the relative origin\n * @param dimensions the dimensions to use with the relative origin\n * @returns the x and y coordinates of the new origin relative to the old one\n */\nconst getOriginTranslation = (\n origin: Origin,\n dimensions: { width: number; height: number }\n) => {\n let x = 0\n let y = 0\n const { width, height } = dimensions\n if (origin.horizontal === 'center') {\n x += width / 2\n } else if (origin.horizontal === 'right') {\n x += width\n }\n if (origin.vertical === 'center') {\n y += height / 2\n } else if (origin.vertical === 'bottom') {\n y += height\n }\n return { x, y }\n}\n\nconst defaultAnchorOrigin: Origin = {\n horizontal: 'center',\n vertical: 'bottom'\n}\n\nconst defaultTransformOrigin: Origin = {\n horizontal: 'center',\n vertical: 'top'\n}\n\nconst closingAnimationDuration = 90\n\n/**\n * A popup is an in-place container that shows on top of the UI. A popup does\n * not impact the rest of the UI (e.g. dimming background or shifting elements).\n * It differs from modals, which do take over the whole UI and are usually\n * center-screened.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function Popup(\n props: PopupProps,\n ref: Ref<HTMLDivElement>\n) {\n const {\n anchorRef,\n checkIfClickInside,\n children,\n className,\n isVisible: isVisibleProp,\n onAfterClose,\n onClose,\n anchorOrigin: anchorOriginProp = defaultAnchorOrigin,\n transformOrigin: transformOriginProp = defaultTransformOrigin,\n dismissOnMouseLeave,\n hideCloseButton = false,\n showHeader,\n title,\n zIndex,\n containerRef,\n portalLocation = document.body,\n shadow = 'mid',\n fixed\n } = props\n const { spring, shadows } = useTheme()\n const [popupState, setPopupState] = useState<ModalState>('closed')\n\n const isVisible = popupState !== 'closed'\n\n const handleClose = useCallback(() => {\n onClose?.()\n setTimeout(() => {\n if (onAfterClose) {\n onAfterClose()\n }\n }, closingAnimationDuration)\n }, [onClose, onAfterClose])\n\n const [anchorOrigin, transformOrigin] = [\n anchorOriginProp,\n transformOriginProp\n ]\n\n const popupRef: React.MutableRefObject<HTMLDivElement> = useClickOutside(\n handleClose,\n checkIfClickInside,\n isVisible,\n typeof ref === 'function' ? undefined : ref\n )\n\n const wrapperRef = useRef<HTMLDivElement>(null)\n const originalTopPosition = useRef<number>(0)\n const [computedTransformOrigin, setComputedTransformOrigin] =\n useState(anchorOrigin)\n\n // On visible, set the position\n useEffect(() => {\n if (isVisible) {\n const [anchorRect, wrapperRect] = [anchorRef, wrapperRef].map((r) =>\n r?.current?.getBoundingClientRect()\n )\n if (!anchorRect || !wrapperRect) return\n\n const {\n anchorOrigin: anchorOriginComputed,\n transformOrigin: transformOriginComputed\n } = getComputedOrigins(\n anchorOrigin,\n transformOrigin,\n anchorRect,\n wrapperRect,\n portalLocation,\n containerRef\n )\n setComputedTransformOrigin(transformOriginComputed)\n\n const anchorTranslation = getOriginTranslation(\n anchorOriginComputed,\n anchorRect\n )\n const wrapperTranslation = getOriginTranslation(\n transformOriginComputed,\n wrapperRect\n )\n\n const top = anchorRect.y + anchorTranslation.y - wrapperTranslation.y\n const left = anchorRect.x + anchorTranslation.x - wrapperTranslation.x\n\n const { adjustedTop, adjustedLeft } = getAdjustedPosition(\n top,\n left,\n wrapperRect,\n portalLocation\n )\n\n if (wrapperRef.current) {\n wrapperRef.current.style.top = `${top + adjustedTop}px`\n wrapperRef.current.style.left = `${left + adjustedLeft}px`\n }\n\n originalTopPosition.current = top\n }\n }, [\n isVisible,\n wrapperRef,\n anchorRef,\n anchorOrigin,\n transformOrigin,\n setComputedTransformOrigin,\n originalTopPosition,\n portalLocation,\n containerRef\n ])\n\n // Callback invoked on each scroll. Uses original top position to scroll with content.\n // Takes scrollParent to get the current scroll position as well as the intitial scroll position\n // when the popup became visible.\n const watchScroll = useCallback(\n (scrollParent: Element, initialScrollPosition: number) => {\n const scrollTop = scrollParent.scrollTop\n if (wrapperRef.current) {\n wrapperRef.current.style.top = `${\n originalTopPosition.current - scrollTop + initialScrollPosition\n }px`\n }\n },\n [wrapperRef, originalTopPosition]\n )\n\n // Set up scroll listeners\n useEffect(() => {\n if (isVisible && anchorRef.current) {\n const scrollParent = getScrollParent(anchorRef.current)\n if (!scrollParent) return\n\n const initialScrollPosition = scrollParent.scrollTop\n const listener = () => watchScroll(scrollParent, initialScrollPosition)\n scrollParent.addEventListener('scroll', listener)\n return () => {\n scrollParent.removeEventListener('scroll', listener)\n }\n }\n\n return () => {}\n }, [isVisible, watchScroll, anchorRef])\n\n // Set up key listeners\n useEffect(() => {\n if (isVisible) {\n const escapeListener = (e: KeyboardEvent) => {\n if (e.code === 'Escape') {\n handleClose()\n }\n }\n\n window.addEventListener('keydown', escapeListener)\n\n return () => window.removeEventListener('keydown', escapeListener)\n }\n return () => {}\n }, [isVisible, handleClose])\n\n useEffect(() => {\n if (popupState === 'closed' && isVisibleProp) {\n setPopupState('opening')\n } else if (popupState === 'open' && !isVisibleProp) {\n setPopupState('closing')\n }\n }, [isVisibleProp, popupState])\n\n const transitions = useTransition(isVisibleProp, null, {\n from: {\n transform: `scale(0)`,\n opacity: 0\n },\n enter: {\n transform: `scale(1)`,\n opacity: 1\n },\n leave: {\n transform: `scale(0)`,\n opacity: 0\n },\n config: spring.standard,\n unique: true,\n onDestroyed: (isDestroyed) => {\n setPopupState(isDestroyed ? 'closed' : 'open')\n }\n })\n\n const rootStyle = { zIndex, position: fixed ? ('fixed' as const) : undefined }\n\n const handleMouseLeave = useCallback(() => {\n if (dismissOnMouseLeave) {\n onClose?.()\n }\n }, [dismissOnMouseLeave, onClose])\n\n return (\n <>\n {/* Portal the popup out of the dom structure so that it has a separate stacking context */}\n {popupState !== 'closed'\n ? ReactDOM.createPortal(\n <div\n ref={wrapperRef}\n className={styles.root}\n style={rootStyle}\n onMouseLeave={handleMouseLeave}\n >\n {transitions.map(({ item, key, props }) =>\n item ? (\n <animated.div\n className={cn(styles.popup, className)}\n css={{ boxShadow: shadows[shadow] }}\n ref={popupRef}\n key={key}\n style={{\n ...props,\n transformOrigin: `${computedTransformOrigin.horizontal} ${computedTransformOrigin.vertical}`\n }}\n >\n {showHeader && (\n <div\n className={cn(styles.header, {\n [styles.noAfter]: hideCloseButton\n })}\n >\n {hideCloseButton ? null : (\n <PlainButton\n variant='subdued'\n aria-label={messages.close}\n onClick={handleClose}\n iconLeft={IconClose}\n />\n )}\n <div className={styles.title}>{title}</div>\n </div>\n )}\n {children}\n </animated.div>\n ) : null\n )}\n </div>,\n portalLocation\n )\n : null}\n </>\n )\n})\n"],"names":["_jsx","_Fragment","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAM,QAAQ,GAAG;AACf,IAAA,KAAK,EAAE,aAAa;CACrB,CAAA;AAED;;;AAGG;AACH,IAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC;;;;;;;;AAQG;AACH,IAAM,kBAAkB,GAAG,UACzB,YAAoB,EACpB,eAAuB,EACvB,UAAmB,EACnB,WAAoB,EACpB,MAAmB,EACnB,YAA2D,EAAA;AAE3D,IAAA,IAAI,CAAC,UAAU,IAAI,CAAC,WAAW;AAAE,QAAA,OAAO,EAAE,YAAY,EAAA,YAAA,EAAE,eAAe,EAAA,eAAA,EAAE,CAAA;IAEzE,IAAI,cAAc,EAAE,eAAe,CAAA;AACnC,IAAA,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,EAAE;QACxC,cAAc;AACZ,YAAA,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK;AAClD,gBAAA,uBAAuB,CAAA;QACzB,eAAe;AACb,YAAA,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM;AACnD,gBAAA,uBAAuB,CAAA;AAC1B,KAAA;AAAM,SAAA;QACL,cAAc;AACZ,YAAA,MAAM,CAAC,qBAAqB,EAAE,CAAC,KAAK,GAAG,uBAAuB,CAAA;QAChE,eAAe;AACb,YAAA,MAAM,CAAC,qBAAqB,EAAE,CAAC,MAAM,GAAG,uBAAuB,CAAA;AAClE,KAAA;;IAGD,IAAM,iBAAiB,GAAG,oBAAoB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;IACxE,IAAM,kBAAkB,GAAG,oBAAoB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAA;AAC7E,IAAA,IAAM,QA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CAAA,MAAA,CAAG,uBAAuB,CAAC,UAAU,EAAA,GAAA,CAAA,CAAA,MAAA,CAAI,uBAAuB,CAAC,QAAQ,CAAE,EAG7F,CAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAU,KACTA,IACE,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAA,EAAA,GAAA,EAAA;AACzB,oCAAA,EAAA,CAAC,MAAM,CAAC,OAAO,CAAA,GAAG,eAAe;wCACjC,EAED,EAAA,EAAA,QAAA,EAAA,CAAA,eAAe,GAAG,IAAI,IACrBF,GAAC,CAAA,WAAW,IACV,OAAO,EAAC,SAAS,EAAA,YAAA,EACL,QAAQ,CAAC,KAAK,EAC1B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,SAAS,EAAA,CACnB,CACH,EACDA,GAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAG,EAAA,EAAA,QAAA,EAAA,KAAK,IAAO,CACvC,EAAA,CAAA,CAAA,CACP,EACA,QAAQ,CAvBJ,EAAA,CAAA,EAAA,GAAG,CAwBK,IACb,IAAI,CAAA;AA9BR,iBA8BQ,CACT,EAAA,CAAA,CACG,EACN,cAAc,CACf;AACH,cAAE,IAAI,EACP,CAAA,EACJ;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Popup.js","sources":["../../../src/components/popup/Popup.tsx"],"sourcesContent":["import {\n forwardRef,\n MutableRefObject,\n Ref,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react'\n\nimport { useTheme } from '@emotion/react'\nimport cn from 'classnames'\nimport ReactDOM from 'react-dom'\nimport { useTransition, animated } from 'react-spring'\n\nimport { PlainButton } from 'components/button'\nimport { IconClose } from 'icons'\nimport { ModalState } from 'utils/modalState'\n\nimport { useClickOutside } from '../../hooks/useClickOutside'\nimport { getScrollParent } from '../../utils/getScrollParent'\n\nimport styles from './Popup.module.css'\nimport type { PopupProps, Origin } from './types'\n\nconst messages = {\n close: 'close popup'\n}\n\n/**\n * Number of pixels between the edge of the container and the popup\n * before the popup needs to reposition itself to be in view.\n */\nconst CONTAINER_INSET_PADDING = 16\n\n/**\n * Figures out whether the specified position would overflow the window\n * and picks a better position accordingly\n * @param {Origin} anchorOrigin where the origin is on the trigger\n * @param {Origin} transformOrigin where the origin is on the popup\n * @param {DOMRect} anchorRect the position and size of the trigger\n * @param {DOMRect} wrapperRect the position and size of the popup\n * @return {{ anchorOrigin: Origin, transformOrigin: Origin }} the new origin after accounting for overflow\n */\nconst getComputedOrigins = (\n anchorOrigin: Origin,\n transformOrigin: Origin,\n anchorRect: DOMRect,\n wrapperRect: DOMRect,\n portal: HTMLElement,\n containerRef?: MutableRefObject<HTMLDivElement | undefined>\n) => {\n if (!anchorRect || !wrapperRect) return { anchorOrigin, transformOrigin }\n\n let containerWidth, containerHeight\n if (containerRef && containerRef.current) {\n containerWidth =\n containerRef.current.getBoundingClientRect().width -\n CONTAINER_INSET_PADDING\n containerHeight =\n containerRef.current.getBoundingClientRect().height -\n CONTAINER_INSET_PADDING\n } else {\n containerWidth =\n portal.getBoundingClientRect().width - CONTAINER_INSET_PADDING\n containerHeight =\n portal.getBoundingClientRect().height - CONTAINER_INSET_PADDING\n }\n\n // Get new wrapper position\n const anchorTranslation = getOriginTranslation(anchorOrigin, anchorRect)\n const wrapperTranslation = getOriginTranslation(transformOrigin, wrapperRect)\n const wrapperX = anchorRect.x + anchorTranslation.x - wrapperTranslation.x\n const wrapperY = anchorRect.y + anchorTranslation.y - wrapperTranslation.y\n\n // Check bounds of the wrapper in new position are inside container\n const overflowRight = wrapperX + wrapperRect.width > containerWidth\n const overflowLeft = wrapperX < 0\n const overflowBottom = wrapperY + wrapperRect.height > containerHeight\n const overflowTop = wrapperY < 0\n\n // For all overflows, flip the position\n if (overflowRight) {\n anchorOrigin.horizontal = 'left'\n transformOrigin.horizontal = 'right'\n }\n if (overflowLeft) {\n anchorOrigin.horizontal = 'right'\n transformOrigin.horizontal = 'left'\n }\n if (overflowTop) {\n anchorOrigin.vertical = 'bottom'\n transformOrigin.vertical = 'top'\n }\n if (overflowBottom) {\n anchorOrigin.vertical = 'top'\n transformOrigin.vertical = 'bottom'\n }\n return { anchorOrigin, transformOrigin }\n}\n\n/**\n * Figures out whether the specified position would still overflow the window\n * after being computed and adds extra offsets\n */\nconst getAdjustedPosition = (\n top: number,\n left: number,\n wrapperRect: DOMRect,\n portal: HTMLElement\n): { adjustedTop: number; adjustedLeft: number } => {\n if (!wrapperRect) return { adjustedTop: 0, adjustedLeft: 0 }\n\n const containerWidth =\n portal.getBoundingClientRect().width - CONTAINER_INSET_PADDING\n const containerHeight =\n portal.getBoundingClientRect().height - CONTAINER_INSET_PADDING\n // Account for the portal being a scrollable container.\n // This will happen if the document body itself is what scrolls.\n const containerTop = -1 * portal.getBoundingClientRect().top\n\n const overflowRight = left + wrapperRect.width > containerWidth\n const overflowLeft = left < 0\n const overflowBottom = top + wrapperRect.height > containerHeight\n const overflowTop = top < 0\n\n const adjusted = { adjustedTop: containerTop, adjustedLeft: 0 }\n if (overflowRight) {\n adjusted.adjustedLeft =\n adjusted.adjustedLeft - (left + wrapperRect.width - containerWidth)\n }\n if (overflowLeft) {\n adjusted.adjustedLeft = adjusted.adjustedLeft + wrapperRect.width\n }\n if (overflowTop) {\n adjusted.adjustedTop =\n adjusted.adjustedTop - (top + wrapperRect.height - containerHeight)\n }\n if (overflowBottom) {\n adjusted.adjustedTop = adjusted.adjustedTop + wrapperRect.height\n }\n return adjusted\n}\n\n/**\n * Gets the x, y offsets for the given origin using the dimensions\n * @param origin the relative origin\n * @param dimensions the dimensions to use with the relative origin\n * @returns the x and y coordinates of the new origin relative to the old one\n */\nconst getOriginTranslation = (\n origin: Origin,\n dimensions: { width: number; height: number }\n) => {\n let x = 0\n let y = 0\n const { width, height } = dimensions\n if (origin.horizontal === 'center') {\n x += width / 2\n } else if (origin.horizontal === 'right') {\n x += width\n }\n if (origin.vertical === 'center') {\n y += height / 2\n } else if (origin.vertical === 'bottom') {\n y += height\n }\n return { x, y }\n}\n\nconst defaultAnchorOrigin: Origin = {\n horizontal: 'center',\n vertical: 'bottom'\n}\n\nconst defaultTransformOrigin: Origin = {\n horizontal: 'center',\n vertical: 'top'\n}\n\nconst closingAnimationDuration = 90\n\n/**\n * A popup is an in-place container that shows on top of the UI. A popup does\n * not impact the rest of the UI (e.g. dimming background or shifting elements).\n * It differs from modals, which do take over the whole UI and are usually\n * center-screened.\n */\nexport const Popup = forwardRef<HTMLDivElement, PopupProps>(function Popup(\n props: PopupProps,\n ref: Ref<HTMLDivElement>\n) {\n const {\n anchorRef,\n checkIfClickInside,\n children,\n className,\n isVisible: isVisibleProp,\n onAfterClose,\n onClose,\n anchorOrigin: anchorOriginProp = defaultAnchorOrigin,\n transformOrigin: transformOriginProp = defaultTransformOrigin,\n dismissOnMouseLeave,\n hideCloseButton = false,\n showHeader,\n title,\n zIndex,\n containerRef,\n portalLocation = document.body,\n shadow = 'mid',\n fixed\n } = props\n const { spring, shadows } = useTheme()\n const [popupState, setPopupState] = useState<ModalState>('closed')\n\n const isVisible = popupState !== 'closed'\n\n const handleClose = useCallback(() => {\n onClose?.()\n setTimeout(() => {\n if (onAfterClose) {\n onAfterClose()\n }\n }, closingAnimationDuration)\n }, [onClose, onAfterClose])\n\n const [anchorOrigin, transformOrigin] = [\n anchorOriginProp,\n transformOriginProp\n ]\n\n const popupRef: React.MutableRefObject<HTMLDivElement> = useClickOutside(\n handleClose,\n checkIfClickInside,\n isVisible,\n typeof ref === 'function' ? undefined : ref\n )\n\n const wrapperRef = useRef<HTMLDivElement>(null)\n const originalTopPosition = useRef<number>(0)\n const [computedTransformOrigin, setComputedTransformOrigin] =\n useState(anchorOrigin)\n\n // On visible, set the position\n useEffect(() => {\n if (isVisible) {\n const [anchorRect, wrapperRect] = [anchorRef, wrapperRef].map((r) =>\n r?.current?.getBoundingClientRect()\n )\n if (!anchorRect || !wrapperRect) return\n\n const {\n anchorOrigin: anchorOriginComputed,\n transformOrigin: transformOriginComputed\n } = getComputedOrigins(\n anchorOrigin,\n transformOrigin,\n anchorRect,\n wrapperRect,\n portalLocation,\n containerRef\n )\n setComputedTransformOrigin(transformOriginComputed)\n\n const anchorTranslation = getOriginTranslation(\n anchorOriginComputed,\n anchorRect\n )\n const wrapperTranslation = getOriginTranslation(\n transformOriginComputed,\n wrapperRect\n )\n\n const top = anchorRect.y + anchorTranslation.y - wrapperTranslation.y\n const left = anchorRect.x + anchorTranslation.x - wrapperTranslation.x\n\n const { adjustedTop, adjustedLeft } = getAdjustedPosition(\n top,\n left,\n wrapperRect,\n portalLocation\n )\n\n if (wrapperRef.current) {\n wrapperRef.current.style.top = `${top + adjustedTop}px`\n wrapperRef.current.style.left = `${left + adjustedLeft}px`\n }\n\n originalTopPosition.current = top\n }\n }, [\n isVisible,\n wrapperRef,\n anchorRef,\n anchorOrigin,\n transformOrigin,\n setComputedTransformOrigin,\n originalTopPosition,\n portalLocation,\n containerRef\n ])\n\n // Callback invoked on each scroll. Uses original top position to scroll with content.\n // Takes scrollParent to get the current scroll position as well as the intitial scroll position\n // when the popup became visible.\n const watchScroll = useCallback(\n (scrollParent: Element, initialScrollPosition: number) => {\n const scrollTop = scrollParent.scrollTop\n if (wrapperRef.current) {\n wrapperRef.current.style.top = `${\n originalTopPosition.current - scrollTop + initialScrollPosition\n }px`\n }\n },\n [wrapperRef, originalTopPosition]\n )\n\n // Set up scroll listeners\n useEffect(() => {\n if (isVisible && anchorRef.current) {\n const scrollParent = getScrollParent(anchorRef.current)\n if (!scrollParent) return\n\n const initialScrollPosition = scrollParent.scrollTop\n const listener = () => watchScroll(scrollParent, initialScrollPosition)\n scrollParent.addEventListener('scroll', listener)\n return () => {\n scrollParent.removeEventListener('scroll', listener)\n }\n }\n\n return () => {}\n }, [isVisible, watchScroll, anchorRef])\n\n // Set up key listeners\n useEffect(() => {\n if (isVisible) {\n const escapeListener = (e: KeyboardEvent) => {\n if (e.code === 'Escape') {\n handleClose()\n }\n }\n\n window.addEventListener('keydown', escapeListener)\n\n return () => window.removeEventListener('keydown', escapeListener)\n }\n return () => {}\n }, [isVisible, handleClose])\n\n useEffect(() => {\n if (popupState === 'closed' && isVisibleProp) {\n setPopupState('opening')\n } else if (popupState === 'open' && !isVisibleProp) {\n setPopupState('closing')\n anchorRef.current?.focus()\n }\n }, [isVisibleProp, popupState])\n\n const transitions = useTransition(isVisibleProp, null, {\n from: {\n transform: `scale(0)`,\n opacity: 0\n },\n enter: {\n transform: `scale(1)`,\n opacity: 1\n },\n leave: {\n transform: `scale(0)`,\n opacity: 0\n },\n config: spring.standard,\n unique: true,\n onDestroyed: (isDestroyed) => {\n setPopupState(isDestroyed ? 'closed' : 'open')\n }\n })\n\n const rootStyle = { zIndex, position: fixed ? ('fixed' as const) : undefined }\n\n const handleMouseLeave = useCallback(() => {\n if (dismissOnMouseLeave) {\n onClose?.()\n }\n }, [dismissOnMouseLeave, onClose])\n\n return (\n <>\n {/* Portal the popup out of the dom structure so that it has a separate stacking context */}\n {popupState !== 'closed'\n ? ReactDOM.createPortal(\n <div\n ref={wrapperRef}\n className={styles.root}\n style={rootStyle}\n onMouseLeave={handleMouseLeave}\n >\n {transitions.map(({ item, key, props }) =>\n item ? (\n <animated.div\n className={cn(styles.popup, className)}\n css={{ boxShadow: shadows[shadow] }}\n ref={popupRef}\n key={key}\n style={{\n ...props,\n transformOrigin: `${computedTransformOrigin.horizontal} ${computedTransformOrigin.vertical}`\n }}\n >\n {showHeader && (\n <div\n className={cn(styles.header, {\n [styles.noAfter]: hideCloseButton\n })}\n >\n {hideCloseButton ? null : (\n <PlainButton\n variant='subdued'\n aria-label={messages.close}\n onClick={handleClose}\n iconLeft={IconClose}\n />\n )}\n <div className={styles.title}>{title}</div>\n </div>\n )}\n {children}\n </animated.div>\n ) : null\n )}\n </div>,\n portalLocation\n )\n : null}\n </>\n )\n})\n"],"names":["_jsx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AAA,MAAA,CAAG,uBAAuB,CAAC,UAAU,EAAA,GAAA,CAAA,CAAA,MAAA,CAAI,uBAAuB,CAAC,QAAQ,CAAE,EAG7F,CAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAU,KACTA,IACE,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAA,EAAA,GAAA,EAAA;AACzB,oCAAA,EAAA,CAAC,MAAM,CAAC,OAAO,CAAA,GAAG,eAAe;wCACjC,EAED,EAAA,EAAA,QAAA,EAAA,CAAA,eAAe,GAAG,IAAI,IACrBF,GAAC,CAAA,WAAW,IACV,OAAO,EAAC,SAAS,EAAA,YAAA,EACL,QAAQ,CAAC,KAAK,EAC1B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,SAAS,EAAA,CACnB,CACH,EACDA,GAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAG,EAAA,EAAA,QAAA,EAAA,KAAK,IAAO,CACvC,EAAA,CAAA,CAAA,CACP,EACA,QAAQ,CAvBJ,EAAA,CAAA,EAAA,GAAG,CAwBK,IACb,IAAI,CAAA;AA9BR,iBA8BQ,CACT,EAAA,CAAA,CACG,EACN,cAAc,CACf;AACH,cAAE,IAAI,EACP,CAAA,EACJ;AACH,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwC,MAAM,OAAO,CAAA;AAWzE,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwC,MAAM,OAAO,CAAA;AAWzE,eAAO,MAAM,IAAI,4WAqFhB,CAAA"}
|
|
@@ -9,12 +9,13 @@ import { TextContext } from './textContext.js';
|
|
|
9
9
|
|
|
10
10
|
var Text = forwardRef(function (props, ref) {
|
|
11
11
|
var _a, _b, _c;
|
|
12
|
-
var children = props.children,
|
|
12
|
+
var children = props.children, variantProp = props.variant, strengthProp = props.strength, sizeProp = props.size, color = props.color, shadow = props.shadow, tag = props.tag, asChild = props.asChild, textAlign = props.textAlign, textTransform = props.textTransform, ellipses = props.ellipses, other = __rest(props, ["children", "variant", "strength", "size", "color", "shadow", "tag", "asChild", "textAlign", "textTransform", "ellipses"]);
|
|
13
13
|
var theme = useTheme();
|
|
14
14
|
var contextVariant = useContext(TextContext).variant;
|
|
15
|
-
var variant = (_a =
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var variant = (_a = variantProp !== null && variantProp !== void 0 ? variantProp : contextVariant) !== null && _a !== void 0 ? _a : 'body';
|
|
16
|
+
var parentVariant = contextVariant && !variantProp;
|
|
17
|
+
var strength = strengthProp !== null && strengthProp !== void 0 ? strengthProp : (parentVariant ? undefined : 'default');
|
|
18
|
+
var size = sizeProp !== null && sizeProp !== void 0 ? sizeProp : (parentVariant ? undefined : 'm');
|
|
18
19
|
var variantConfig = variant && variantStylesMap[variant];
|
|
19
20
|
var css = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ fontFamily: "'Avenir Next LT Pro', 'Helvetica Neue', Helvetica,\n Arial, sans-serif", position: 'relative', boxSizing: 'border-box' }, (color &&
|
|
20
21
|
color === 'heading' && {
|
|
@@ -41,7 +42,7 @@ var Text = forwardRef(function (props, ref) {
|
|
|
41
42
|
var variantTag = variant && ((_b = variantTagMap[variant]) === null || _b === void 0 ? void 0 : _b[size]);
|
|
42
43
|
var Tag = asChild ? Slot : (_c = tag !== null && tag !== void 0 ? tag : variantTag) !== null && _c !== void 0 ? _c : 'span';
|
|
43
44
|
var textElement = (jsx(Tag, __assign({ ref: ref, css: css }, other, { children: children })));
|
|
44
|
-
if (
|
|
45
|
+
if (parentVariant) {
|
|
45
46
|
return textElement;
|
|
46
47
|
}
|
|
47
48
|
return (jsx(TextContext.Provider, __assign({ value: { variant: variant } }, { children: textElement })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../src/components/text/Text.tsx"],"sourcesContent":["import { ElementType, ForwardedRef, forwardRef, useContext } 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 { TextContext } from './textContext'\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:
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../src/components/text/Text.tsx"],"sourcesContent":["import { ElementType, ForwardedRef, forwardRef, useContext } 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 { TextContext } from './textContext'\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: variantProp,\n strength: strengthProp,\n size: sizeProp,\n color,\n shadow,\n tag,\n asChild,\n textAlign,\n textTransform,\n ellipses,\n ...other\n } = props\n\n const theme = useTheme()\n const { variant: contextVariant } = useContext(TextContext)\n const variant = variantProp ?? contextVariant ?? 'body'\n const parentVariant = contextVariant && !variantProp\n const strength = strengthProp ?? (parentVariant ? undefined : 'default')\n const size = sizeProp ?? (parentVariant ? undefined : 'm')\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 ...(textTransform && { textTransform }),\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 const textElement = (\n <Tag ref={ref} css={css} {...other}>\n {children}\n </Tag>\n )\n\n if (parentVariant) {\n return textElement\n }\n\n return (\n <TextContext.Provider value={{ variant }}>\n {textElement}\n </TextContext.Provider>\n )\n }\n)\n"],"names":["_jsx"],"mappings":";;;;;;;;;IAWa,IAAI,GAAG,UAAU,CAC5B,UACE,KAAmC,EACnC,GAAoC,EAAA;;AAGlC,IAAA,IAAA,QAAQ,GAYN,KAAK,CAAA,QAZC,EACC,WAAW,GAWlB,KAAK,CAXa,OAAA,EACV,YAAY,GAUpB,KAAK,CAAA,QAVe,EAChB,QAAQ,GASZ,KAAK,CATO,IAAA,EACd,KAAK,GAQH,KAAK,CAAA,KARF,EACL,MAAM,GAOJ,KAAK,CAPD,MAAA,EACN,GAAG,GAMD,KAAK,CAAA,GANJ,EACH,OAAO,GAKL,KAAK,CALA,OAAA,EACP,SAAS,GAIP,KAAK,CAAA,SAJE,EACT,aAAa,GAGX,KAAK,CAHM,aAAA,EACb,QAAQ,GAEN,KAAK,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GAAA,GAAG,GAAI,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,MAAM,CAAA;AAErE,IAAA,IAAM,WAAW,IACfA,IAAC,GAAG,EAAA,QAAA,CAAA,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAM,EAAA,KAAK,cAC/B,QAAQ,EAAA,CAAA,CACL,CACP,CAAA;AAED,IAAA,IAAI,aAAa,EAAE;AACjB,QAAA,OAAO,WAAW,CAAA;AACnB,KAAA;AAED,IAAA,QACEA,GAAC,CAAA,WAAW,CAAC,QAAQ,aAAC,KAAK,EAAE,EAAE,OAAO,SAAA,EAAE,EAAA,EAAA,EAAA,QAAA,EACrC,WAAW,EAAA,CAAA,CACS,EACxB;AACH,CAAC;;;;"}
|
|
@@ -38,6 +38,7 @@ export declare const colorTheme: {
|
|
|
38
38
|
border: {
|
|
39
39
|
default: string;
|
|
40
40
|
strong: string;
|
|
41
|
+
accent: string;
|
|
41
42
|
};
|
|
42
43
|
focus: {
|
|
43
44
|
default: string;
|
|
@@ -93,6 +94,8 @@ export declare const colorTheme: {
|
|
|
93
94
|
darkRed: string;
|
|
94
95
|
green: string;
|
|
95
96
|
lightGreen: string;
|
|
97
|
+
trendingBlue: string;
|
|
98
|
+
aiGreen: string;
|
|
96
99
|
gradient: string;
|
|
97
100
|
};
|
|
98
101
|
};
|
|
@@ -135,6 +138,7 @@ export declare const colorTheme: {
|
|
|
135
138
|
border: {
|
|
136
139
|
default: string;
|
|
137
140
|
strong: string;
|
|
141
|
+
accent: string;
|
|
138
142
|
};
|
|
139
143
|
focus: {
|
|
140
144
|
default: string;
|
|
@@ -190,6 +194,8 @@ export declare const colorTheme: {
|
|
|
190
194
|
darkRed: string;
|
|
191
195
|
green: string;
|
|
192
196
|
lightGreen: string;
|
|
197
|
+
trendingBlue: string;
|
|
198
|
+
aiGreen: string;
|
|
193
199
|
gradient: string;
|
|
194
200
|
};
|
|
195
201
|
};
|
|
@@ -232,6 +238,7 @@ export declare const colorTheme: {
|
|
|
232
238
|
border: {
|
|
233
239
|
default: string;
|
|
234
240
|
strong: string;
|
|
241
|
+
accent: string;
|
|
235
242
|
};
|
|
236
243
|
focus: {
|
|
237
244
|
default: string;
|
|
@@ -287,6 +294,8 @@ export declare const colorTheme: {
|
|
|
287
294
|
darkRed: string;
|
|
288
295
|
green: string;
|
|
289
296
|
lightGreen: string;
|
|
297
|
+
trendingBlue: string;
|
|
298
|
+
aiGreen: string;
|
|
290
299
|
gradient: string;
|
|
291
300
|
};
|
|
292
301
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/color.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/color.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAatB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA"}
|
|
@@ -46,6 +46,8 @@ export declare const primitiveTheme: {
|
|
|
46
46
|
darkRed: string;
|
|
47
47
|
green: string;
|
|
48
48
|
lightGreen: string;
|
|
49
|
+
trendingBlue: string;
|
|
50
|
+
aiGreen: string;
|
|
49
51
|
gradient: string;
|
|
50
52
|
};
|
|
51
53
|
};
|
|
@@ -96,6 +98,8 @@ export declare const primitiveTheme: {
|
|
|
96
98
|
darkRed: string;
|
|
97
99
|
green: string;
|
|
98
100
|
lightGreen: string;
|
|
101
|
+
trendingBlue: string;
|
|
102
|
+
aiGreen: string;
|
|
99
103
|
gradient: string;
|
|
100
104
|
};
|
|
101
105
|
};
|
|
@@ -146,6 +150,8 @@ export declare const primitiveTheme: {
|
|
|
146
150
|
darkRed: string;
|
|
147
151
|
green: string;
|
|
148
152
|
lightGreen: string;
|
|
153
|
+
trendingBlue: string;
|
|
154
|
+
aiGreen: string;
|
|
149
155
|
gradient: string;
|
|
150
156
|
};
|
|
151
157
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/primitive.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/primitive.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8J1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,cAAc,CAAC,GAAG,CAAA;AACvD,MAAM,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAA;AAChE,MAAM,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;AAC5D,MAAM,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -46,6 +46,8 @@ var primitiveTheme = {
|
|
|
46
46
|
darkRed: '#BB0218',
|
|
47
47
|
green: '#0F9E48',
|
|
48
48
|
lightGreen: '#13C65A',
|
|
49
|
+
trendingBlue: '#216FDC',
|
|
50
|
+
aiGreen: '#1FD187',
|
|
49
51
|
gradient: 'linear-gradient(315deg, #5b23e1 0%, #a22feb 100%)'
|
|
50
52
|
}
|
|
51
53
|
},
|
|
@@ -96,6 +98,8 @@ var primitiveTheme = {
|
|
|
96
98
|
darkRed: '#C43047',
|
|
97
99
|
green: '#6CDF44',
|
|
98
100
|
lightGreen: '#13C65A',
|
|
101
|
+
trendingBlue: '#216FDC',
|
|
102
|
+
aiGreen: '#1FD187',
|
|
99
103
|
gradient: 'linear-gradient(315deg, #7652cc 0%, #b05ce6 100%)'
|
|
100
104
|
}
|
|
101
105
|
},
|
|
@@ -146,6 +150,8 @@ var primitiveTheme = {
|
|
|
146
150
|
darkRed: '#C43047',
|
|
147
151
|
green: '#6CDF44',
|
|
148
152
|
lightGreen: '#13C65A',
|
|
153
|
+
trendingBlue: '#216FDC',
|
|
154
|
+
aiGreen: '#1FD187',
|
|
149
155
|
gradient: 'linear-gradient(323.08deg, #4FF069 36.13%, #09BD51 133.51%)'
|
|
150
156
|
}
|
|
151
157
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive.js","sources":["../../../src/foundations/color/primitive.ts"],"sourcesContent":["export const primitiveTheme = {\n day: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#CC0FE0',\n p100: '#D63FE6',\n p200: '#D127E3',\n p300: '#CC0FE0',\n p400: '#B80ECA',\n p500: '#A30CB3'\n },\n secondary: {\n secondary: '#7E1BCC',\n s100: '#9849D6',\n s200: '#8B32D1',\n s300: '#7E1BCC',\n s400: '#7118B8',\n s500: '#6516A3'\n },\n neutral: {\n neutral: '#858199',\n n25: '#FCFCFC',\n n50: '#F7F7F9',\n n100: '#F2F2F4',\n n150: '#E7E6EB',\n n200: '#DAD9E0',\n n300: '#CECDD6',\n n400: '#C2C0CC',\n n500: '#B6B3C2',\n n600: '#AAA7B8',\n n700: '#9D9AAD',\n n800: '#858199',\n n900: '#78748A',\n n950: '#6A677A'\n },\n special: {\n white: '#FFFFFF',\n background: '#F3F0F7',\n blue: '#1BA1F1',\n orange: '#FF9400',\n red: '#D0021B',\n darkRed: '#BB0218',\n green: '#0F9E48',\n lightGreen: '#13C65A',\n gradient: 'linear-gradient(315deg, #5b23e1 0%, #a22feb 100%)'\n }\n },\n\n dark: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#C74BD3',\n p100: '#A945B9',\n p200: '#B748C6',\n p300: '#C74BD3',\n p400: '#C556D4',\n p500: '#C563D6'\n },\n secondary: {\n secondary: '#9147CC',\n s100: '#7440A4',\n s200: '#8244B8',\n s300: '#9147CC',\n s400: '#975ACD',\n s500: '#9A60CF'\n },\n neutral: {\n neutral: '#BEC5E0',\n n25: '#35364F',\n n50: '#393A54',\n n100: '#3F415B',\n n150: '#4E4F6A',\n n200: '#5A5E78',\n n300: '#696D88',\n n400: '#777C96',\n n500: '#868AA4',\n n600: '#9399B3',\n n700: '#A2A8C2',\n n800: '#BEC5E0',\n n900: '#CFD5EC',\n n950: '#D9DEF1'\n },\n special: {\n white: '#32334D',\n background: '#242438',\n blue: '#58B9F4',\n orange: '#EFA947',\n red: '#F9344C',\n darkRed: '#C43047',\n green: '#6CDF44',\n lightGreen: '#13C65A',\n gradient: 'linear-gradient(315deg, #7652cc 0%, #b05ce6 100%)'\n }\n },\n matrix: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#0CF10C',\n p100: '#0CF10C',\n p200: '#0CF10C',\n p300: '#0CF10C',\n p400: '#0CF10C',\n p500: '#0CF10C'\n },\n secondary: {\n secondary: '#184F17',\n s100: '#184F17',\n s200: '#184F17',\n s300: '#184F17',\n s400: '#184F17',\n s500: '#184F17'\n },\n neutral: {\n neutral: '#21B404',\n n25: '#1D211B',\n n50: '#202A1D',\n n100: '#1A2F15',\n n150: '#1B3714',\n n200: '#1C5610',\n n300: '#1D5E0F',\n n400: '#1D660E',\n n500: '#1F850A',\n n600: '#1F9508',\n n700: '#20A406',\n n800: '#21B404',\n n900: '#21B404',\n n950: '#21B404'\n },\n special: {\n white: '#1F211F',\n background: '#191818',\n blue: '#58B9F4',\n orange: '#EFA947',\n red: '#F9344C',\n darkRed: '#C43047',\n green: '#6CDF44',\n lightGreen: '#13C65A',\n gradient: 'linear-gradient(323.08deg, #4FF069 36.13%, #09BD51 133.51%)'\n }\n }\n}\n\nexport type PrimitiveColors = typeof primitiveTheme.day\nexport type PrimaryColors = keyof PrimitiveColors['primary']\nexport type SecondaryColors = keyof PrimitiveColors['secondary']\nexport type NeutralColors = keyof PrimitiveColors['neutral']\nexport type SpecialColors = keyof PrimitiveColors['special']\n"],"names":[],"mappings":"AAAa,IAAA,cAAc,GAAG;AAC5B,IAAA,GAAG,EAAE;AACH,QAAA,MAAM,EAAE;AACN,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,OAAO,EAAE,SAAS;AACnB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,SAAS,EAAE,SAAS;AACpB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,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AA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,GAAG,EAAE,SAAS;AACd,YAAA,GAAG,EAAE,SAAS;AACd,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,UAAU,EAAE,SAAS;AACrB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,GAAG,EAAE,SAAS;AACd,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,UAAU,EAAE,SAAS;AACrB,YAAA,QAAQ,EAAE,6DAA6D;AACxE,SAAA;AACF,KAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"primitive.js","sources":["../../../src/foundations/color/primitive.ts"],"sourcesContent":["export const primitiveTheme = {\n day: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#CC0FE0',\n p100: '#D63FE6',\n p200: '#D127E3',\n p300: '#CC0FE0',\n p400: '#B80ECA',\n p500: '#A30CB3'\n },\n secondary: {\n secondary: '#7E1BCC',\n s100: '#9849D6',\n s200: '#8B32D1',\n s300: '#7E1BCC',\n s400: '#7118B8',\n s500: '#6516A3'\n },\n neutral: {\n neutral: '#858199',\n n25: '#FCFCFC',\n n50: '#F7F7F9',\n n100: '#F2F2F4',\n n150: '#E7E6EB',\n n200: '#DAD9E0',\n n300: '#CECDD6',\n n400: '#C2C0CC',\n n500: '#B6B3C2',\n n600: '#AAA7B8',\n n700: '#9D9AAD',\n n800: '#858199',\n n900: '#78748A',\n n950: '#6A677A'\n },\n special: {\n white: '#FFFFFF',\n background: '#F3F0F7',\n blue: '#1BA1F1',\n orange: '#FF9400',\n red: '#D0021B',\n darkRed: '#BB0218',\n green: '#0F9E48',\n lightGreen: '#13C65A',\n trendingBlue: '#216FDC',\n aiGreen: '#1FD187',\n gradient: 'linear-gradient(315deg, #5b23e1 0%, #a22feb 100%)'\n }\n },\n\n dark: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#C74BD3',\n p100: '#A945B9',\n p200: '#B748C6',\n p300: '#C74BD3',\n p400: '#C556D4',\n p500: '#C563D6'\n },\n secondary: {\n secondary: '#9147CC',\n s100: '#7440A4',\n s200: '#8244B8',\n s300: '#9147CC',\n s400: '#975ACD',\n s500: '#9A60CF'\n },\n neutral: {\n neutral: '#BEC5E0',\n n25: '#35364F',\n n50: '#393A54',\n n100: '#3F415B',\n n150: '#4E4F6A',\n n200: '#5A5E78',\n n300: '#696D88',\n n400: '#777C96',\n n500: '#868AA4',\n n600: '#9399B3',\n n700: '#A2A8C2',\n n800: '#BEC5E0',\n n900: '#CFD5EC',\n n950: '#D9DEF1'\n },\n special: {\n white: '#32334D',\n background: '#242438',\n blue: '#58B9F4',\n orange: '#EFA947',\n red: '#F9344C',\n darkRed: '#C43047',\n green: '#6CDF44',\n lightGreen: '#13C65A',\n trendingBlue: '#216FDC',\n aiGreen: '#1FD187',\n gradient: 'linear-gradient(315deg, #7652cc 0%, #b05ce6 100%)'\n }\n },\n matrix: {\n static: {\n white: '#FFFFFF',\n black: '#000000',\n primary: '#CC0FE0'\n },\n primary: {\n primary: '#0CF10C',\n p100: '#0CF10C',\n p200: '#0CF10C',\n p300: '#0CF10C',\n p400: '#0CF10C',\n p500: '#0CF10C'\n },\n secondary: {\n secondary: '#184F17',\n s100: '#184F17',\n s200: '#184F17',\n s300: '#184F17',\n s400: '#184F17',\n s500: '#184F17'\n },\n neutral: {\n neutral: '#21B404',\n n25: '#1D211B',\n n50: '#202A1D',\n n100: '#1A2F15',\n n150: '#1B3714',\n n200: '#1C5610',\n n300: '#1D5E0F',\n n400: '#1D660E',\n n500: '#1F850A',\n n600: '#1F9508',\n n700: '#20A406',\n n800: '#21B404',\n n900: '#21B404',\n n950: '#21B404'\n },\n special: {\n white: '#1F211F',\n background: '#191818',\n blue: '#58B9F4',\n orange: '#EFA947',\n red: '#F9344C',\n darkRed: '#C43047',\n green: '#6CDF44',\n lightGreen: '#13C65A',\n trendingBlue: '#216FDC',\n aiGreen: '#1FD187',\n gradient: 'linear-gradient(323.08deg, #4FF069 36.13%, #09BD51 133.51%)'\n }\n }\n}\n\nexport type PrimitiveColors = typeof primitiveTheme.day\nexport type PrimaryColors = keyof PrimitiveColors['primary']\nexport type SecondaryColors = keyof PrimitiveColors['secondary']\nexport type NeutralColors = keyof PrimitiveColors['neutral']\nexport type SpecialColors = keyof PrimitiveColors['special']\n"],"names":[],"mappings":"AAAa,IAAA,cAAc,GAAG;AAC5B,IAAA,GAAG,EAAE;AACH,QAAA,MAAM,EAAE;AACN,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,OAAO,EAAE,SAAS;AACnB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,SAAS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AS;AAClB,YAAA,QAAQ,EAAE,6DAA6D;AACxE,SAAA;AACF,KAAA;;;;;"}
|
|
@@ -38,6 +38,7 @@ export declare const semanticTheme: {
|
|
|
38
38
|
border: {
|
|
39
39
|
default: string;
|
|
40
40
|
strong: string;
|
|
41
|
+
accent: string;
|
|
41
42
|
};
|
|
42
43
|
focus: {
|
|
43
44
|
default: string;
|
|
@@ -87,6 +88,7 @@ export declare const semanticTheme: {
|
|
|
87
88
|
border: {
|
|
88
89
|
default: string;
|
|
89
90
|
strong: string;
|
|
91
|
+
accent: string;
|
|
90
92
|
};
|
|
91
93
|
focus: {
|
|
92
94
|
default: string;
|
|
@@ -136,6 +138,7 @@ export declare const semanticTheme: {
|
|
|
136
138
|
border: {
|
|
137
139
|
default: string;
|
|
138
140
|
strong: string;
|
|
141
|
+
accent: string;
|
|
139
142
|
};
|
|
140
143
|
focus: {
|
|
141
144
|
default: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/semantic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../../src/foundations/color/semantic.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,aAAa,CAAC,GAAG,CAAA;AAErD,MAAM,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAA;AACrD,MAAM,MAAM,gBAAgB,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;AACjE,MAAM,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;AACzD,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAA;AACvD,MAAM,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -38,7 +38,8 @@ var createSemanticTheme = function (primitives) { return ({
|
|
|
38
38
|
},
|
|
39
39
|
border: {
|
|
40
40
|
default: primitives.neutral.n100,
|
|
41
|
-
strong: primitives.neutral.n150
|
|
41
|
+
strong: primitives.neutral.n150,
|
|
42
|
+
accent: primitives.secondary.s300
|
|
42
43
|
},
|
|
43
44
|
focus: { default: primitives.secondary.secondary },
|
|
44
45
|
status: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","sources":["../../../src/foundations/color/semantic.ts"],"sourcesContent":["import type { PrimitiveColors } from './primitive'\nimport { primitiveTheme } from './primitive'\n\nconst createSemanticTheme = (primitives: PrimitiveColors) => ({\n text: {\n heading: primitives.special.gradient,\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n disabled: primitives.neutral.n150,\n active: primitives.primary.primary,\n accent: primitives.secondary.s300,\n staticWhite: primitives.static.white,\n warning: primitives.special.orange,\n danger: primitives.special.red\n },\n icon: {\n heading: primitives.special.gradient,\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n disabled: primitives.neutral.n150,\n active: primitives.primary.primary,\n accent: primitives.secondary.s300,\n staticWhite: primitives.static.white,\n warning: primitives.special.orange,\n danger: primitives.special.red\n },\n link: {\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n visible: primitives.primary.p500,\n inverted: primitives.static.white\n },\n background: {\n default: primitives.special.background,\n white: primitives.special.white,\n surface1: primitives.neutral.n25,\n surface2: primitives.neutral.n100,\n accent: primitives.secondary.s300\n },\n border: {\n default: primitives.neutral.n100,\n strong: primitives.neutral.n150\n },\n focus: { default: primitives.secondary.secondary },\n status: {\n error: primitives.special.red,\n warning: primitives.special.orange,\n success: primitives.special.green\n }\n})\n\nexport const semanticTheme = {\n day: createSemanticTheme(primitiveTheme.day),\n dark: createSemanticTheme(primitiveTheme.dark),\n matrix: createSemanticTheme(primitiveTheme.matrix)\n}\n\nexport type SemanticColors = typeof semanticTheme.day\n\nexport type TextColors = keyof SemanticColors['text']\nexport type IconColors = keyof SemanticColors['icon']\nexport type BackgroundColors = keyof SemanticColors['background']\nexport type BorderColors = keyof SemanticColors['border']\nexport type FocusColors = keyof SemanticColors['focus']\nexport type StatusColors = keyof SemanticColors['status']\n"],"names":[],"mappings":";;AAGA,IAAM,mBAAmB,GAAG,UAAC,UAA2B,EAAA,EAAK,QAAC;AAC5D,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;AACpC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AACnC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AACjC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AAClC,QAAA,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;AACjC,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AACpC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;AAClC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG;AAC/B,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;AACpC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AACnC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AACjC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AAClC,QAAA,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;AACjC,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AACpC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;AAClC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG;AAC/B,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AACnC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AAClC,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU;AACtC,QAAA,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK;AAC/B,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG;AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AACjC,QAAA,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;AAClC,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"semantic.js","sources":["../../../src/foundations/color/semantic.ts"],"sourcesContent":["import type { PrimitiveColors } from './primitive'\nimport { primitiveTheme } from './primitive'\n\nconst createSemanticTheme = (primitives: PrimitiveColors) => ({\n text: {\n heading: primitives.special.gradient,\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n disabled: primitives.neutral.n150,\n active: primitives.primary.primary,\n accent: primitives.secondary.s300,\n staticWhite: primitives.static.white,\n warning: primitives.special.orange,\n danger: primitives.special.red\n },\n icon: {\n heading: primitives.special.gradient,\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n disabled: primitives.neutral.n150,\n active: primitives.primary.primary,\n accent: primitives.secondary.s300,\n staticWhite: primitives.static.white,\n warning: primitives.special.orange,\n danger: primitives.special.red\n },\n link: {\n default: primitives.neutral.neutral,\n subdued: primitives.neutral.n400,\n visible: primitives.primary.p500,\n inverted: primitives.static.white\n },\n background: {\n default: primitives.special.background,\n white: primitives.special.white,\n surface1: primitives.neutral.n25,\n surface2: primitives.neutral.n100,\n accent: primitives.secondary.s300\n },\n border: {\n default: primitives.neutral.n100,\n strong: primitives.neutral.n150,\n accent: primitives.secondary.s300\n },\n focus: { default: primitives.secondary.secondary },\n status: {\n error: primitives.special.red,\n warning: primitives.special.orange,\n success: primitives.special.green\n }\n})\n\nexport const semanticTheme = {\n day: createSemanticTheme(primitiveTheme.day),\n dark: createSemanticTheme(primitiveTheme.dark),\n matrix: createSemanticTheme(primitiveTheme.matrix)\n}\n\nexport type SemanticColors = typeof semanticTheme.day\n\nexport type TextColors = keyof SemanticColors['text']\nexport type IconColors = keyof SemanticColors['icon']\nexport type BackgroundColors = keyof SemanticColors['background']\nexport type BorderColors = keyof SemanticColors['border']\nexport type FocusColors = keyof SemanticColors['focus']\nexport type StatusColors = keyof SemanticColors['status']\n"],"names":[],"mappings":";;AAGA,IAAM,mBAAmB,GAAG,UAAC,UAA2B,EAAA,EAAK,QAAC;AAC5D,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;AACpC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO;AACnC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AACjC,QAAA,MAAM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AAChC,QAAA,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AACjC,QAAA,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;AAClC,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAChC,QAAA,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;AAC/B,QAAA,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;AAClC,KAAA;IACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,EAAE;AAClD,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG;AAC7B,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;AAClC,QAAA,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK;AAClC,KAAA;CACF,EAAC,EAAA,CAAA;AAEW,IAAA,aAAa,GAAG;AAC3B,IAAA,GAAG,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,CAAC;AAC5C,IAAA,IAAI,EAAE,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC;AAC9C,IAAA,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAC,MAAM,CAAC;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { PlainButton } from './components/button/PlainButton/PlainButton.js';
|
|
|
27
27
|
export { SocialButton } from './components/button/SocialButton/SocialButton.js';
|
|
28
28
|
export { FollowButton } from './components/button/FollowButton/FollowButton.js';
|
|
29
29
|
export { FilterButton } from './components/button/FilterButton/FilterButton.js';
|
|
30
|
+
export { FilterButtonOptions, OptionsFilterButton } from './components/button/OptionsFilterButton/OptionsFilterButton.js';
|
|
30
31
|
export { IconButton } from './components/button/IconButton/IconButton.js';
|
|
31
32
|
export { UnstyledButton } from './components/button/UnstyledButton.js';
|
|
32
33
|
export { CompletionCheck } from './components/completion-check/CompletionCheck.js';
|
|
@@ -52,8 +53,10 @@ export { ProgressBar } from './components/progress-bar/ProgressBar.js';
|
|
|
52
53
|
export { Scrubber } from './components/scrubber/Scrubber.js';
|
|
53
54
|
export { Skeleton } from './components/skeleton/Skeleton.js';
|
|
54
55
|
export { Artwork } from './components/artwork/Artwork.js';
|
|
56
|
+
export { MusicBadge } from './components/music-badge/MusicBadge.js';
|
|
55
57
|
export { default as LoadingSpinner } from './components/loading-spinner/LoadingSpinner.js';
|
|
56
58
|
export { Pill } from './components/pill/Pill.js';
|
|
59
|
+
export { HiddenInput } from './components/common/HiddenInput.js';
|
|
57
60
|
export { IconAlbum, IconAllTime, IconAppearance, IconArrowLeft, IconArrowRight, IconBlog, IconBoxHeart, IconCalendarDay, IconCalendarMonth, IconCalendarWeek, IconCamera, IconCampfire, IconCaretDown, IconCaretLeft, IconCaretRight, IconCaretUp, IconCart, IconCastAirplay, IconCastChromecast, IconCheck, IconClose, IconCloseAlt, IconCloudDownload, IconCloudDownloadError, IconCloudDownloadInactive, IconCloudDownloadPaused, IconCloudDownloadQueued, IconCloudUpload, IconCollectible, IconCompose, IconCopy, IconCreatePlaylist, IconCreditCard, IconCrown, IconDashboard, IconDesktop, IconDonate, IconDrag, IconEarnings, IconEmailAddress, IconEmbed, IconError, IconExplore, IconExternalLink, IconFeed, IconFilter, IconFolder, IconFoundation, IconGift, IconHeadphones, IconHeart, IconImage, IconIndent, IconInfo, IconKebabHorizontal, IconKey, IconLibrary, IconLifeRing, IconLink, IconListeningHistory, IconListens, IconLock, IconLockUnlocked, IconMerch, IconMessage, IconMessageBlock, IconMessageLocked, IconMessageUnblock, IconMinus, IconMoneyBracket, IconMood, IconNoWifi, IconNote, IconNotificationOff, IconNotificationOn, IconPause, IconPencil, IconPlay, IconPlaybackPause, IconPlaybackPlay, IconPlaylists, IconPlus, IconPodcastBack, IconPodcastForward, IconQuestionCircle, IconRadar, IconReceive, IconRecoveryEmail, IconRefresh, IconRemix, IconRemove, IconRepeatOff, IconRepost, IconRobot, IconRocket, IconSave, IconSearch, IconSend, IconSettings, IconShare, IconShieldCheck, IconShieldUser, IconShuffle, IconSignOut, IconSkipNext, IconSkipPrevious, IconSkull, IconSort, IconSortDown, IconSortUp, IconSoundwave, IconSpeaker, IconSpecialAccess, IconStar, IconStars, IconSupport, IconTastemaker, IconThumbsDown, IconThumbsUp, IconTipping, IconTransaction, IconTrash, IconTrending, IconTriangleExclamation, IconTrophy, IconTurntable, IconUser, IconUserArrowRotate, IconUserFollow, IconUserFollowers, IconUserFollowing, IconUserGroup, IconUserList, IconUserUnfollow, IconValidationCheck, IconValidationX, IconVisibilityHidden, IconVisibilityPublic, IconVolumeLevel0, IconVolumeLevel1, IconVolumeLevel2, IconVolumeLevel3, IconWallet, IconWand, IconWaveForm, IconWithdraw } from './icons/utilityIcons.js';
|
|
58
61
|
export { IconAudiusLogo, IconAudiusLogoColor, IconAudiusLogoHorizontal, IconAudiusLogoHorizontalColor, IconAudiusLogoVertical, IconDiscord, IconFacebook, IconInstagram, IconLogoCircle, IconLogoCircleCoinbase, IconLogoCircleETH, IconLogoCircleSOL, IconLogoCircleSTR, IconLogoCircleUSD, IconLogoCircleUSDC, IconLogoCoinbase, IconLogoCoinbasePay, IconLogoLinkByStripe, IconMetamask, IconPhantom, IconSnapChat, IconSolana, IconTelegram, IconTikTok, IconTwitter } from './icons/logos.js';
|
|
59
62
|
export { IconArtistBadge, IconCcBy, IconCcCC, IconCcNC, IconCcNC_EU, IconCcNC_JP, IconCcND, IconCcPD, IconCcRemix, IconCcSA, IconCcSampling, IconCcSamplingPlus, IconCcShare, IconCcZero, IconCosign, IconFile3GA, IconFile3GP, IconFileAAC, IconFileAIF, IconFileAIFC, IconFileAIFF, IconFileAMR, IconFileAWB, IconFileFLAC, IconFileM4A, IconFileM4B, IconFileM4P, IconFileM4R, IconFileM4V, IconFileMP2, IconFileMP3, IconFileMP4, IconFileMPGA, IconFileOGA, IconFileOGG, IconFileOGM, IconFileOGV, IconFileOGX, IconFileOPUS, IconFileSPX, IconFileTS, IconFileTSA, IconFileTSV, IconFileUnknown, IconFileWAV, IconFileWAVE, IconFileWEBM, IconFileXWMA, IconMultiselectAdd, IconMultiselectRemove, IconTokenBronze, IconTokenGold, IconTokenNoTier, IconTokenPlatinum, IconTokenSilver, IconVerified } from './icons/specialIcons.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audius/harmony",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "The Audius Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Audius",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@storybook/testing-library": "0.2.2",
|
|
48
48
|
"@svgr/rollup": "8.1.0",
|
|
49
49
|
"@svgr/webpack": "8.1.0",
|
|
50
|
+
"@types/color": "3.0.6",
|
|
50
51
|
"@types/react": "18.2.0",
|
|
51
52
|
"@types/react-dom": "18.2.0",
|
|
52
53
|
"@types/react-lottie": "1.2.3",
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
"@radix-ui/react-slot": "^1.0.2",
|
|
88
89
|
"@react-spring/web": "^9.7.2",
|
|
89
90
|
"classnames": "^2.5.1",
|
|
91
|
+
"color": "4.2.3",
|
|
90
92
|
"lodash": "^4.17.21",
|
|
91
93
|
"react-lottie": "^1.2.3",
|
|
92
94
|
"react-merge-refs": "^2.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilterButton.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/button/FilterButton/FilterButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAMtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAwBnC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAA;AAG1C,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAe3B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAexB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAqB3B,CAAA"}
|