react-science 0.29.0 → 0.30.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.
Files changed (77) hide show
  1. package/lib-esm/components/button/Button.d.ts.map +1 -1
  2. package/lib-esm/components/button/Button.js +1 -1
  3. package/lib-esm/components/button/Button.js.map +1 -1
  4. package/lib-esm/components/drop-zone/DropZone.d.ts +6 -2
  5. package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
  6. package/lib-esm/components/drop-zone/DropZone.js +9 -15
  7. package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
  8. package/lib-esm/components/forms/index.d.ts +0 -5
  9. package/lib-esm/components/forms/index.d.ts.map +1 -1
  10. package/lib-esm/components/forms/index.js +0 -5
  11. package/lib-esm/components/forms/index.js.map +1 -1
  12. package/lib-esm/components/forms/radio-group/RadioGroup.d.ts +1 -0
  13. package/lib-esm/components/forms/radio-group/RadioGroup.d.ts.map +1 -1
  14. package/lib-esm/components/forms/radio-group/RadioGroup.js +2 -2
  15. package/lib-esm/components/forms/radio-group/RadioGroup.js.map +1 -1
  16. package/lib-esm/components/forms/styles.d.ts +0 -22
  17. package/lib-esm/components/forms/styles.d.ts.map +1 -1
  18. package/lib-esm/components/forms/styles.js +0 -72
  19. package/lib-esm/components/forms/styles.js.map +1 -1
  20. package/lib-esm/components/index.d.ts +0 -1
  21. package/lib-esm/components/index.d.ts.map +1 -1
  22. package/lib-esm/components/index.js +0 -1
  23. package/lib-esm/components/index.js.map +1 -1
  24. package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -1
  25. package/lib-esm/components/info-panel/InfoPanel.js +4 -3
  26. package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
  27. package/lib-esm/components/toolbar/Toolbar.js +1 -1
  28. package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
  29. package/package.json +2 -1
  30. package/src/components/button/Button.tsx +9 -3
  31. package/src/components/drop-zone/DropZone.tsx +42 -25
  32. package/src/components/forms/index.ts +0 -5
  33. package/src/components/forms/radio-group/RadioGroup.tsx +3 -0
  34. package/src/components/forms/styles.ts +0 -92
  35. package/src/components/index.ts +0 -1
  36. package/src/components/info-panel/InfoPanel.tsx +5 -2
  37. package/src/components/toolbar/Toolbar.tsx +1 -1
  38. package/lib-esm/components/forms/Checkbox.d.ts +0 -11
  39. package/lib-esm/components/forms/Checkbox.d.ts.map +0 -1
  40. package/lib-esm/components/forms/Checkbox.js +0 -35
  41. package/lib-esm/components/forms/Checkbox.js.map +0 -1
  42. package/lib-esm/components/forms/Input.d.ts +0 -19
  43. package/lib-esm/components/forms/Input.d.ts.map +0 -1
  44. package/lib-esm/components/forms/Input.js +0 -60
  45. package/lib-esm/components/forms/Input.js.map +0 -1
  46. package/lib-esm/components/forms/Select.d.ts +0 -21
  47. package/lib-esm/components/forms/Select.d.ts.map +0 -1
  48. package/lib-esm/components/forms/Select.js +0 -90
  49. package/lib-esm/components/forms/Select.js.map +0 -1
  50. package/lib-esm/components/forms/TextArea.d.ts +0 -8
  51. package/lib-esm/components/forms/TextArea.d.ts.map +0 -1
  52. package/lib-esm/components/forms/TextArea.js +0 -19
  53. package/lib-esm/components/forms/TextArea.js.map +0 -1
  54. package/lib-esm/components/forms/context/FieldsContext.d.ts +0 -16
  55. package/lib-esm/components/forms/context/FieldsContext.d.ts.map +0 -1
  56. package/lib-esm/components/forms/context/FieldsContext.js +0 -47
  57. package/lib-esm/components/forms/context/FieldsContext.js.map +0 -1
  58. package/lib-esm/components/forms/context/index.d.ts +0 -2
  59. package/lib-esm/components/forms/context/index.d.ts.map +0 -1
  60. package/lib-esm/components/forms/context/index.js +0 -2
  61. package/lib-esm/components/forms/context/index.js.map +0 -1
  62. package/lib-esm/components/spinner/FullSpinner.d.ts +0 -7
  63. package/lib-esm/components/spinner/FullSpinner.d.ts.map +0 -1
  64. package/lib-esm/components/spinner/FullSpinner.js +0 -24
  65. package/lib-esm/components/spinner/FullSpinner.js.map +0 -1
  66. package/lib-esm/components/spinner/index.d.ts +0 -2
  67. package/lib-esm/components/spinner/index.d.ts.map +0 -1
  68. package/lib-esm/components/spinner/index.js +0 -2
  69. package/lib-esm/components/spinner/index.js.map +0 -1
  70. package/src/components/forms/Checkbox.tsx +0 -77
  71. package/src/components/forms/Input.tsx +0 -144
  72. package/src/components/forms/Select.tsx +0 -197
  73. package/src/components/forms/TextArea.tsx +0 -45
  74. package/src/components/forms/context/FieldsContext.tsx +0 -82
  75. package/src/components/forms/context/index.ts +0 -1
  76. package/src/components/spinner/FullSpinner.tsx +0 -57
  77. package/src/components/spinner/index.ts +0 -1
