@indico-data/design-system 2.53.0 → 2.55.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 (92) hide show
  1. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +24 -0
  2. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.d.ts +6 -0
  3. package/lib/components/forms/date/inputDateTimePicker/helpers.d.ts +1 -0
  4. package/lib/components/forms/date/inputDateTimePicker/index.d.ts +1 -0
  5. package/lib/components/forms/subcomponents/DisplayFormError.d.ts +2 -1
  6. package/lib/components/forms/timePicker/TimePicker.d.ts +3 -1
  7. package/lib/components/forms/timePicker/helpers.d.ts +2 -5
  8. package/lib/components/index.d.ts +3 -0
  9. package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +8 -0
  10. package/lib/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +7 -0
  11. package/lib/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.d.ts +1 -0
  12. package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +7 -0
  13. package/lib/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +6 -0
  14. package/lib/components/tooltip/Tooltip.d.ts +13 -0
  15. package/lib/components/tooltip/Tooltip.stories.d.ts +6 -0
  16. package/lib/index.css +149 -90
  17. package/lib/index.d.ts +53 -47
  18. package/lib/index.esm.css +149 -90
  19. package/lib/index.esm.js +5964 -6155
  20. package/lib/index.esm.js.map +1 -1
  21. package/lib/index.js +5962 -6153
  22. package/lib/index.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/components/forms/date/datePicker/DatePicker.stories.tsx +4 -4
  25. package/src/components/forms/date/datePicker/DatePicker.tsx +0 -2
  26. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.mdx +20 -0
  27. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +262 -0
  28. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +141 -0
  29. package/src/components/forms/date/inputDateTimePicker/helpers.ts +3 -0
  30. package/src/components/forms/date/inputDateTimePicker/index.ts +1 -0
  31. package/src/components/forms/input/Input.tsx +1 -1
  32. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +1 -1
  33. package/src/components/forms/subcomponents/DisplayFormError.tsx +7 -2
  34. package/src/components/forms/timePicker/TimePicker.mdx +3 -27
  35. package/src/components/forms/timePicker/TimePicker.stories.tsx +19 -1
  36. package/src/components/forms/timePicker/TimePicker.tsx +37 -80
  37. package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +33 -11
  38. package/src/components/forms/timePicker/helpers.ts +61 -13
  39. package/src/components/index.ts +3 -0
  40. package/src/components/loading-indicators/BarSpinner/BarSpinner.mdx +21 -0
  41. package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +89 -0
  42. package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +25 -0
  43. package/src/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.tsx +16 -0
  44. package/src/{legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.ts → components/loading-indicators/BarSpinner/styles/BarSpinner.scss} +11 -11
  45. package/src/components/loading-indicators/CirclePulse/CirclePulse.mdx +20 -0
  46. package/src/components/loading-indicators/CirclePulse/CirclePulse.scss +83 -0
  47. package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +78 -0
  48. package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +15 -0
  49. package/src/components/tanstackTable/components/TableBody/TableBody.tsx +1 -1
  50. package/src/components/tooltip/Tooltip.mdx +25 -0
  51. package/src/components/tooltip/Tooltip.stories.tsx +113 -0
  52. package/src/components/tooltip/Tooltip.tsx +38 -0
  53. package/src/components/tooltip/styles/Tooltip.scss +8 -0
  54. package/src/index.ts +4 -2
  55. package/src/styles/globals.scss +9 -0
  56. package/src/styles/index.scss +3 -2
  57. package/lib/components/forms/timePicker/constants.d.ts +0 -13
  58. package/lib/legacy/components/Tooltip/Tooltip.d.ts +0 -15
  59. package/lib/legacy/components/Tooltip/Tooltip.stories.d.ts +0 -9
  60. package/lib/legacy/components/Tooltip/Tooltip.styles.d.ts +0 -1
  61. package/lib/legacy/components/index.d.ts +0 -2
  62. package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.d.ts +0 -7
  63. package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +0 -10
  64. package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +0 -1
  65. package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.d.ts +0 -10
  66. package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +0 -12
  67. package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +0 -7
  68. package/lib/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +0 -10
  69. package/lib/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.stories.d.ts +0 -10
  70. package/lib/legacy/components/loading-indicators/CircleSpinner/index.d.ts +0 -1
  71. package/lib/legacy/components/loading-indicators/index.d.ts +0 -3
  72. package/src/components/forms/timePicker/constants.ts +0 -21
  73. package/src/components/forms/timePicker/styles/TimePicker.scss +0 -51
  74. package/src/legacy/components/Tooltip/Tooltip.stories.tsx +0 -107
  75. package/src/legacy/components/Tooltip/Tooltip.styles.ts +0 -64
  76. package/src/legacy/components/Tooltip/Tooltip.tsx +0 -70
  77. package/src/legacy/components/index.ts +0 -2
  78. package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -14
  79. package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.tsx +0 -21
  80. package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -22
  81. package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.ts +0 -77
  82. package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.tsx +0 -57
  83. package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.stories.tsx +0 -16
  84. package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +0 -36
  85. package/src/legacy/components/loading-indicators/CircleSpinner/index.ts +0 -1
  86. package/src/legacy/components/loading-indicators/index.ts +0 -3
  87. /package/lib/{legacy/components → components}/loading-indicators/BarSpinner/index.d.ts +0 -0
  88. /package/lib/{legacy/components → components}/loading-indicators/CirclePulse/index.d.ts +0 -0
  89. /package/lib/{legacy/components/Tooltip → components/tooltip}/index.d.ts +0 -0
  90. /package/src/{legacy/components → components}/loading-indicators/BarSpinner/index.ts +0 -0
  91. /package/src/{legacy/components → components}/loading-indicators/CirclePulse/index.ts +0 -0
  92. /package/src/{legacy/components/Tooltip → components/tooltip}/index.ts +0 -0
