@mirohq/design-system-select 0.1.0-select.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/main.js ADDED
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var designSystemStitches = require('@mirohq/design-system-stitches');
8
+ var reactSelect = require('@radix-ui/react-select');
9
+ var designSystem = require('@mirohq/design-system');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+
15
+ const StyledSelect = designSystemStitches.styled(reactSelect.Root);
16
+
17
+ const StyledGroup = designSystemStitches.styled(reactSelect.Group, {});
18
+
19
+ const Group = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledGroup, { ...props, ref: forwardRef }));
20
+
21
+ const StyledItem = designSystemStitches.styled(reactSelect.Item, {});
22
+
23
+ const StyledItemText = designSystemStitches.styled(reactSelect.ItemText, {});
24
+
25
+ const StyledItemIndicator = designSystemStitches.styled(reactSelect.ItemIndicator, {});
26
+
27
+ const Item = React__default["default"].forwardRef(
28
+ ({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsxs(StyledItem, { ...restProps, ref: forwardRef, children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx(StyledItemText, { children }),
30
+ /* @__PURE__ */ jsxRuntime.jsx(StyledItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconCheckMark, {}) })
31
+ ] })
32
+ );
33
+
34
+ const StyledPortal = designSystemStitches.styled(reactSelect.Portal, {});
35
+
36
+ const Portal = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledPortal, { ...props, ref: forwardRef }));
37
+
38
+ const StyledTrigger = designSystemStitches.styled(reactSelect.Trigger, {});
39
+
40
+ const Trigger = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsxs(StyledTrigger, { ...restProps, ref: forwardRef, children: [
41
+ children,
42
+ /* @__PURE__ */ jsxRuntime.jsx(reactSelect.SelectIcon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconChevronDown, {}) })
43
+ ] }));
44
+
45
+ const StyledValue = designSystemStitches.styled(reactSelect.Value, {});
46
+
47
+ const Value = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledValue, { ...props, ref: forwardRef }));
48
+
49
+ const StyledContent = designSystemStitches.styled(reactSelect.Content, {});
50
+
51
+ const Content = React__default["default"].forwardRef(
52
+ ({
53
+ side = "bottom",
54
+ align = "center",
55
+ alignOffset = 0,
56
+ collisionPadding = 0,
57
+ avoidCollisions = true,
58
+ sticky = "partial",
59
+ hideWhenDetached = true,
60
+ overflow = "visible",
61
+ maxHeight,
62
+ children,
63
+ ...restProps
64
+ }, forwardRef) => {
65
+ const getOverflowMaxHeight = React.useCallback(() => {
66
+ const overflowMaxHeigh = "calc(var(--radix-select-content-available-height))";
67
+ return {
68
+ maxHeight: maxHeight === void 0 ? overflowMaxHeigh : maxHeight
69
+ };
70
+ }, [maxHeight]);
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ StyledContent,
73
+ {
74
+ ...restProps,
75
+ ref: forwardRef,
76
+ side,
77
+ align,
78
+ alignOffset,
79
+ avoidCollisions,
80
+ collisionPadding,
81
+ sticky,
82
+ hideWhenDetached,
83
+ children: overflow === "auto" ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ScrollArea, { type: "always", children: [
84
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
85
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.ScrollArea.Thumb, {}) })
86
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children })
87
+ }
88
+ );
89
+ }
90
+ );
91
+
92
+ const StyledLabel = designSystemStitches.styled(reactSelect.Label, {});
93
+
94
+ const Label = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledLabel, { ...props, ref: forwardRef }));
95
+
96
+ const StyledSeparator = designSystemStitches.styled(reactSelect.Separator, {});
97
+
98
+ const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, ref: forwardRef }));
99
+
100
+ const Select = React__default["default"].forwardRef(
101
+ ({
102
+ defaultOpen = false,
103
+ direction = "ltr",
104
+ open,
105
+ onOpen,
106
+ onClose,
107
+ ...restProps
108
+ }, forwardRef) => {
109
+ const [openState, setOpenState] = React.useState(defaultOpen);
110
+ return /* @__PURE__ */ jsxRuntime.jsx(
111
+ StyledSelect,
112
+ {
113
+ ...restProps,
114
+ dir: direction,
115
+ open: open != null ? open : openState,
116
+ onOpenChange: (newOpen) => {
117
+ if (open == null) {
118
+ setOpenState(newOpen);
119
+ }
120
+ newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
121
+ },
122
+ ref: forwardRef
123
+ }
124
+ );
125
+ }
126
+ );
127
+ Select.Group = Group;
128
+ Select.Separator = Separator;
129
+ Select.Content = Content;
130
+ Select.Item = Item;
131
+ Select.Portal = Portal;
132
+ Select.Trigger = Trigger;
133
+ Select.Value = Value;
134
+ Select.Label = Label;
135
+
136
+ var types = /*#__PURE__*/Object.freeze({
137
+ __proto__: null
138
+ });
139
+
140
+ exports.Select = Select;
141
+ exports.SelectTypes = types;
142
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["../src/select.styled.tsx","../partials/group.styled.tsx","../partials/group.tsx","../partials/item.styled.tsx","../partials/item-text.styled.tsx","../partials/item-indicator.styled.tsx","../partials/item.tsx","../partials/portal.styled.tsx","../partials/portal.tsx","../partials/trigger.styled.tsx","../partials/trigger.tsx","../partials/value.styled.tsx","../partials/value.tsx","../partials/content.styled.tsx","../partials/content.tsx","../partials/label.styled.tsx","../partials/label.tsx","../partials/separator.styled.tsx","../partials/separator.tsx","../src/select.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Root as RadixSelect } from '@radix-ui/react-select'\n\nexport const StyledSelect = styled(RadixSelect)\n\nexport type StyledSelectProps = ComponentPropsWithRef<typeof StyledSelect>\n","import { Group as RadixGroup } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroup = styled(RadixGroup, {})\n\nexport type StyledGroupProps = StrictComponentProps<typeof StyledGroup>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroup } from './group.styled'\nimport type { StyledGroupProps } from './group.styled'\n\nexport interface GroupProps extends StyledGroupProps {}\n\nexport const Group = React.forwardRef<\n ElementRef<typeof StyledGroup>,\n GroupProps\n>((props, forwardRef) => <StyledGroup {...props} ref={forwardRef} />)\n","import { Item as RadixItem } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItem = styled(RadixItem, {})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import { ItemText as RadixItemText } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemText = styled(RadixItemText, {})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItemText>\n","import { ItemIndicator as RadixItemIndicator } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemIndicator = styled(RadixItemIndicator, {})\n\nexport type StyledItemIndicatorProps = StrictComponentProps<\n typeof StyledItemIndicator\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { IconCheckMark } from '@mirohq/design-system'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\nimport { StyledItemText } from './item-text.styled'\nimport { StyledItemIndicator } from './item-indicator.styled'\n\nexport interface ItemProps extends StyledItemProps {\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n\n /**\n * When true, prevents the user from interacting with the item.\n */\n disabled?: boolean\n\n /**\n * Optional text used for typeahead purposes. By default the typeahead\n * behavior will use the Select's item text. Use this when the content is\n * complex, or you have non-textual content inside.\n */\n textValue?: string\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ children, ...restProps }, forwardRef) => (\n <StyledItem {...restProps} ref={forwardRef}>\n <StyledItemText>{children}</StyledItemText>\n <StyledItemIndicator>\n <IconCheckMark />\n </StyledItemIndicator>\n </StyledItem>\n )\n)\n","import { Portal as RadixPortal } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledPortal = styled(RadixPortal, {})\n\nexport type StyledPortalProps = StrictComponentProps<typeof StyledPortal>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledPortal } from './portal.styled'\nimport type { StyledPortalProps } from './portal.styled'\n\nexport interface PortalProps extends StyledPortalProps {\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal = React.forwardRef<\n ElementRef<typeof StyledPortal>,\n PortalProps\n>((props, forwardRef) => <StyledPortal {...props} ref={forwardRef} />)\n","import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Trigger as RadixTrigger } from '@radix-ui/react-select'\n\nexport const StyledTrigger = styled(RadixTrigger, {})\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { SelectIcon as RadixSelectIcon } from '@radix-ui/react-select'\nimport { IconChevronDown } from '@mirohq/design-system'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n children: React.ReactNode\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledTrigger {...restProps} ref={forwardRef}>\n {children}\n <RadixSelectIcon asChild>\n <IconChevronDown />\n </RadixSelectIcon>\n </StyledTrigger>\n))\n","import { Value as RadixValue } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledValue = styled(RadixValue, {})\n\nexport type StyledValueProps = StrictComponentProps<typeof StyledValue>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledValue } from './value.styled'\nimport type { StyledValueProps } from './value.styled'\n\nexport interface ValueProps extends StyledValueProps {\n /**\n * The content that will be rendered inside the Select.Value when no value or\n * defaultValue is set.\n */\n placeholder?: React.ReactNode\n\n /**\n * The controlled content that will be rendered inside the Select.Value.\n */\n children?: React.ReactNode\n}\n\nexport const Value = React.forwardRef<\n ElementRef<typeof StyledValue>,\n ValueProps\n>((props, forwardRef) => <StyledValue {...props} ref={forwardRef} />)\n","import { Content as RadixContent } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledContent = styled(RadixContent, {})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React, { useCallback } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { ScrollArea } from '@mirohq/design-system'\nimport type { CSS, CSSProperties } from '@stitches/react'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type {\n Boundary,\n PointerDownOutsideEvent,\n Side,\n Overflow,\n} from '../src/types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * Event handler called when focus moves to the trigger after closing. It can\n * be prevented by calling event.preventDefault.\n */\n onCloseAutoFocus?: (event: Event) => void\n\n /**\n * Event handler called when focus moves to the trigger after closing. It can\n * be prevented by calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n\n /**\n * The positioning mode to use, item-aligned is the default and behaves\n * similarly to a native MacOS menu by positioning content relative to the\n * active item. popper positions content in the same way as our other\n * primitives, for example Popover or DropdownMenu.\n */\n position?: 'item-aligned' | 'popper'\n\n /**\n * The preferred side of the anchor to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled. Only\n * available when position is set to popper.\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * The distance in pixels from the anchor. Only available when position is set\n * to popper.\n */\n sideOffset?: number\n\n /**\n * The preferred alignment against the anchor. May change when collisions\n * occur. Only available when position is set to popper.\n */\n align?: 'start' | 'center' | 'end'\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options. Only\n * available when position is set to popper.\n */\n alignOffset?: number\n\n /**\n * When true, overrides the side andalign preferences to prevent collisions\n * with boundary edges. Only available when position is set to popper.\n */\n avoidCollisions?: boolean\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check. Only available when position is set to popper.\n */\n collisionBoundary?: Boundary\n\n /**\n * The distance in pixels from the boundary edges where collision detection\n * should occur. Accepts a number (same for all sides), or a partial padding\n * object, for example: { top: 20, left: 20 }. Only available when position is\n * set to popper.\n */\n collisionPadding?: number | Partial<Record<Side, number>>\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in the\n * boundary as long as the trigger is at least partially in the boundary whilst\n * \"always\" will keep the content in the boundary regardless. Only available\n * when position is set to popper.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded. Only\n * available when position is set to popper.\n */\n hideWhenDetached?: boolean\n\n /**\n * The max height for the content.\n */\n maxHeight?: CSSProperties['maxHeight']\n\n /**\n * Setting overflow as \"visible\" means that the content can extend beyond the\n * its collision boundary without any clipping or scrolling being\n * applied.\n * When set to \"auto,\" a scrollbar is added if the content exceeds its\n * boundaries. If no maxHeight is defined, it will be automatically adjusted\n * to fit the remaining space between the trigger and the boundary edge.\n */\n overflow?: Overflow\n\n /**\n * Select's content.\n */\n children?: ReactNode\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n side = 'bottom',\n align = 'center',\n alignOffset = 0,\n collisionPadding = 0,\n avoidCollisions = true,\n sticky = 'partial',\n hideWhenDetached = true,\n overflow = 'visible',\n maxHeight,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n const getOverflowMaxHeight = useCallback((): CSS => {\n const overflowMaxHeigh = `calc(var(--radix-select-content-available-height))`\n\n return {\n maxHeight: maxHeight === undefined ? overflowMaxHeigh : maxHeight,\n }\n }, [maxHeight])\n return (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n side={side}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n sticky={sticky}\n hideWhenDetached={hideWhenDetached}\n >\n {overflow === 'auto' ? (\n <ScrollArea type='always'>\n <ScrollArea.Viewport css={{ ...getOverflowMaxHeight() }}>\n {children}\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar orientation='vertical'>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea>\n ) : (\n <>{children}</>\n )}\n </StyledContent>\n )\n }\n)\n","import { Label as RadixLabel } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledLabel = styled(RadixLabel, {})\n\nexport type StyledLabelProps = StrictComponentProps<typeof StyledLabel>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledLabel } from './label.styled'\nimport type { StyledLabelProps } from './label.styled'\n\nexport interface LabelProps extends StyledLabelProps {}\n\nexport const Label = React.forwardRef<\n ElementRef<typeof StyledLabel>,\n LabelProps\n>((props, forwardRef) => <StyledLabel {...props} ref={forwardRef} />)\n","import { Separator as RadixSeparator } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledSeparator = styled(RadixSeparator, {})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledSeparator } from './separator.styled'\nimport type { StyledSeparatorProps } from './separator.styled'\n\nexport interface SeparatorProps extends StyledSeparatorProps {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => <StyledSeparator {...props} ref={forwardRef} />)\n","import React, { useState } from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport { StyledSelect } from './select.styled'\nimport type { StyledSelectProps } from './select.styled'\nimport { Group } from '../partials/group'\nimport { Item } from '../partials/item'\nimport { Portal } from '../partials/portal'\nimport { Trigger } from '../partials/trigger'\nimport { Value } from '../partials/value'\nimport { Content } from '../partials/content'\nimport { Label } from '../partials/label'\nimport { Separator } from '../partials/separator'\n\nexport interface SelectProps extends StyledSelectProps {\n /**\n * The value of the select when initially rendered. Use when you do not need\n * to control the state of the select.\n */\n defaultValue?: string\n\n /**\n * The controlled value of the select. Should be used in conjunction with\n * onValueChange.\n */\n value?: string\n\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n\n /**\n * The open state of the select when it is initially rendered. Use when you do\n * not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The controlled open state of the select. Must be used in conjunction with\n * onOpenChange.\n */\n open?: boolean\n\n /**\n * Event handler called when the select opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the select closes.\n */\n onClose?: () => void\n\n /**\n * The reading direction of the select when applicable. If omitted, inherits\n * globally from DirectionProvider or assumes LTR (left-to-right) reading\n * mode.\n */\n direction?: 'ltr' | 'rtl'\n\n /**\n * The name of the select. Submitted with its owning form as part of a\n * name/value pair.\n */\n name?: string\n\n /**\n * When true, prevents the user from interacting with select.\n */\n disabled?: boolean\n\n /**\n * When true, indicates that the user must select a value before the owning\n * form can be submitted.\n */\n required?: boolean\n}\n\nexport const Select = React.forwardRef<\n ElementRef<typeof StyledSelect>,\n SelectProps\n>(\n (\n {\n defaultOpen = false,\n direction = 'ltr',\n open,\n onOpen,\n onClose,\n ...restProps\n },\n forwardRef\n ) => {\n const [openState, setOpenState] = useState(defaultOpen)\n\n return (\n <StyledSelect\n {...restProps}\n dir={direction}\n open={open ?? openState}\n onOpenChange={newOpen => {\n if (open == null) {\n setOpenState(newOpen)\n }\n\n newOpen ? onOpen?.() : onClose?.()\n }}\n ref={forwardRef}\n />\n )\n }\n) as ForwardRefExoticComponent<SelectProps> & Partials\n\ninterface Partials {\n Content: typeof Content\n Separator: typeof Separator\n Label: typeof Label\n Group: typeof Group\n Item: typeof Item\n Portal: typeof Portal\n Trigger: typeof Trigger\n Value: typeof Value\n}\n\nSelect.Group = Group\nSelect.Separator = Separator\nSelect.Content = Content\nSelect.Item = Item\nSelect.Portal = Portal\nSelect.Trigger = Trigger\nSelect.Value = Value\nSelect.Label = Label\n"],"names":["styled","RadixSelect","RadixGroup","React","jsx","RadixItem","RadixItemText","RadixItemIndicator","jsxs","IconCheckMark","RadixPortal","RadixTrigger","RadixSelectIcon","IconChevronDown","RadixValue","RadixContent","useCallback","ScrollArea","RadixLabel","Rad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
@@ -0,0 +1,133 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { useCallback, useState } from 'react';
3
+ import { styled } from '@mirohq/design-system-stitches';
4
+ import { Root, Group as Group$1, Item as Item$1, ItemText, ItemIndicator, Portal as Portal$1, Trigger as Trigger$1, SelectIcon, Value as Value$1, Content as Content$1, Label as Label$1, Separator as Separator$1 } from '@radix-ui/react-select';
5
+ import { IconCheckMark, IconChevronDown, ScrollArea } from '@mirohq/design-system';
6
+
7
+ const StyledSelect = styled(Root);
8
+
9
+ const StyledGroup = styled(Group$1, {});
10
+
11
+ const Group = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledGroup, { ...props, ref: forwardRef }));
12
+
13
+ const StyledItem = styled(Item$1, {});
14
+
15
+ const StyledItemText = styled(ItemText, {});
16
+
17
+ const StyledItemIndicator = styled(ItemIndicator, {});
18
+
19
+ const Item = React.forwardRef(
20
+ ({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxs(StyledItem, { ...restProps, ref: forwardRef, children: [
21
+ /* @__PURE__ */ jsx(StyledItemText, { children }),
22
+ /* @__PURE__ */ jsx(StyledItemIndicator, { children: /* @__PURE__ */ jsx(IconCheckMark, {}) })
23
+ ] })
24
+ );
25
+
26
+ const StyledPortal = styled(Portal$1, {});
27
+
28
+ const Portal = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledPortal, { ...props, ref: forwardRef }));
29
+
30
+ const StyledTrigger = styled(Trigger$1, {});
31
+
32
+ const Trigger = React.forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxs(StyledTrigger, { ...restProps, ref: forwardRef, children: [
33
+ children,
34
+ /* @__PURE__ */ jsx(SelectIcon, { asChild: true, children: /* @__PURE__ */ jsx(IconChevronDown, {}) })
35
+ ] }));
36
+
37
+ const StyledValue = styled(Value$1, {});
38
+
39
+ const Value = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledValue, { ...props, ref: forwardRef }));
40
+
41
+ const StyledContent = styled(Content$1, {});
42
+
43
+ const Content = React.forwardRef(
44
+ ({
45
+ side = "bottom",
46
+ align = "center",
47
+ alignOffset = 0,
48
+ collisionPadding = 0,
49
+ avoidCollisions = true,
50
+ sticky = "partial",
51
+ hideWhenDetached = true,
52
+ overflow = "visible",
53
+ maxHeight,
54
+ children,
55
+ ...restProps
56
+ }, forwardRef) => {
57
+ const getOverflowMaxHeight = useCallback(() => {
58
+ const overflowMaxHeigh = "calc(var(--radix-select-content-available-height))";
59
+ return {
60
+ maxHeight: maxHeight === void 0 ? overflowMaxHeigh : maxHeight
61
+ };
62
+ }, [maxHeight]);
63
+ return /* @__PURE__ */ jsx(
64
+ StyledContent,
65
+ {
66
+ ...restProps,
67
+ ref: forwardRef,
68
+ side,
69
+ align,
70
+ alignOffset,
71
+ avoidCollisions,
72
+ collisionPadding,
73
+ sticky,
74
+ hideWhenDetached,
75
+ children: overflow === "auto" ? /* @__PURE__ */ jsxs(ScrollArea, { type: "always", children: [
76
+ /* @__PURE__ */ jsx(ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
77
+ /* @__PURE__ */ jsx(ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })
78
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children })
79
+ }
80
+ );
81
+ }
82
+ );
83
+
84
+ const StyledLabel = styled(Label$1, {});
85
+
86
+ const Label = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledLabel, { ...props, ref: forwardRef }));
87
+
88
+ const StyledSeparator = styled(Separator$1, {});
89
+
90
+ const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledSeparator, { ...props, ref: forwardRef }));
91
+
92
+ const Select = React.forwardRef(
93
+ ({
94
+ defaultOpen = false,
95
+ direction = "ltr",
96
+ open,
97
+ onOpen,
98
+ onClose,
99
+ ...restProps
100
+ }, forwardRef) => {
101
+ const [openState, setOpenState] = useState(defaultOpen);
102
+ return /* @__PURE__ */ jsx(
103
+ StyledSelect,
104
+ {
105
+ ...restProps,
106
+ dir: direction,
107
+ open: open != null ? open : openState,
108
+ onOpenChange: (newOpen) => {
109
+ if (open == null) {
110
+ setOpenState(newOpen);
111
+ }
112
+ newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
113
+ },
114
+ ref: forwardRef
115
+ }
116
+ );
117
+ }
118
+ );
119
+ Select.Group = Group;
120
+ Select.Separator = Separator;
121
+ Select.Content = Content;
122
+ Select.Item = Item;
123
+ Select.Portal = Portal;
124
+ Select.Trigger = Trigger;
125
+ Select.Value = Value;
126
+ Select.Label = Label;
127
+
128
+ var types = /*#__PURE__*/Object.freeze({
129
+ __proto__: null
130
+ });
131
+
132
+ export { Select, types as SelectTypes };
133
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sources":["../src/select.styled.tsx","../partials/group.styled.tsx","../partials/group.tsx","../partials/item.styled.tsx","../partials/item-text.styled.tsx","../partials/item-indicator.styled.tsx","../partials/item.tsx","../partials/portal.styled.tsx","../partials/portal.tsx","../partials/trigger.styled.tsx","../partials/trigger.tsx","../partials/value.styled.tsx","../partials/value.tsx","../partials/content.styled.tsx","../partials/content.tsx","../partials/label.styled.tsx","../partials/label.tsx","../partials/separator.styled.tsx","../partials/separator.tsx","../src/select.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Root as RadixSelect } from '@radix-ui/react-select'\n\nexport const StyledSelect = styled(RadixSelect)\n\nexport type StyledSelectProps = ComponentPropsWithRef<typeof StyledSelect>\n","import { Group as RadixGroup } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledGroup = styled(RadixGroup, {})\n\nexport type StyledGroupProps = StrictComponentProps<typeof StyledGroup>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledGroup } from './group.styled'\nimport type { StyledGroupProps } from './group.styled'\n\nexport interface GroupProps extends StyledGroupProps {}\n\nexport const Group = React.forwardRef<\n ElementRef<typeof StyledGroup>,\n GroupProps\n>((props, forwardRef) => <StyledGroup {...props} ref={forwardRef} />)\n","import { Item as RadixItem } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItem = styled(RadixItem, {})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import { ItemText as RadixItemText } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemText = styled(RadixItemText, {})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItemText>\n","import { ItemIndicator as RadixItemIndicator } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledItemIndicator = styled(RadixItemIndicator, {})\n\nexport type StyledItemIndicatorProps = StrictComponentProps<\n typeof StyledItemIndicator\n>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { IconCheckMark } from '@mirohq/design-system'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\nimport { StyledItemText } from './item-text.styled'\nimport { StyledItemIndicator } from './item-indicator.styled'\n\nexport interface ItemProps extends StyledItemProps {\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n\n /**\n * When true, prevents the user from interacting with the item.\n */\n disabled?: boolean\n\n /**\n * Optional text used for typeahead purposes. By default the typeahead\n * behavior will use the Select's item text. Use this when the content is\n * complex, or you have non-textual content inside.\n */\n textValue?: string\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ children, ...restProps }, forwardRef) => (\n <StyledItem {...restProps} ref={forwardRef}>\n <StyledItemText>{children}</StyledItemText>\n <StyledItemIndicator>\n <IconCheckMark />\n </StyledItemIndicator>\n </StyledItem>\n )\n)\n","import { Portal as RadixPortal } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledPortal = styled(RadixPortal, {})\n\nexport type StyledPortalProps = StrictComponentProps<typeof StyledPortal>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledPortal } from './portal.styled'\nimport type { StyledPortalProps } from './portal.styled'\n\nexport interface PortalProps extends StyledPortalProps {\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal = React.forwardRef<\n ElementRef<typeof StyledPortal>,\n PortalProps\n>((props, forwardRef) => <StyledPortal {...props} ref={forwardRef} />)\n","import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Trigger as RadixTrigger } from '@radix-ui/react-select'\n\nexport const StyledTrigger = styled(RadixTrigger, {})\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { SelectIcon as RadixSelectIcon } from '@radix-ui/react-select'\nimport { IconChevronDown } from '@mirohq/design-system'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n children: React.ReactNode\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledTrigger {...restProps} ref={forwardRef}>\n {children}\n <RadixSelectIcon asChild>\n <IconChevronDown />\n </RadixSelectIcon>\n </StyledTrigger>\n))\n","import { Value as RadixValue } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledValue = styled(RadixValue, {})\n\nexport type StyledValueProps = StrictComponentProps<typeof StyledValue>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledValue } from './value.styled'\nimport type { StyledValueProps } from './value.styled'\n\nexport interface ValueProps extends StyledValueProps {\n /**\n * The content that will be rendered inside the Select.Value when no value or\n * defaultValue is set.\n */\n placeholder?: React.ReactNode\n\n /**\n * The controlled content that will be rendered inside the Select.Value.\n */\n children?: React.ReactNode\n}\n\nexport const Value = React.forwardRef<\n ElementRef<typeof StyledValue>,\n ValueProps\n>((props, forwardRef) => <StyledValue {...props} ref={forwardRef} />)\n","import { Content as RadixContent } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledContent = styled(RadixContent, {})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React, { useCallback } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport { ScrollArea } from '@mirohq/design-system'\nimport type { CSS, CSSProperties } from '@stitches/react'\n\nimport { StyledContent } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type {\n Boundary,\n PointerDownOutsideEvent,\n Side,\n Overflow,\n} from '../src/types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * Event handler called when focus moves to the trigger after closing. It can\n * be prevented by calling event.preventDefault.\n */\n onCloseAutoFocus?: (event: Event) => void\n\n /**\n * Event handler called when focus moves to the trigger after closing. It can\n * be prevented by calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n\n /**\n * The positioning mode to use, item-aligned is the default and behaves\n * similarly to a native MacOS menu by positioning content relative to the\n * active item. popper positions content in the same way as our other\n * primitives, for example Popover or DropdownMenu.\n */\n position?: 'item-aligned' | 'popper'\n\n /**\n * The preferred side of the anchor to render against when open. Will be\n * reversed when collisions occur and avoidCollisions is enabled. Only\n * available when position is set to popper.\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * The distance in pixels from the anchor. Only available when position is set\n * to popper.\n */\n sideOffset?: number\n\n /**\n * The preferred alignment against the anchor. May change when collisions\n * occur. Only available when position is set to popper.\n */\n align?: 'start' | 'center' | 'end'\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options. Only\n * available when position is set to popper.\n */\n alignOffset?: number\n\n /**\n * When true, overrides the side andalign preferences to prevent collisions\n * with boundary edges. Only available when position is set to popper.\n */\n avoidCollisions?: boolean\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check. Only available when position is set to popper.\n */\n collisionBoundary?: Boundary\n\n /**\n * The distance in pixels from the boundary edges where collision detection\n * should occur. Accepts a number (same for all sides), or a partial padding\n * object, for example: { top: 20, left: 20 }. Only available when position is\n * set to popper.\n */\n collisionPadding?: number | Partial<Record<Side, number>>\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in the\n * boundary as long as the trigger is at least partially in the boundary whilst\n * \"always\" will keep the content in the boundary regardless. Only available\n * when position is set to popper.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded. Only\n * available when position is set to popper.\n */\n hideWhenDetached?: boolean\n\n /**\n * The max height for the content.\n */\n maxHeight?: CSSProperties['maxHeight']\n\n /**\n * Setting overflow as \"visible\" means that the content can extend beyond the\n * its collision boundary without any clipping or scrolling being\n * applied.\n * When set to \"auto,\" a scrollbar is added if the content exceeds its\n * boundaries. If no maxHeight is defined, it will be automatically adjusted\n * to fit the remaining space between the trigger and the boundary edge.\n */\n overflow?: Overflow\n\n /**\n * Select's content.\n */\n children?: ReactNode\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n side = 'bottom',\n align = 'center',\n alignOffset = 0,\n collisionPadding = 0,\n avoidCollisions = true,\n sticky = 'partial',\n hideWhenDetached = true,\n overflow = 'visible',\n maxHeight,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n const getOverflowMaxHeight = useCallback((): CSS => {\n const overflowMaxHeigh = `calc(var(--radix-select-content-available-height))`\n\n return {\n maxHeight: maxHeight === undefined ? overflowMaxHeigh : maxHeight,\n }\n }, [maxHeight])\n return (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n side={side}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n sticky={sticky}\n hideWhenDetached={hideWhenDetached}\n >\n {overflow === 'auto' ? (\n <ScrollArea type='always'>\n <ScrollArea.Viewport css={{ ...getOverflowMaxHeight() }}>\n {children}\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar orientation='vertical'>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea>\n ) : (\n <>{children}</>\n )}\n </StyledContent>\n )\n }\n)\n","import { Label as RadixLabel } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledLabel = styled(RadixLabel, {})\n\nexport type StyledLabelProps = StrictComponentProps<typeof StyledLabel>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledLabel } from './label.styled'\nimport type { StyledLabelProps } from './label.styled'\n\nexport interface LabelProps extends StyledLabelProps {}\n\nexport const Label = React.forwardRef<\n ElementRef<typeof StyledLabel>,\n LabelProps\n>((props, forwardRef) => <StyledLabel {...props} ref={forwardRef} />)\n","import { Separator as RadixSeparator } from '@radix-ui/react-select'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledSeparator = styled(RadixSeparator, {})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledSeparator } from './separator.styled'\nimport type { StyledSeparatorProps } from './separator.styled'\n\nexport interface SeparatorProps extends StyledSeparatorProps {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => <StyledSeparator {...props} ref={forwardRef} />)\n","import React, { useState } from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport { StyledSelect } from './select.styled'\nimport type { StyledSelectProps } from './select.styled'\nimport { Group } from '../partials/group'\nimport { Item } from '../partials/item'\nimport { Portal } from '../partials/portal'\nimport { Trigger } from '../partials/trigger'\nimport { Value } from '../partials/value'\nimport { Content } from '../partials/content'\nimport { Label } from '../partials/label'\nimport { Separator } from '../partials/separator'\n\nexport interface SelectProps extends StyledSelectProps {\n /**\n * The value of the select when initially rendered. Use when you do not need\n * to control the state of the select.\n */\n defaultValue?: string\n\n /**\n * The controlled value of the select. Should be used in conjunction with\n * onValueChange.\n */\n value?: string\n\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n\n /**\n * The open state of the select when it is initially rendered. Use when you do\n * not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The controlled open state of the select. Must be used in conjunction with\n * onOpenChange.\n */\n open?: boolean\n\n /**\n * Event handler called when the select opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the select closes.\n */\n onClose?: () => void\n\n /**\n * The reading direction of the select when applicable. If omitted, inherits\n * globally from DirectionProvider or assumes LTR (left-to-right) reading\n * mode.\n */\n direction?: 'ltr' | 'rtl'\n\n /**\n * The name of the select. Submitted with its owning form as part of a\n * name/value pair.\n */\n name?: string\n\n /**\n * When true, prevents the user from interacting with select.\n */\n disabled?: boolean\n\n /**\n * When true, indicates that the user must select a value before the owning\n * form can be submitted.\n */\n required?: boolean\n}\n\nexport const Select = React.forwardRef<\n ElementRef<typeof StyledSelect>,\n SelectProps\n>(\n (\n {\n defaultOpen = false,\n direction = 'ltr',\n open,\n onOpen,\n onClose,\n ...restProps\n },\n forwardRef\n ) => {\n const [openState, setOpenState] = useState(defaultOpen)\n\n return (\n <StyledSelect\n {...restProps}\n dir={direction}\n open={open ?? openState}\n onOpenChange={newOpen => {\n if (open == null) {\n setOpenState(newOpen)\n }\n\n newOpen ? onOpen?.() : onClose?.()\n }}\n ref={forwardRef}\n />\n )\n }\n) as ForwardRefExoticComponent<SelectProps> & Partials\n\ninterface Partials {\n Content: typeof Content\n Separator: typeof Separator\n Label: typeof Label\n Group: typeof Group\n Item: typeof Item\n Portal: typeof Portal\n Trigger: typeof Trigger\n Value: typeof Value\n}\n\nSelect.Group = Group\nSelect.Separator = Separator\nSelect.Content = Content\nSelect.Item = Item\nSelect.Portal = Portal\nSelect.Trigger = Trigger\nSelect.Value = Value\nSelect.Label = Label\n"],"names":["RadixSelect","RadixGroup","RadixItem","RadixItemText","RadixItemIndicator","RadixPortal","RadixTrigger","RadixSelectIcon","RadixValue","RadixContent","RadixLabel","RadixSeparator"],"mappings":";;;;;;AAIa,MAAA,YAAA,GAAe,OAAOA,IAAW,CAAA;;ACAvC,MAAM,WAAc,GAAA,MAAA,CAAOC,OAAY,EAAA,EAAE,CAAA;;ACIzC,MAAM,KAAQ,GAAA,KAAA,CAAM,UAGzB,CAAA,CAAC,KAAO,EAAA,UAAA,qBAAgB,GAAA,CAAA,WAAA,EAAA,EAAa,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACP7D,MAAM,UAAa,GAAA,MAAA,CAAOC,MAAW,EAAA,EAAE,CAAA;;ACAvC,MAAM,cAAiB,GAAA,MAAA,CAAOC,QAAe,EAAA,EAAE,CAAA;;ACA/C,MAAM,mBAAsB,GAAA,MAAA,CAAOC,aAAoB,EAAA,EAAE,CAAA;;ACwBzD,MAAM,OAAO,KAAM,CAAA,UAAA;AAAA,EACxB,CAAC,EAAE,QAAU,EAAA,GAAG,SAAU,EAAA,EAAG,UAC3B,qBAAA,IAAA,CAAC,UAAY,EAAA,EAAA,GAAG,SAAW,EAAA,GAAA,EAAK,UA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