mimir-ui-kit 1.16.0 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._accordion_18wwx_2{padding-bottom:var(--accordion-space);border-bottom:1px solid var(--black-20)}._accordion_18wwx_2 svg path{fill:var(--white)}._header_18wwx_10{display:flex;gap:var(--space-m);align-items:flex-start;justify-content:space-between;width:100%;font-weight:var(--font-weight-text-medium);font-family:var(--font-montserrat);text-align:left;border:none;cursor:pointer}._title_18wwx_23{font-size:var(--accordion-text-size)}._title-uppercase_18wwx_26{text-transform:uppercase}._icon_18wwx_30{transition:transform .3s ease-in-out}._icon-container_18wwx_33{display:flex;align-items:center;justify-content:center;min-width:var(--accordion-icon-width);min-height:var(--accordion-icon-height);background-color:var(--black-80);border-radius:50%;transition:background-color .3s ease-in-out}._panel_18wwx_44{margin-top:var(--accordion-panel-space)}._open_18wwx_48{background-color:var(--sapphire-100)}._open_18wwx_48 svg{transform:rotate(-180deg)}._m_18wwx_55{--accordion-space: var(--space-xl);--accordion-text-size: var(--size-text-xl2);--accordion-icon-width: var(--accordion-icon-size-m);--accordion-icon-height: var(--accordion-icon-size-m);--accordion-panel-space: var(--space-xl)}._s_18wwx_63{--accordion-space: var(--space-m);--accordion-text-size: var(--size-text-l);--accordion-icon-width: var(--accordion-icon-size-s);--accordion-icon-height: var(--accordion-icon-size-s);--accordion-panel-space: var(--space-m)}
1
+ ._accordion_11o2x_2{padding-bottom:var(--accordion-space);border-bottom:1px solid var(--black-20)}._accordion_11o2x_2 svg path{fill:var(--white)}._accordion_11o2x_2._is-link_11o2x_9{border:none}._header_11o2x_13{display:flex;gap:var(--space-m);align-items:flex-start;justify-content:space-between;width:100%;font-weight:var(--font-weight-text-medium);font-family:var(--font-montserrat);text-align:left;border:none;cursor:pointer}._title_11o2x_26{font-size:var(--accordion-text-size)}._title-uppercase_11o2x_29{text-transform:uppercase}._icon_11o2x_33{transition:transform .3s ease-in-out}._icon-container_11o2x_36{display:flex;align-items:center;justify-content:center;min-width:var(--accordion-icon-width);min-height:var(--accordion-icon-height);background-color:var(--black-80);border-radius:50%;transition:background-color .3s ease-in-out}._panel_11o2x_47{margin-top:var(--accordion-panel-space)}._panel_11o2x_47._is-link_11o2x_9{margin-top:var(--space-xs)}._open_11o2x_54{background-color:var(--sapphire-100)}._open_11o2x_54 svg{transform:rotate(-180deg)}._link-open_11o2x_61{transform:rotate(-180deg)}._m_11o2x_65{--accordion-space: var(--space-xl);--accordion-text-size: var(--size-text-xl2);--accordion-icon-width: var(--accordion-icon-size-m);--accordion-icon-height: var(--accordion-icon-size-m);--accordion-panel-space: var(--space-xl)}._s_11o2x_73{--accordion-space: var(--space-m);--accordion-text-size: var(--size-text-l);--accordion-icon-width: var(--accordion-icon-size-s);--accordion-icon-height: var(--accordion-icon-size-s);--accordion-panel-space: var(--space-m)}
@@ -0,0 +1 @@
1
+ ._link_12t08_2{--link-color: var(--dark-text);display:inline-flex;align-items:center;color:var(--link-color);font-size:var(--link-font-size);font-family:var(--font-inter);line-height:var(--link-line-height);-moz-column-gap:var(--link-gap);column-gap:var(--link-gap);transition:all .15s ease}._link_12t08_2:hover{--link-color: var(--sapphire-hover)}._link_12t08_2:active{--link-color: var(--sapphire-active)}._link_12t08_2._sample_12t08_19:hover{-webkit-text-decoration:underline var(--link-color);text-decoration:underline var(--link-color);text-underline-offset:4px}._link_12t08_2._anchor_12t08_23:hover{-webkit-text-decoration:underline dashed var(--link-color);text-decoration:underline dashed var(--link-color);text-underline-offset:4px}._link_12t08_2._disabled_12t08_27{--link-color: var(--disabled);-webkit-text-decoration:none;text-decoration:none}._link_12t08_2._disabled_12t08_27:hover,._link_12t08_2._disabled_12t08_27:active{-webkit-text-decoration:none;text-decoration:none;--link-color: var(--disabled)}._link_12t08_2 ._icon_12t08_35{color:currentcolor;fill:currentcolor}._link_12t08_2 ._icon_12t08_35 path{color:currentcolor;fill:currentcolor}._xs_12t08_44{--link-font-size: var(--size-text-s);--link-line-height: var(--size-text-s);--link-gap: var(--space-2xs)}._s_12t08_19{--link-font-size: var(--size-text-m);--link-line-height: var(--size-text-s);--link-gap: var(--space-2xs)}._m_12t08_56{--link-font-size: var(--size-text-l);--link-line-height: var(--size-text-s);--link-gap: var(--space-2xs)}._l_12t08_2{--link-font-size: var(--size-text-l2);--link-line-height: var(--size-text-s);--link-gap: var(--space-xs)}
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
- import { EAccordionSize } from './constants';
2
+ import { EAccordionButtonType, EAccordionSize } from './constants';
3
3
 