@@ -21,6 +21,7 @@ export interface RadioGroupProps {
21
21
  name?: string;
22
22
  disabled?: boolean;
23
23
  variant?: InputVariant;
24
+ id?: string;
24
25
  }
25
26
  const rootStyles = {
26
27
  basic: css({
@@ -41,6 +42,7 @@ const rootStyles = {
41
42
  };
42
43
  export function RadioGroup(props: RadioGroupProps) {
43
44
  const {
45
+ id,
44
46
  selected,
45
47
  type = 'classic',
46
48
  disabled: groupDisabled = false,
@@ -51,6 +53,7 @@ export function RadioGroup(props: RadioGroupProps) {
51
53
  } = props;
52
54
  return (
53
55
  <RadioGroupRadix.Root
56
+ id={id}
54
57
  css={[
55
58
  rootStyles.basic,
56
59
  type === 'classic' ? null : rootStyles.button(variant),
@@ -1,96 +1,4 @@
1
- import styled from '@emotion/styled';
2
-
3
1
  export type InputVariant = 'default' | 'small';
4
2
 
5
- interface StyledProps {
6
- variant: InputVariant;
7
- hasLeading?: boolean;
8
- hasTrailing?: boolean;
9
- }
10
3
  export const enabledColor = '#1677ff';
11
4
  export const disabledColor = '#b8b8b8';
12
-
13
- export const LabelStyled = styled.label<StyledProps>`
14
- padding: ${(props) =>
15
- props.variant === 'default'
16
- ? props.hasTrailing
17
- ? '2px 9px 4px 9px'
18
- : '2px 9px'
19
- : props.hasTrailing
20
- ? '1px 7px 1px 7px'
21
- : '1px 7px'};
22
-
23
- font-size: ${(props) => (props.variant === 'small' ? '1em' : '1.125em')};
24
- line-height: '17px';
25
-
26
- background-color: white;
27
- border-width: 1px;
28
- align-items: center;
29
- flex-direction: row;
30
- flex: 1 1 0%;
31
- display: flex;
32
- position: relative;
33
-
34
- border-top-right-radius: ${(props) =>
35
- props.hasLeading && !props.hasTrailing && '0.375rem'};
36
-
37
- border-bottom-right-radius: ${(props) =>
38
- props.hasLeading && !props.hasTrailing && '0.375rem'};
39
-
40
- border-top-left-radius: ${(props) =>
41
- props.hasTrailing && !props.hasLeading && '0.375rem'};
42
-
43
- border-bottom-left-radius: ${(props) =>
44
- props.hasTrailing && !props.hasLeading && '0.375rem'};
45
-
46
- border-radius: ${(props) =>
47
- !props.hasLeading && !props.hasTrailing && '0.375rem'};
48
-
49
- border-color: var(--custom-border-color);
50
- `;
51
-
52
- function getStyleColor(hasError: boolean, hasValid: boolean) {
53
- if (hasError) {
54
- return {
55
- default: '#ffa39e',
56
- hover: '#f95d55',
57
- };
58
- }
59
-
60
- if (hasValid) {
61
- return {
62
- default: '#6adc24',
63
- hover: '#62cb21',
64
- };
65
- }
66
-
67
- return {
68
- default: 'rgb(217, 217, 217)',
69
- hover: '#4096ff',
70
- };
71
- }
72
-
73
- export const GroupStyled = styled.div<{ hasError: boolean; hasValid: boolean }>`
74
- display: flex;
75
- border-radius: 0.375rem;
76
- margin-top: 0.25rem;
77
-
78
- .addon {
79
- color: ${({ hasError }) => hasError && '#f95d55'};
80
- }
81
-
82
- --custom-border-color: ${({ hasError, hasValid }) =>
83
- getStyleColor(hasError, hasValid).default};
84
-
85
- :hover,
86
- :focus-within {
87
- --custom-border-color: ${({ hasError, hasValid }) =>
88
- getStyleColor(hasError, hasValid).hover};
89
- }
90
- `;
91
-
92
- export const InputContainer = styled.div`
93
- display: flex;
94
- flex-direction: column;
95
- gap: 2px;
96
- `;
@@ -10,7 +10,6 @@ export * from './info-panel/index';
10
10
  export * from './layout-manager/index';
11
11
  export * from './modal/index';
12
12
  export * from './root-layout/index';
13
- export * from './spinner/index';
14
13
  export * from './split-pane/index';
15
14
  export * from './table/index';
16
15
  export * from './tabs/index';
@@ -1,4 +1,5 @@
1
1
  /** @jsxImportSource @emotion/react */
2
+ import { InputGroup } from '@blueprintjs/core';
2
3
  import { css } from '@emotion/react';
3
4
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
4
5
  // @ts-ignore
@@ -6,7 +7,7 @@ import { Disclosure } from '@headlessui/react';
6
7
  import { CSSProperties, useState } from 'react';
7
8
  import { FaChevronRight } from 'react-icons/fa';
8
9
 
9
- import { Input, ValueRenderers } from '../index';
10
+ import { ValueRenderers } from '../index';
10
11
  import { Table } from '../table/Table';
11
12
 
12
13
  export interface InfoPanelData {
@@ -89,13 +90,15 @@ export function InfoPanel(props: InfoPanelProps) {
89
90
  return (
90
91
  <div css={style.container}>
91
92
  <div style={titleStyle}>{title}</div>
92
- <Input
93
+ <InputGroup
93
94
  placeholder="search for a parameter ..."
94
95
  value={search}
95
96
  onChange={({ target }) => {
96
97
  if (target.value !== undefined) setSearch(target.value);
97
98
  }}
98
99
  style={inputStyle}
100
+ leftIcon="search"
101
+ type="search"
99
102
  />
100
103
 
101
104
  {data.map(({ description, data }) => {
@@ -115,7 +115,7 @@ Toolbar.Item = function ToolbarItem(props: ToolbarItemProps) {
115
115
  }
116
116
  `}
117
117
  intent={intent}
118
- style={{ position: 'relative', fontSize: '1.25em' }}
118
+ style={{ position: 'relative', fontSize: '1.25em', width: 'auto' }}
119
119
  type="button"
120
120
  active={active}
121
121
  icon={icon}
@@ -1,11 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type CheckedState = boolean | 'indeterminate';
3
- interface CheckboxProps {
4
- checked?: CheckedState;
5
- disabled?: boolean;
6
- label?: ReactNode;
7
- onChange?: (checked: CheckedState) => void;
8
- }
9
- export declare function Checkbox(props: CheckboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
- export {};
11
- //# sourceMappingURL=Checkbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Checkbox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAC;AAErD,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,oDA2D5C"}
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
4
- import * as RadixCheckbox from '@radix-ui/react-checkbox';
5
- import { RxCheck, RxMinus } from 'react-icons/rx/index';
6
- import { disabledColor, enabledColor } from './styles';
7
- export function Checkbox(props) {
8
- const { checked = 'indeterminate', disabled = false, label, onChange, } = props;
9
- return (_jsxs("label", { style: {
10
- display: 'flex',
11
- alignItems: 'center',
12
- fontSize: '1.125em',
13
- }, children: [_jsx(RadixCheckbox.Root, { checked: checked, onCheckedChange: onChange, disabled: disabled, css: css({
14
- width: '16px',
15
- height: '16px',
16
- backgroundColor: disabled
17
- ? 'rgba(0, 0, 0, 0.04)'
18
- : checked
19
- ? enabledColor
20
- : 'white',
21
- borderWidth: '1px',
22
- borderColor: checked && !disabled ? enabledColor : disabledColor,
23
- borderRadius: '4px',
24
- display: 'flex',
25
- alignItems: 'center',
26
- justifyContent: 'center',
27
- cursor: disabled ? 'not-allowed' : 'pointer',
28
- }), children: _jsx(RadixCheckbox.Indicator, { css: css({
29
- color: disabled ? disabledColor : 'white',
30
- }), children: checked === true ? (_jsx(RxCheck, {})) : checked === 'indeterminate' ? (_jsx(RxMinus, {})) : null }) }), _jsx("span", { style: {
31
- paddingInline: '8px',
32
- lineHeight: '16px',
33
- }, children: label })] }));
34
- }
35
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/forms/Checkbox.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAWvD,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,OAAO,GAAG,eAAe,EACzB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,iBACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,SAAS;SACpB,aAED,KAAC,aAAa,CAAC,IAAI,IACjB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,QAAQ,EACzB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,CAAC;oBACP,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,MAAM;oBACd,eAAe,EAAE,QAAQ;wBACvB,CAAC,CAAC,qBAAqB;wBACvB,CAAC,CAAC,OAAO;4BACP,CAAC,CAAC,YAAY;4BACd,CAAC,CAAC,OAAO;oBACb,WAAW,EAAE,KAAK;oBAClB,WAAW,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa;oBAChE,YAAY,EAAE,KAAK;oBACnB,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;oBACxB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;iBAC7C,CAAC,YAEF,KAAC,aAAa,CAAC,SAAS,IACtB,GAAG,EAAE,GAAG,CAAC;wBACP,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO;qBAC1C,CAAC,YAED,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAClB,KAAC,OAAO,KAAG,CACZ,CAAC,CAAC,CAAC,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,CAChC,KAAC,OAAO,KAAG,CACZ,CAAC,CAAC,CAAC,IAAI,GACgB,GACP,EACrB,eACE,KAAK,EAAE;oBACL,aAAa,EAAE,KAAK;oBACpB,UAAU,EAAE,MAAM;iBACnB,YAEA,KAAK,GACD,IACD,CACT,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- import { InputHTMLAttributes, ReactNode } from 'react';
2
- import { InputVariant } from './styles';
3
- import { SubTextProps } from './utils';
4
- interface RenderAddon {
5
- addon: ReactNode;
6
- inline?: boolean;
7
- }
8
- export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, SubTextProps {
9
- variant?: InputVariant;
10
- leadingAddon?: RenderAddon;
11
- trailingAddon?: RenderAddon;
12
- help?: string;
13
- error?: string;
14
- valid?: true | string;
15
- loading?: boolean;
16
- }
17
- export declare function Input(props: InputProps): import("react/jsx-runtime").JSX.Element;
18
- export {};
19
- //# sourceMappingURL=Input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAIL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAW,YAAY,EAAE,MAAM,SAAS,CAAC;AAoDhD,UAAU,WAAW;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UACf,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,YAAY;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CA8DtC"}
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from '@emotion/styled';
3
- import { FullSpinner } from '../index';
4
- import { useFieldsContext } from './context/FieldsContext';
5
- import { InputContainer, GroupStyled, LabelStyled, } from './styles';
6
- import { SubText } from './utils';
7
- const InputStyled = styled.input `
8
- padding: 0;
9
- flex: 1 1 0%;
10
- border: none;
11
- position: relative;
12
- outline: none;
13
- `;
14
- const LeadingAddonStyled = styled.div `
15
- padding-left: 0.75rem;
16
- padding-right: 0.75rem;
17
- border-right-width: 0px;
18
- border-width: 1px;
19
- border-top-left-radius: 0.375rem;
20
- border-bottom-left-radius: 0.375rem;
21
- align-items: center;
22
- display: inline-flex;
23
-
24
- border-right: none;
25
-
26
- border-color: var(--custom-border-color);
27
- `;
28
- const TrailingAddonStyled = styled.div `
29
- padding-left: 0.75rem;
30
- padding-right: 0.75rem;
31
- border-left-width: 0px;
32
- border-width: 1px;
33
- border-top-right-radius: 0.375rem;
34
- border-bottom-right-radius: 0.375rem;
35
- align-items: center;
36
- display: inline-flex;
37
-
38
- border-left: none;
39
-
40
- border-color: var(--custom-border-color);
41
- `;
42
- const LeadingInlineAddonStyled = styled.div `
43
- display: flex;
44
- align-items: center;
45
- padding-right: 0.5rem;
46
- `;
47
- const TrailingInlineAddonStyled = styled.div `
48
- display: flex;
49
- align-items: center;
50
- padding-left: 0.5rem;
51
- `;
52
- export function Input(props) {
53
- const { variant: variantProps, trailingAddon, leadingAddon, help, error, valid, loading, ...otherProps } = props;
54
- const { name, variant: contextVariant } = useFieldsContext();
55
- const hasLeading = (leadingAddon && !leadingAddon.inline) || false;
56
- const hasTrailing = (trailingAddon && !trailingAddon.inline) || false;
57
- const variant = variantProps || contextVariant;
58
- return (_jsxs(InputContainer, { children: [_jsxs(GroupStyled, { hasError: !!error, hasValid: !!valid, children: [leadingAddon && !leadingAddon.inline && (_jsx(LeadingAddonStyled, { children: leadingAddon.addon })), _jsxs(LabelStyled, { variant: variant, hasLeading: hasLeading, hasTrailing: hasTrailing, children: [leadingAddon?.inline && (_jsx(LeadingInlineAddonStyled, { className: "addon", children: leadingAddon.addon })), _jsx(InputStyled, { id: name, name: name, ...otherProps }), trailingAddon?.inline && (_jsx(TrailingInlineAddonStyled, { className: "addon", children: trailingAddon.addon })), loading && (_jsx(TrailingInlineAddonStyled, { style: { height: variant === 'default' ? 20 : 10 }, children: _jsx(FullSpinner, { height: variant === 'default' ? 20 : 10, width: variant === 'default' ? 20 : 10 }) }))] }), trailingAddon && !trailingAddon.inline && (_jsx(TrailingAddonStyled, { children: trailingAddon.addon }))] }), _jsx(SubText, { error: error, help: help, valid: valid })] }));
59
- }
60
- //# sourceMappingURL=Input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,GAEZ,MAAM,UAAU,CAAC;A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AE,MAAM,IAAI,CACvB,KAAC,wBAAwB,IAAC,SAAS,EAAC,OAAO,YACxC,YAAY,CAAC,KAAK,GACM,CAC5B,EACD,KAAC,WAAW,IAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,GAAI,EACpD,aAAa,EAAE,MAAM,IAAI,CACxB,KAAC,yBAAyB,IAAC,SAAS,EAAC,OAAO,YACzC,aAAa,CAAC,KAAK,GACM,CAC7B,EAEA,OAAO,IAAI,CACV,KAAC,yBAAyB,IACxB,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,YAElD,KAAC,WAAW,IACV,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EACvC,KAAK,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GACtC,GACwB,CAC7B,IACW,EAEb,aAAa,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CACzC,KAAC,mBAAmB,cAAE,aAAa,CAAC,KAAK,GAAuB,CACjE,IACW,EAEd,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,IACpC,CAClB,CAAC;AACJ,CAAC"}
@@ -1,21 +0,0 @@
1
- import { ReactNode, CSSProperties } from 'react';
2
- interface Category {
3
- label: ReactNode;
4
- options: Option[];
5
- }
6
- interface Option {
7
- label: ReactNode;
8
- value: string;
9
- disabled?: boolean;
10
- }
11
- export interface SelectProps {
12
- placeholder?: string;
13
- value: string | undefined;
14
- onSelect?: (value: string | undefined) => void;
15
- options: Array<Option[] | Category[]>;
16
- disabled?: boolean;
17
- style?: CSSProperties;
18
- }
19
- export declare function Select(props: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
- export {};
21
- //# sourceMappingURL=Select.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,UAAU,QAAQ;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AACD,UAAU,MAAM;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAkFD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,oDAwFxC"}
@@ -1,90 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import styled from '@emotion/styled';
4
- import * as RadixSelect from '@radix-ui/react-select';
5
- import { SelectGroup } from '@radix-ui/react-select';
6
- import { Fragment } from 'react';
7
- import { FaCheck, FaChevronDown, FaChevronUp } from 'react-icons/fa';
8
- import { Portal } from '../root-layout/Portal';
9
- const SelectRoot = styled.div `
10
- display: inline-flex;
11
- align-items: center;
12
- justify-content: space-between;
13
- background-color: #ffffff;
14
- font-size: 1.125em;
15
- width: 120px;
16
- `;
17
- const SelectTrigger = styled(RadixSelect.Trigger) `
18
- width: 100%;
19
- display: flex;
20
- align-items: center;
21
- justify-content: space-between;
22
- border-radius: 4px;
23
- border: 1px solid rgba(0, 0, 0, 0.15);
24
- padding: 4px 11px;
25
- user-select: none;
26
- font-size: 1.125em;
27
- line-height: 1.125em;
28
-
29
- &[data-disabled] {
30
- color: rgba(0, 0, 0, 0.5);
31
- background-color: #f5f5f5;
32
- }
33
- `;
34
- const SelectContent = styled(RadixSelect.Content) `
35
- width: var(--radix-select-trigger-width);
36
- max-height: var(--radix-select-content-available-height);
37
- `;
38
- const SelectViewport = styled(RadixSelect.Viewport) `
39
- width: var(--radix-select-trigger-width);
40
- border-radius: 4px;
41
- box-sizing: border-box;
42
- border: 1px solid rgba(0, 0, 0, 0.15);
43
- background-color: white;
44
- padding: 5px;
45
- `;
46
- const SelectItem = styled(RadixSelect.Item) `
47
- user-select: none;
48
- font-size: 1.125em;
49
- padding: 4px 11px;
50
- width: 100%;
51
- display: flex;
52
- align-items: center;
53
- justify-content: space-between;
54
-
55
- &:hover {
56
- background-color: #e6f4ff;
57
- }
58
- &[data-disabled] {
59
- color: rgba(0, 0, 0, 0.5);
60
- }
61
- `;
62
- const SelectLabel = styled(RadixSelect.Label) `
63
- color: rgba(0, 0, 0, 0.5);
64
- font-size: 1em;
65
- padding: 4px 11px;
66
- margin-top: 8px;
67
- `;
68
- const SelectItemIndicator = styled(RadixSelect.ItemIndicator) `
69
- right: 0;
70
- width: 25px;
71
- display: inline-flex;
72
- align-items: center;
73
- justify-content: center;
74
- `;
75
- const SelectSeparator = styled(RadixSelect.Separator) `
76
- height: 1px;
77
- width: 100%;
78
- background-color: rgba(0, 0, 0, 0.15);
79
- margin: 5px 0;
80
- `;
81
- export function Select(props) {
82
- const { placeholder, value, onSelect, options, disabled = false, style, } = props;
83
- const selectedLabel = options
84
- .flatMap((group) => group.flatMap((optionOrCategory) => 'options' in optionOrCategory
85
- ? optionOrCategory.options
86
- : [optionOrCategory]))
87
- .find((option) => option.value === value)?.label;
88
- return (_jsx(SelectRoot, { style: { ...style }, children: _jsxs(RadixSelect.Root, { value: value, onValueChange: onSelect, disabled: disabled, children: [_jsxs(SelectTrigger, { children: [_jsx(RadixSelect.Value, { children: _jsxs("span", { children: [selectedLabel || placeholder, "\u00A0"] }) }), _jsx(RadixSelect.Icon, { asChild: true, children: _jsx(FaChevronDown, {}) })] }), _jsx(Portal, { children: _jsxs(SelectContent, { position: "popper", children: [_jsx(RadixSelect.ScrollUpButton, { children: _jsx(FaChevronUp, {}) }), _jsx(SelectViewport, { children: options.map((group, groupIndex) => (_jsxs(Fragment, { children: [group.map((optionOrCategory, optionOrCategoryIndex) => 'options' in optionOrCategory ? (_jsxs(SelectGroup, { children: [_jsx(SelectLabel, { children: optionOrCategory.label }), optionOrCategory.options.map((option) => (_jsxs(SelectItem, { value: option.value, disabled: option.disabled, children: [_jsx(RadixSelect.ItemText, { children: option.label }), _jsx(SelectItemIndicator, { children: _jsx(FaCheck, {}) })] }, option.value)))] }, optionOrCategoryIndex)) : (_jsxs(SelectItem, { value: optionOrCategory.value, disabled: optionOrCategory.disabled, children: [_jsx(RadixSelect.ItemText, { children: optionOrCategory.label }), _jsx(SelectItemIndicator, { children: _jsx(FaCheck, {}) })] }, optionOrCategory.value))), groupIndex < options.length - 1 && _jsx(SelectSeparator, {})] }, groupIndex))) }), _jsx(RadixSelect.ScrollDownButton, {}), _jsx(RadixSelect.Arrow, {})] }) })] }) }));
89
- }
90
- //# sourceMappingURL=Select.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,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AgB,CAAC,QAAQ,aAEnC,KAAC,WAAW,CAAC,QAAQ,cAClB,gBAAgB,CAAC,KAAK,GACF,EACvB,KAAC,mBAAmB,cAClB,KAAC,OAAO,KAAG,GACS,KATjB,gBAAgB,CAAC,KAAK,CAUhB,CACd,CACF,EACA,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,eAAe,KAAG,KAnC1C,UAAU,CAoCd,CACZ,CAAC,GACa,EACjB,KAAC,WAAW,CAAC,gBAAgB,KAAG,EAChC,KAAC,WAAW,CAAC,KAAK,KAAG,IACP,GACT,IACQ,GACR,CACd,CAAC;AACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- import { TextareaHTMLAttributes } from 'react';
2
- import { InputVariant } from './styles';
3
- import { SubTextProps } from './utils';
4
- export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, SubTextProps {
5
- variant?: InputVariant;
6
- }
7
- export declare function TextArea(props: TextAreaProps): import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=TextArea.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../src/components/forms/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,EAIL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAW,YAAY,EAAE,MAAM,SAAS,CAAC;AAUhD,MAAM,WAAW,aACf,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC,EACjD,YAAY;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAkB5C"}
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from '@emotion/styled';
3
- import { useFieldsContext } from './context/FieldsContext';
4
- import { InputContainer, GroupStyled, LabelStyled, } from './styles';
5
- import { SubText } from './utils';
6
- const TextAreaStyled = styled.textarea `
7
- padding: 0;
8
- flex: 1 1 0%;
9
- border: none;
10
- position: relative;
11
- outline: none;
12
- `;
13
- export function TextArea(props) {
14
- const { variant: variantProps, help, error, valid, ...otherProps } = props;
15
- const { name, variant: contextVariant } = useFieldsContext();
16
- const variant = variantProps || contextVariant;
17
- return (_jsxs(InputContainer, { children: [_jsx(GroupStyled, { hasError: !!error, hasValid: !!valid, children: _jsx(LabelStyled, { variant: variant, children: _jsx(TextAreaStyled, { id: name, name: name, ...otherProps }) }) }), _jsx(SubText, { error: error, help: help, valid: valid })] }));
18
- }
19
- //# sourceMappingURL=TextArea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/components/forms/TextArea.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,GAEZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAEhD,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;;;;;;CAMrC,CAAC;AAQF,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE3E,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE7D,MAAM,OAAO,GAAG,YAAY,IAAI,cAAc,CAAC;IAE/C,OAAO,CACL,MAAC,cAAc,eACb,KAAC,WAAW,IAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,YAC/C,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,YAC3B,KAAC,cAAc,IAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,GAAI,GAC5C,GACF,EAEd,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,IACpC,CAClB,CAAC;AACJ,CAAC"}
@@ -1,16 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface FieldContext {
3
- name?: string;
4
- variant: 'default' | 'small';
5
- }
6
- interface FieldProps {
7
- name: string;
8
- label: string;
9
- children: ReactNode;
10
- variant?: 'default' | 'small';
11
- required?: boolean;
12
- }
13
- export declare function useFieldsContext(): FieldContext;
14
- export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
15
- export {};
16
- //# sourceMappingURL=FieldsContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldsContext.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/context/FieldsContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEtE,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAoCD,wBAAgB,gBAAgB,IAAI,YAAY,CAQ/C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqBtC"}
@@ -1,47 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from '@emotion/styled';
3
- import { createContext, useContext, useMemo } from 'react';
4
- const context = createContext(null);
5
- const FieldContextRoot = styled.div `
6
- display: flex;
7
- flex-flow: row;
8
- min-width: 0;
9
- margin: 0;
10
- padding: 0;
11
- gap: 5px;
12
- `;
13
- const Label = styled.label `
14
- position: relative;
15
- display: inline-flex;
16
- max-width: 100%;
17
- line-height: ${(props) => (props.variant === 'small' ? '28px' : '32px')};
18
- font-size: ${(props) => (props.variant === 'small' ? '1em' : '1.125em')};
19
- white-space: nowrap;
20
- text-align: end;
21
- `;
22
- const LabelContainer = styled.div `
23
- flex-grow: 0;
24
- display: inline-block;
25
- overflow: hidden;
26
- text-align: end;
27
- vertical-align: middle;
28
- white-space: nowrap;
29
- `;
30
- const FieldContextRequired = styled.span `
31
- color: red;
32
- `;
33
- export function useFieldsContext() {
34
- const ctx = useContext(context);
35
- if (!ctx) {
36
- return { name: undefined, variant: 'default' };
37
- }
38
- return ctx;
39
- }
40
- export function Field(props) {
41
- const { label, name, children, required, variant } = props;
42
- const memoized = useMemo(() => {
43
- return { name, variant: variant || 'default' };
44
- }, [name, variant]);
45
- return (_jsx(context.Provider, { value: memoized, children: _jsxs(FieldContextRoot, { children: [_jsx(LabelContainer, { children: _jsxs(Label, { htmlFor: name, variant: memoized.variant, children: [label, " ", required && _jsx(FieldContextRequired, { children: "*" }), ":", ' '] }) }), children] }) }));
46
- }
47
- //# sourceMappingURL=FieldsContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldsContext.js","sourceRoot":"","sources":["../../../../src/components/forms/context/FieldsContext.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAetE,MAAM,OAAO,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAC;AAEzD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOlC,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAoC;;;;iBAI7C,CAAC,KAAK,E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CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './FieldsContext';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './FieldsContext';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/forms/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -1,7 +0,0 @@
1
- interface FullSpinnerProps {
2
- width?: number;
3
- height?: number;
4
- }
5
- export declare function FullSpinner(props: FullSpinnerProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
7
- //# sourceMappingURL=FullSpinner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FullSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":"AASA,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAoClD"}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { keyframes } from '@emotion/react';
3
- import styled from '@emotion/styled';
4
- const spin = keyframes `
5
- 100% {
6
- transform: rotate(360deg);
7
- }
8
- `;
9
- const Spinner = styled.svg `
10
- height: ${({ height }) => `${height || 40}px`};
11
- width: ${({ width }) => `${width || 40}px`};
12
- animation: ${spin} 0.8s linear infinite;
13
- `;
14
- export function FullSpinner(props) {
15
- // First div is used when using nextjs/dynamic even after component is loaded
16
- return (_jsx("div", { style: { height: '100%' }, children: _jsx("div", { style: {
17
- display: 'flex',
18
- height: '100%',
19
- width: '100%',
20
- alignItems: 'center',
21
- justifyContent: 'center',
22
- }, children: _jsxs(Spinner, { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }) }));
23
- }
24
- //# sourceMappingURL=FullSpinner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FullSpinner.js","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,SAAS,CAAA;;;;CAIrB,CAAC;AAOF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAkB;YAChC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,EAAE,IAAI;WACpC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,EAAE,IAAI;eAC7B,IAAI;CAClB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,6EAA6E;IAC7E,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC5B,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,QAAQ;aACzB,YAED,MAAC,OAAO,OACF,KAAK,EACT,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,aAEnB,iBACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,GACf,EACF,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iHAAiH,GACnH,IACM,GACN,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './FullSpinner';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './FullSpinner';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}