@@ -2,7 +2,7 @@ import { flexRender, Table } from '@tanstack/react-table';
2
2
  import { Row } from '@tanstack/react-table';
3
3
  import classNames from 'classnames';
4
4
  import { getTdStyles } from '../../helpers';
5
- import { CirclePulse } from '@/legacy/components/loading-indicators/CirclePulse';
5
+ import { CirclePulse } from '@/components/loading-indicators/CirclePulse';
6
6
  import { Dispatch, SetStateAction } from 'react';
7
7
 
8
8
  export type Props<T> = {
@@ -0,0 +1,25 @@
1
+ import { Canvas, Meta, Controls, Story } from '@storybook/blocks';
2
+ import * as Tooltip from './Tooltip.stories';
3
+
4
+ <Meta title="Utilities/Tooltip" name="Tooltip" of={Tooltip} />
5
+
6
+ # Tooltip
7
+
8
+ The tooltip component is simply a wrapper around react-tooltip(https://www.npmjs.com/package/react-tooltip). It is meant to serve as a package include as well as style wrapper.
9
+
10
+ <Canvas of={Tooltip.Default} />
11
+
12
+ ### The following props are available for the Tooltip component:
13
+
14
+ <Controls of={Tooltip.Default} />
15
+
16
+
17
+ ## Usage
18
+ In the example below, the tooltip is triggered by hovering over the icon. The `data-tooltip-id` attribute is used to match the tooltip to the icon. IDs should be unique when rendering multiple tooltips on the same view.
19
+
20
+ ```tsx
21
+ <Icon icon="info" data-tooltip-id="tooltip-1" />
22
+ <Tooltip id="tooltip-1">
23
+ <div>Tooltip Content</div>
24
+ </Tooltip>
25
+ ```
@@ -0,0 +1,113 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Tooltip } from './Tooltip';
3
+ import { Col, Container, Row } from '../grid';
4
+ import { Button } from '../button';
5
+
6
+ const meta: Meta = {
7
+ title: 'Utilities/Tooltip',
8
+ component: Tooltip,
9
+ argTypes: {
10
+ id: {
11
+ control: false,
12
+ description:
13
+ "The id of the tooltip. This needs to match the element that holds it's data attribute",
14
+ table: {
15
+ category: 'Props',
16
+ type: {
17
+ summary: 'string',
18
+ },
19
+ },
20
+ },
21
+ place: {
22
+ control: 'select',
23
+ description: 'The placement of the tooltip',
24
+ options: ['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom'],
25
+ table: {
26
+ category: 'Props',
27
+ type: {
28
+ summary: 'top | top-start | top-end | right | right-start | right-end | bottom',
29
+ },
30
+ },
31
+ },
32
+ clickToShow: {
33
+ control: 'boolean',
34
+ description: 'Whether the tooltip should be shown on click',
35
+ table: {
36
+ category: 'Props',
37
+ type: {
38
+ summary: 'boolean',
39
+ },
40
+ },
41
+ },
42
+ delayShow: {
43
+ control: 'number',
44
+ description: 'The delay in milliseconds before the tooltip is shown',
45
+ table: {
46
+ category: 'Props',
47
+ type: {
48
+ summary: 'number',
49
+ },
50
+ },
51
+ },
52
+ delayHide: {
53
+ control: 'number',
54
+ description: 'The delay in milliseconds before the tooltip is hidden',
55
+ table: {
56
+ category: 'Props',
57
+ type: {
58
+ summary: 'number',
59
+ },
60
+ },
61
+ },
62
+ zIndex: {
63
+ control: 'number',
64
+ description: 'This is an override for the z-index of the tooltip',
65
+ table: {
66
+ category: 'Props',
67
+ type: {
68
+ summary: 'number',
69
+ },
70
+ },
71
+ },
72
+ children: {
73
+ control: false,
74
+ description: 'The content of the tooltip',
75
+ table: {
76
+ category: 'Props',
77
+ type: {
78
+ summary: 'React.ReactNode',
79
+ },
80
+ },
81
+ },
82
+ },
83
+ };
84
+
85
+ export default meta;
86
+
87
+ type Story = StoryObj<typeof Tooltip>;
88
+
89
+ export const Default: Story = {
90
+ args: {
91
+ place: 'bottom',
92
+ id: 'tooltip-1',
93
+ clickToShow: false,
94
+ delayShow: 0,
95
+ delayHide: 0,
96
+ zIndex: 1000,
97
+ },
98
+
99
+ render: (args) => {
100
+ return (
101
+ <Container>
102
+ <Row>
103
+ <Col sm={4}>
104
+ <Button ariaLabel="Tooltip Button" data-tooltip-id="tooltip-1">
105
+ Tooltip!
106
+ </Button>
107
+ <Tooltip {...args}>Tooltip Content</Tooltip>
108
+ </Col>
109
+ </Row>
110
+ </Container>
111
+ );
112
+ },
113
+ };
@@ -0,0 +1,38 @@
1
+ import { PlacesType, Tooltip as ReactTooltip } from 'react-tooltip';
2
+
3
+ interface TooltipProps {
4
+ id: string;
5
+ clickToShow?: boolean;
6
+ delayShow?: number;
7
+ delayHide?: number;
8
+ children: React.ReactNode;
9
+ zIndex?: number;
10
+ place?: PlacesType;
11
+ [key: string]: any;
12
+ }
13
+
14
+ export const Tooltip = ({
15
+ id,
16
+ clickToShow,
17
+ delayShow,
18
+ delayHide,
19
+ children,
20
+ zIndex = 1000,
21
+ place = 'top',
22
+ ...rest
23
+ }: TooltipProps) => {
24
+ return (
25
+ <ReactTooltip
26
+ border="solid 1px var(--pf-border-color)"
27
+ id={id}
28
+ place={place}
29
+ openOnClick={clickToShow}
30
+ delayShow={delayShow}
31
+ delayHide={delayHide}
32
+ style={{ zIndex }}
33
+ {...rest}
34
+ >
35
+ {children}
36
+ </ReactTooltip>
37
+ );
38
+ };
@@ -0,0 +1,8 @@
1
+ :root [data-theme='light'] {
2
+ --pf-tooltip-background-color: var(--pf-white-color);
3
+ }
4
+
5
+ :root [data-theme='dark'],
6
+ :root {
7
+ --pf-tooltip-background-color: var(--pf-primary-color-900);
8
+ }
package/src/index.ts CHANGED
@@ -4,8 +4,6 @@ import './setup/setupIcons';
4
4
  // This is so consumers of the DS can import floating ui functions/hooks/types from the DS rather than the (peer dependency) floating-ui package
5
5
  export * from '@floating-ui/react-dom';
6
6
 
7
- export { BarSpinner, CirclePulse, CircleSpinner, Tooltip } from './legacy/components';
8
-
9
7
  export { Container, Row, Col } from './components/grid';
10
8
  export { Button } from './components/button';
11
9
  export { Icon } from './components/icons';
@@ -30,6 +28,10 @@ export { Pill } from './components/pill';
30
28
  export { Badge } from './components/badge';
31
29
  export { Modal } from './components/modal';
32
30
  export { TanstackTable } from './components/tanstackTable';
31
+ export { Tooltip } from './components/tooltip';
32
+ export { Pagination } from './components/pagination';
33
+ export { CirclePulse } from './components/loading-indicators/CirclePulse';
34
+ export { BarSpinner } from './components/loading-indicators/BarSpinner/BarSpinner';
33
35
 
34
36
  // Utilities
35
37
  export { registerFontAwesomeIcons } from './setup/setupIcons';
@@ -74,3 +74,12 @@ a,
74
74
  .theme {
75
75
  background-color: var(--pf-background-color);
76
76
  }
77
+
78
+ // Tooltip
79
+ .react-tooltip {
80
+ z-index: 5;
81
+ background-color: var(--pf-tooltip-background-color);
82
+ border: var(--pf-border-sm) solid var(--pf-border-color);
83
+ opacity: 1 !important;
84
+ text-wrap: wrap;
85
+ }
@@ -21,13 +21,14 @@
21
21
  @import '../components/menu/styles/Menu.scss';
22
22
  @import '../components/floatUI/styles/FloatUI.scss';
23
23
  @import '../components/forms/date/datePicker/styles/DatePicker.scss';
24
- @import '../components/forms/timePicker/styles/TimePicker.scss';
25
24
  @import '../components/badge/styles/Badge.scss';
26
25
  @import '../components/modal/styles/Modal.scss';
27
26
  @import '../components/pagination/styles/Pagination.scss';
28
27
  @import '../components/tanstackTable/styles/table.scss';
29
- @import '../components/forms/timePicker/styles/TimePicker.scss';
30
28
  @import '../components/pill/styles/Pill.scss';
29
+ @import '../components/tooltip/styles/Tooltip.scss';
30
+ @import '../components/loading-indicators/BarSpinner/styles/BarSpinner.scss';
31
+ @import '../components/loading-indicators/CirclePulse/CirclePulse.scss';
31
32
  @import 'sheets'; // Port to an sheets component when we build it
32
33
  @import 'typography';
33
34
  @import 'colors';
@@ -1,13 +0,0 @@
1
- declare const hourOptions: {
2
- label: string;
3
- value: string;
4
- }[];
5
- declare const minuteOptions: {
6
- label: string;
7
- value: string;
8
- }[];
9
- declare const periodOptions: {
10
- label: string;
11
- value: string;
12
- }[];
13
- export { hourOptions, minuteOptions, periodOptions };
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { PermafrostComponent } from '../../../types';
3
- type Props = PermafrostComponent & {
4
- questionMark?: boolean;
5
- for?: string | null;
6
- place?: string;
7
- clickToShow?: boolean;
8
- delayShow?: number;
9
- delayHide?: number;
10
- questionMarkClassName?: string;
11
- children: React.ReactNode;
12
- block?: boolean;
13
- };
14
- export declare const Tooltip: (props: Props) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,9 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Tooltip } from './Tooltip';
3
- declare const meta: Meta<typeof Tooltip>;
4
- export default meta;
5
- type Story = StoryObj<typeof Tooltip>;
6
- export declare const Single: Story;
7
- export declare const NoQuestionMark: Story;
8
- export declare const Bottom: Story;
9
- export declare const Right: Story;
@@ -1 +0,0 @@
1
- export declare const StyledTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,2 +0,0 @@
1
- export { BarSpinner, CirclePulse, CircleSpinner } from './loading-indicators';
2
- export { Tooltip } from './Tooltip';
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { PermafrostComponent } from '../../../../types';
3
- type Props = PermafrostComponent & {
4
- width?: string;
5
- };
6
- export declare function BarSpinner(props: Props): React.ReactElement;
7
- export {};
@@ -1,10 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { BarSpinner } from './BarSpinner';
3
- declare const meta: {
4
- component: typeof BarSpinner;
5
- title: string;
6
- argTypes: {};
7
- };
8
- export default meta;
9
- type Story = StoryObj<typeof BarSpinner>;
10
- export declare const Normal: Story;
@@ -1 +0,0 @@
1
- export declare const StyledBarSpinner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { PermafrostComponent } from '../../../../types';
3
- type Props = PermafrostComponent & {
4
- color?: string;
5
- overallSize?: string | number;
6
- rippleSize?: string | number;
7
- showRandomMessage?: boolean;
8
- };
9
- export declare function CirclePulse(props: Props): React.ReactElement;
10
- export {};
@@ -1,12 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { CirclePulse } from './CirclePulse';
3
- declare const meta: {
4
- component: typeof CirclePulse;
5
- title: string;
6
- argTypes: {};
7
- };
8
- export default meta;
9
- type Story = StoryObj<typeof CirclePulse>;
10
- export declare const Normal: Story;
11
- export declare const CustomColor: Story;
12
- export declare const WithRandomMessage: Story;
@@ -1,7 +0,0 @@
1
- export declare const StyledLoadingIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
- overallsize: string;
3
- ripplesize: string;
4
- }>> & string;
5
- export declare const StyledMessageLoadingIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
- overallsize: string;
7
- }>> & string;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { PermafrostComponent, IconSizes } from '../../../../types';
3
- type Props = PermafrostComponent & {
4
- ariaLabel?: string;
5
- size?: IconSizes;
6
- style?: React.CSSProperties;
7
- fill?: string;
8
- };
9
- export declare function CircleSpinner(props: Props): React.ReactElement;
10
- export {};
@@ -1,10 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { CircleSpinner } from './CircleSpinner';
3
- declare const meta: {
4
- component: typeof CircleSpinner;
5
- title: string;
6
- argTypes: {};
7
- };
8
- export default meta;
9
- type Story = StoryObj<typeof CircleSpinner>;
10
- export declare const Normal: Story;
@@ -1 +0,0 @@
1
- export { CircleSpinner } from './CircleSpinner';
@@ -1,3 +0,0 @@
1
- export { CircleSpinner } from './CircleSpinner';
2
- export { BarSpinner } from './BarSpinner';
3
- export { CirclePulse } from './CirclePulse';
@@ -1,21 +0,0 @@
1
- const hourOptions = Array.from({ length: 12 }, (_, i) => {
2
- const num = `${i + 1}`;
3
- return {
4
- label: num,
5
- value: num,
6
- };
7
- });
8
-
9
- const minuteOptions = Array.from({ length: 60 }, (_, i) => {
10
- const num = `${i}`.padStart(2, '0');
11
- return {
12
- label: num,
13
- value: num,
14
- };
15
- });
16
-
17
- const periodOptions = [
18
- { label: 'AM', value: 'am' },
19
- { label: 'PM', value: 'pm' },
20
- ];
21
- export { hourOptions, minuteOptions, periodOptions };
@@ -1,51 +0,0 @@
1
- .time-picker-input {
2
- cursor: pointer;
3
- }
4
- .time-picker-row {
5
- width: 150px;
6
-
7
- .select__value-container {
8
- text-align: center;
9
- cursor: pointer;
10
- }
11
- .select-wrapper {
12
- width: 50px;
13
- .select__items {
14
- justify-content: center;
15
- }
16
- .select__menu {
17
- height: 230px;
18
- padding-bottom: 0;
19
- margin-bottom: 0;
20
- }
21
- }
22
- .select__menu-list {
23
- max-height: 100%;
24
- scrollbar-width: none; /* Firefox */
25
- -ms-overflow-style: none; /* IE and Edge */
26
- &::-webkit-scrollbar {
27
- display: none; /* Chrome, Safari and Opera */
28
- }
29
- overflow-y: scroll;
30
- }
31
-
32
- .hour-menu {
33
- .select__menu {
34
- border-top-right-radius: 0;
35
- border-bottom-right-radius: 0;
36
- }
37
- }
38
- .minute-menu {
39
- .select__menu {
40
- border-radius: 0;
41
- border-right: none;
42
- border-left: none;
43
- }
44
- }
45
- .period-menu {
46
- .select__menu {
47
- border-top-left-radius: 0;
48
- border-bottom-left-radius: 0;
49
- }
50
- }
51
- }
@@ -1,107 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import React from 'react';
3
-
4
- import { Tooltip } from './Tooltip';
5
-
6
- const meta: Meta<typeof Tooltip> = {
7
- component: Tooltip,
8
- tags: ['autodocs'],
9
- title: 'legacy/Tooltip',
10
- args: {},
11
- };
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof Tooltip>;
15
-
16
- function RenderQuestionMark(props: any) {
17
- return (
18
- <div style={{ height: '500px' }}>
19
- <Tooltip for="example-tooltip" {...props}>
20
- This is a paragraph
21
- </Tooltip>
22
-
23
- <p data-tip data-for="example-tooltip">
24
- Hover on text to see tooltip
25
- </p>
26
- </div>
27
- );
28
- }
29
-
30
- function RenderNoQuestionMark(props: any) {
31
- return (
32
- <>
33
- <Tooltip for="example-tooltip">
34
- <p>This is a paragraph</p>
35
- </Tooltip>
36
-
37
- <p
38
- data-tooltip-id="example-tooltip"
39
- data-tooltip-place={props.place}
40
- style={{ display: 'inline-block', marginTop: '100px' }}
41
- >
42
- Hover on text to see tooltip
43
- </p>
44
- </>
45
- );
46
- }
47
-
48
- export const Single: Story = {
49
- args: {
50
- questionMark: true,
51
- for: 'example-tooltip',
52
- place: 'top',
53
- clickToShow: false,
54
- delayHide: 0,
55
- questionMarkClassName: 'question-mark',
56
- children: 'This is a paragraph',
57
- block: false,
58
- },
59
- render: (args) => {
60
- return <RenderQuestionMark {...args} />;
61
- },
62
- };
63
-
64
- export const NoQuestionMark: Story = {
65
- args: {
66
- questionMark: false,
67
- for: 'example-tooltip',
68
- place: 'top',
69
- clickToShow: false,
70
- delayHide: 0,
71
- children: 'This is a paragraph',
72
- block: false,
73
- },
74
- render: (args) => {
75
- return <RenderNoQuestionMark {...args} />;
76
- },
77
- };
78
-
79
- export const Bottom: Story = {
80
- args: {
81
- questionMark: false,
82
- for: 'example-tooltip',
83
- place: 'bottom',
84
- clickToShow: false,
85
- delayHide: 0,
86
- children: 'This is a paragraph',
87
- block: false,
88
- },
89
- render: (args) => {
90
- return <RenderNoQuestionMark {...args} />;
91
- },
92
- };
93
-
94
- export const Right: Story = {
95
- args: {
96
- questionMark: false,
97
- for: 'example-tooltip',
98
- place: 'right',
99
- clickToShow: false,
100
- delayHide: 0,
101
- children: 'This is a paragraph',
102
- block: false,
103
- },
104
- render: (args) => {
105
- return <RenderNoQuestionMark {...args} />;
106
- },
107
- };
@@ -1,64 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- export const StyledTooltip = styled.div`
4
- display: inline-block;
5
-
6
- i:hover {
7
- cursor: pointer;
8
- }
9
-
10
- p {
11
- line-height: 1.4;
12
- font-size: 13px;
13
- }
14
-
15
- .tool {
16
- border-radius: 2px !important;
17
- padding: 8px 11px !important;
18
- opacity: 1 !important;
19
-
20
- &.place-left:after {
21
- border-top: 5px solid transparent !important;
22
- border-bottom: 5px solid transparent !important;
23
- right: -6px !important;
24
- top: 50% !important;
25
- margin-top: -9px !important;
26
- }
27
-
28
- &.place-left:before {
29
- border-left-width: 8px !important;
30
- border-left-style: solid !important;
31
- margin-top: -10px !important;
32
- }
33
-
34
- &.place-right:after {
35
- border-top: 5px solid transparent !important;
36
- border-bottom: 5px solid transparent !important;
37
- left: -6px !important;
38
- top: 50% !important;
39
- margin-top: -9px !important;
40
- }
41
-
42
- &.place-right:before {
43
- border-right-width: 8px !important;
44
- border-right-style: solid !important;
45
- margin-top: -10px !important;
46
- }
47
-
48
- &.place-top:after {
49
- }
50
-
51
- &.place-top:before {
52
- border-top-width: 8px !important;
53
- border-top-style: solid !important;
54
- }
55
-
56
- &.place-bottom:after {
57
- }
58
-
59
- &.place-bottom:before {
60
- border-bottom-width: 8px !important;
61
- border-bottom-style: solid !important;
62
- }
63
- }
64
- `;