4
4
  export type TAccordionProps = {
5
5
  title: string;
6
6
  children: ReactNode;
7
7
  size?: EAccordionSize;
8
8
  titleUppercase?: boolean;
9
+ buttonType?: EAccordionButtonType | `${EAccordionButtonType}`;
9
10
  };
10
11
  export declare const Accordion: import('react').ForwardRefExoticComponent<TAccordionProps & import('react').RefAttributes<HTMLElement>>;
@@ -2,8 +2,11 @@ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
3
  import React__default, { createContext, useRef, Fragment, useReducer, useMemo, useId, useEffect, useContext, forwardRef } from "react";
4
4
  import { AccordionItem } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionSize, EAccordionIconSize } from "./constants.js";
5
+ import { EAccordionButtonType, EAccordionSize, EAccordionButtonIconSize, EAccordionLinkIconSize } from "./constants.js";
6
+ import { useMediaQuery } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
+ import { EMediaQuery } from "../../hooks/useMediaQuery/constants.js";
6
8
  import { Icon } from "../../icons/Icon.js";
9
+ import { Link } from "../AnchorLink/AnchorLink.js";
7
10
  import { M as M$1, W, y, T, o, a as u$1, H as H$1, I, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D, u as u$3, c as o$1 } from "../../keyboard-B256ZoM-.js";
8
11
  import { w } from "../../use-active-press-B6yeSopF.js";
9
12
  import { T as T$1 } from "../../use-resolve-button-type-B6LE6gU3.js";
@@ -116,58 +119,96 @@ function Re(e2, n) {
116
119
  return React__default.createElement(s$1, null, React__default.createElement(H.Provider, { value: t2.panelId }, H$1({ mergeRefs: f, ourProps: g, theirProps: d, slot: D2, defaultTag: Se, features: be, visible: p, name: "Disclosure.Panel" })));
117
120
  }
118
121
  let Ae = W(me), Ce = W(ge), Ie = W(Re), We = Object.assign(Ae, { Button: Ce, Panel: Ie });
119
- const accordion = "_accordion_18wwx_2";
120
- const header = "_header_18wwx_10";
121
- const title = "_title_18wwx_23";
122
- const icon = "_icon_18wwx_30";
123
- const panel = "_panel_18wwx_44";
124
- const open = "_open_18wwx_48";
125
- const m = "_m_18wwx_55";
126
- const s = "_s_18wwx_63";
122
+ const accordion = "_accordion_11o2x_2";
123
+ const header = "_header_11o2x_13";
124
+ const title = "_title_11o2x_26";
125
+ const icon = "_icon_11o2x_33";
126
+ const panel = "_panel_11o2x_47";
127
+ const open = "_open_11o2x_54";
128
+ const m = "_m_11o2x_65";
129
+ const s = "_s_11o2x_73";
127
130
  const cls = {
128
131
  accordion,
132
+ "is-link": "_is-link_11o2x_9",
129
133
  header,
130
134
  title,
131
- "title-uppercase": "_title-uppercase_18wwx_26",
135
+ "title-uppercase": "_title-uppercase_11o2x_29",
132
136
  icon,
133
- "icon-container": "_icon-container_18wwx_33",
137
+ "icon-container": "_icon-container_11o2x_36",
134
138
  panel,
135
139
  open,
140
+ "link-open": "_link-open_11o2x_61",
136
141
  m,
137
142
  s
138
143
  };
139
144
  const Accordion = forwardRef(
140
- ({ title: title2, children, size = EAccordionSize.M, titleUppercase }, ref) => {
141
- return /* @__PURE__ */ jsx("div", { className: classNames(cls.accordion, cls[size]), children: /* @__PURE__ */ jsx(We, { ref, children: ({ open: open2 }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
142
- /* @__PURE__ */ jsxs(Ce, { className: cls.header, children: [
143
- /* @__PURE__ */ jsx(
144
- "span",
145
- {
146
- className: classNames(
147
- cls.title,
148
- titleUppercase && cls["title-uppercase"]
149
- ),
150
- children: title2
151
- }
152
- ),
153
- /* @__PURE__ */ jsx(
154
- "div",
155
- {
156
- className: classNames(
157
- cls["icon-container"],
158
- open2 && cls.open
145
+ ({
146
+ title: title2,
147
+ buttonType = EAccordionButtonType.BUTTON,
148
+ children,
149
+ size = EAccordionSize.M,
150
+ titleUppercase
151
+ }, ref) => {
152
+ const isMobile = useMediaQuery(EMediaQuery.XS1);
153
+ const isLink = buttonType === "link";
154
+ const linkClasses = {
155
+ [cls["is-link"]]: isLink
156
+ };
157
+ const renderButton = (open2) => {
158
+ const buttonIcon = size === EAccordionSize.S ? EAccordionButtonIconSize.S : EAccordionButtonIconSize.M;
159
+ const linkIcon = size === EAccordionSize.S ? EAccordionLinkIconSize.S : EAccordionLinkIconSize.M;
160
+ switch (buttonType) {
161
+ case EAccordionButtonType.LINK: {
162
+ return /* @__PURE__ */ jsx(
163
+ Link,
164
+ {
165
+ size: isMobile ? "s" : "l",
166
+ rightIcon: {
167
+ iconName: linkIcon,
168
+ className: classNames({
169
+ [cls["link-open"]]: open2
170
+ })
171
+ },
172
+ children: title2
173
+ }
174
+ );
175
+ }
176
+ case EAccordionButtonType.BUTTON: {
177
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
178
+ /* @__PURE__ */ jsx(
179
+ "span",
180
+ {
181
+ className: classNames(
182
+ cls.title,
183
+ titleUppercase && cls["title-uppercase"]
184
+ ),
185
+ children: title2
186
+ }
159
187
  ),
160
- children: /* @__PURE__ */ jsx(
161
- Icon,
188
+ /* @__PURE__ */ jsx(
189
+ "div",
162
190
  {
163
- iconName: size === EAccordionSize.S ? EAccordionIconSize.S : EAccordionIconSize.M,
164
- className: cls.icon
191
+ className: classNames(cls["icon-container"], open2 && cls.open),
192
+ children: /* @__PURE__ */ jsx(Icon, { iconName: buttonIcon, className: cls.icon })
165
193
  }
166
194
  )
167
- }
168
- )
169
- ] }),
170
- /* @__PURE__ */ jsx(Ie, { className: cls.panel, children: /* @__PURE__ */ jsx(AccordionItem, { size, children }) })
195
+ ] });
196
+ }
197
+ default: {
198
+ return null;
199
+ }
200
+ }
201
+ };
202
+ return /* @__PURE__ */ jsx("div", { className: classNames(cls.accordion, cls[size], linkClasses), children: /* @__PURE__ */ jsx(We, { ref, children: ({ open: open2 }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
203
+ /* @__PURE__ */ jsx(
204
+ Ce,
205
+ {
206
+ as: isLink ? Fragment : EAccordionButtonType.BUTTON,
207
+ className: isLink ? "" : cls.header,
208
+ children: renderButton(open2)
209
+ }
210
+ ),
211
+ /* @__PURE__ */ jsx(Ie, { className: classNames(cls.panel, linkClasses), children: /* @__PURE__ */ jsx(AccordionItem, { size, children }) })
171
212
  ] }) }) });
172
213
  }
173
214
  );
@@ -2,7 +2,15 @@ export declare enum EAccordionSize {
2
2
  M = "m",
3
3
  S = "s"
4
4
  }
5
- export declare enum EAccordionIconSize {
5
+ export declare enum EAccordionButtonType {
6
+ BUTTON = "button",
7
+ LINK = "link"
8
+ }
9
+ export declare enum EAccordionButtonIconSize {
6
10
  M = "ArrowDown24px",
7
11
  S = "ArrowDown16px"
8
12
  }
13
+ export declare enum EAccordionLinkIconSize {
14
+ M = "DropdownArrowDown24px",
15
+ S = "DropdownArrowBottom16px"
16
+ }
@@ -3,12 +3,24 @@ var EAccordionSize = /* @__PURE__ */ ((EAccordionSize2) => {
3
3
  EAccordionSize2["S"] = "s";
4
4
  return EAccordionSize2;
5
5
  })(EAccordionSize || {});
6
- var EAccordionIconSize = /* @__PURE__ */ ((EAccordionIconSize2) => {
7
- EAccordionIconSize2["M"] = "ArrowDown24px";
8
- EAccordionIconSize2["S"] = "ArrowDown16px";
9
- return EAccordionIconSize2;
10
- })(EAccordionIconSize || {});
6
+ var EAccordionButtonType = /* @__PURE__ */ ((EAccordionButtonType2) => {
7
+ EAccordionButtonType2["BUTTON"] = "button";
8
+ EAccordionButtonType2["LINK"] = "link";
9
+ return EAccordionButtonType2;
10
+ })(EAccordionButtonType || {});
11
+ var EAccordionButtonIconSize = /* @__PURE__ */ ((EAccordionButtonIconSize2) => {
12
+ EAccordionButtonIconSize2["M"] = "ArrowDown24px";
13
+ EAccordionButtonIconSize2["S"] = "ArrowDown16px";
14
+ return EAccordionButtonIconSize2;
15
+ })(EAccordionButtonIconSize || {});
16
+ var EAccordionLinkIconSize = /* @__PURE__ */ ((EAccordionLinkIconSize2) => {
17
+ EAccordionLinkIconSize2["M"] = "DropdownArrowDown24px";
18
+ EAccordionLinkIconSize2["S"] = "DropdownArrowBottom16px";
19
+ return EAccordionLinkIconSize2;
20
+ })(EAccordionLinkIconSize || {});
11
21
  export {
12
- EAccordionIconSize,
22
+ EAccordionButtonIconSize,
23
+ EAccordionButtonType,
24
+ EAccordionLinkIconSize,
13
25
  EAccordionSize
14
26
  };
@@ -0,0 +1,13 @@
1
+ import { ComponentProps } from 'react';
2
+ import { ELinkSize, ELinkVariant } from './constants';
3
+ import { TIconProps } from '../../icons';
4
+
5
+ type TProps = ComponentProps<'button'> & {
6
+ variant?: ELinkVariant | `${ELinkVariant}`;
7
+ size?: ELinkSize | `${ELinkSize}`;
8
+ leftIcon?: TIconProps;
9
+ rightIcon?: TIconProps;
10
+ disabled?: boolean;
11
+ };
12
+ export declare const Link: import('react').ForwardRefExoticComponent<Omit<TProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
13
+ export {};
@@ -0,0 +1,69 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { c as classNames } from "../../index-CweZ_OcN.js";
3
+ import { forwardRef } from "react";
4
+ import { ELinkSize, ELinkVariant } from "./constants.js";
5
+ import { Icon } from "../../icons/Icon.js";
6
+ import '../../assets/AnchorLink.css';const link = "_link_12t08_2";
7
+ const sample = "_sample_12t08_19";
8
+ const anchor = "_anchor_12t08_23";
9
+ const disabled = "_disabled_12t08_27";
10
+ const icon = "_icon_12t08_35";
11
+ const xs = "_xs_12t08_44";
12
+ const s = "_s_12t08_19";
13
+ const m = "_m_12t08_56";
14
+ const l = "_l_12t08_2";
15
+ const cls = {
16
+ link,
17
+ sample,
18
+ anchor,
19
+ disabled,
20
+ icon,
21
+ xs,
22
+ s,
23
+ m,
24
+ l
25
+ };
26
+ const Link = forwardRef(
27
+ ({
28
+ leftIcon,
29
+ className,
30
+ size = ELinkSize.L,
31
+ variant = ELinkVariant.ANCHOR,
32
+ rightIcon,
33
+ disabled: disabled2,
34
+ ...props
35
+ }, ref) => {
36
+ return /* @__PURE__ */ jsxs(
37
+ "button",
38
+ {
39
+ ref,
40
+ type: "button",
41
+ disabled: disabled2,
42
+ className: classNames(cls.link, className, cls[variant], cls[size], {
43
+ [cls.disabled]: disabled2
44
+ }),
45
+ ...props,
46
+ children: [
47
+ leftIcon && /* @__PURE__ */ jsx(
48
+ Icon,
49
+ {
50
+ ...leftIcon,
51
+ className: classNames(cls.icon, leftIcon.className)
52
+ }
53
+ ),
54
+ props.children,
55
+ rightIcon && /* @__PURE__ */ jsx(
56
+ Icon,
57
+ {
58
+ ...rightIcon,
59
+ className: classNames(cls.icon, rightIcon.className)
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ );
67
+ export {
68
+ Link
69
+ };
@@ -0,0 +1,10 @@
1
+ export declare enum ELinkSize {
2
+ XS = "xs",
3
+ S = "s",
4
+ M = "m",
5
+ L = "l"
6
+ }
7
+ export declare enum ELinkVariant {
8
+ SAMPLE = "sample",
9
+ ANCHOR = "anchor"
10
+ }
@@ -0,0 +1,16 @@
1
+ var ELinkSize = /* @__PURE__ */ ((ELinkSize2) => {
2
+ ELinkSize2["XS"] = "xs";
3
+ ELinkSize2["S"] = "s";
4
+ ELinkSize2["M"] = "m";
5
+ ELinkSize2["L"] = "l";
6
+ return ELinkSize2;
7
+ })(ELinkSize || {});
8
+ var ELinkVariant = /* @__PURE__ */ ((ELinkVariant2) => {
9
+ ELinkVariant2["SAMPLE"] = "sample";
10
+ ELinkVariant2["ANCHOR"] = "anchor";
11
+ return ELinkVariant2;
12
+ })(ELinkVariant || {});
13
+ export {
14
+ ELinkSize,
15
+ ELinkVariant
16
+ };
@@ -0,0 +1,2 @@
1
+ export { Link } from './AnchorLink';
2
+ export { ELinkSize, ELinkVariant } from './constants';
@@ -0,0 +1,7 @@
1
+ import { Link } from "./AnchorLink.js";
2
+ import { ELinkSize, ELinkVariant } from "./constants.js";
3
+ export {
4
+ ELinkSize,
5
+ ELinkVariant,
6
+ Link
7
+ };
@@ -37,3 +37,4 @@ export { UploaderPhotos } from './UploaderPhotos';
37
37
  export type { TUploaderPhotos, TOnChangePhotosUpdate } from './UploaderPhotos';
38
38
  export { Uploader } from './Uploader';
39
39
  export type { TUploadValue, TFileItem } from './Uploader';
40
+ export { ELinkSize, ELinkVariant, Link } from './AnchorLink';
@@ -37,6 +37,8 @@ import { useToast } from "./Toasts/hooks.js";
37
37
  import { EToastPosition, EToastVariant } from "./Toasts/constants.js";
38
38
  import { UploaderPhotos } from "./UploaderPhotos/UploaderPhotos.js";
39
39
  import { Uploader } from "./Uploader/Uploader.js";
40
+ import { Link } from "./AnchorLink/AnchorLink.js";
41
+ import { ELinkSize, ELinkVariant } from "./AnchorLink/constants.js";
40
42
  export {
41
43
  Accordion,
42
44
  AccordionItem,
@@ -52,6 +54,8 @@ export {
52
54
  EDrawerPosition,
53
55
  EInputSize,
54
56
  EInputVariant,
57
+ ELinkSize,
58
+ ELinkVariant,
55
59
  EMergedButtonVariantRound,
56
60
  ESelectSearchSize,
57
61
  EStepsPrimaryColor,
@@ -67,6 +71,7 @@ export {
67
71
  I as Input,
68
72
  InputPassword,
69
73
  InputPhoneNumber,
74
+ Link,
70
75
  Loader,
71
76
  MergedButton,
72
77
  OtpInput,
@@ -1,8 +1,7 @@
1
1
  import { SVGProps } from 'react';
2
2
  import { TIcon } from './components/types';
3
3
 
4
- type TProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {
4
+ export type TProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {
5
5
  iconName: TIcon;
6
6
  };
7
7
  export declare const Icon: ({ iconName, ...props }: TProps) => import("react/jsx-runtime").JSX.Element | null;
8
- export {};
@@ -1,2 +1,2 @@
1
- export { Icon } from './Icon';
1
+ export { Icon, type TProps as TIconProps } from './Icon';
2
2
  export type { TIcon } from './components/types';
package/dist/index.js CHANGED
@@ -37,6 +37,8 @@ import { useToast } from "./components/Toasts/hooks.js";
37
37
  import { EToastPosition, EToastVariant } from "./components/Toasts/constants.js";
38
38
  import { UploaderPhotos } from "./components/UploaderPhotos/UploaderPhotos.js";
39
39
  import { Uploader } from "./components/Uploader/Uploader.js";
40
+ import { Link } from "./components/AnchorLink/AnchorLink.js";
41
+ import { ELinkSize, ELinkVariant } from "./components/AnchorLink/constants.js";
40
42
  import { useMediaQuery } from "./hooks/useMediaQuery/useMediaQuery.js";
41
43
  import { EMediaQuery, EMinMediaQuery } from "./hooks/useMediaQuery/constants.js";
42
44
  import { useLockBodyScroll } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
@@ -61,6 +63,8 @@ import './assets/index.css';export {
61
63
  EDrawerPosition,
62
64
  EInputSize,
63
65
  EInputVariant,
66
+ ELinkSize,
67
+ ELinkVariant,
64
68
  EMediaQuery,
65
69
  EMergedButtonVariantRound,
66
70
  EMinMediaQuery,
@@ -79,6 +83,7 @@ import './assets/index.css';export {
79
83
  I as Input,
80
84
  InputPassword,
81
85
  InputPhoneNumber,
86
+ Link,
82
87
  Loader,
83
88
  MergedButton,
84
89
  OtpInput,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.16.0",
4
+ "version": "1.17.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {