@react5/ui 1.0.27 → 1.0.28

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 (186) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/package.json +38 -38
  4. package/packages/app/README.md +50 -50
  5. package/packages/app/eslint.config.js +28 -28
  6. package/packages/app/index.html +13 -13
  7. package/packages/app/jest.config.js +12 -12
  8. package/packages/app/package.json +36 -36
  9. package/packages/app/src/App.css +5 -5
  10. package/packages/app/src/App.tsx +35 -35
  11. package/packages/app/src/i18n/config.ts +21 -21
  12. package/packages/app/src/i18n/en/translation.json +4 -4
  13. package/packages/app/src/i18n/fr/translation.json +4 -4
  14. package/packages/app/src/i18n/index.ts +3 -3
  15. package/packages/app/src/main.tsx +16 -16
  16. package/packages/app/src/styles/1-reset.scss +72 -72
  17. package/packages/app/src/styles/2-colors.scss +11 -11
  18. package/packages/app/src/vite-env.d.ts +1 -1
  19. package/packages/app/tsconfig.app.json +26 -26
  20. package/packages/app/tsconfig.json +7 -7
  21. package/packages/app/tsconfig.node.json +24 -24
  22. package/packages/app/vite.config.ts +7 -7
  23. package/packages/lib/.babelrc +9 -9
  24. package/packages/lib/.storybook/main.js +50 -50
  25. package/packages/lib/.storybook/preview.js +13 -13
  26. package/packages/lib/declaration.d.ts +9 -9
  27. package/packages/lib/dist/esm/index.esm.js +1 -1
  28. package/packages/lib/dist/esm/index.esm.js.map +1 -1
  29. package/packages/lib/dist/esm/index.esm.scss +1401 -1401
  30. package/packages/lib/dist/index.js +1 -1
  31. package/packages/lib/dist/index.js.map +1 -1
  32. package/packages/lib/dist/index.scss +1401 -1401
  33. package/packages/lib/jest.config.js +19 -19
  34. package/packages/lib/package.json +100 -102
  35. package/packages/lib/plop/component/index.js +43 -43
  36. package/packages/lib/plop/index.js +3 -3
  37. package/packages/lib/plop/templates/component/component.hbs +19 -19
  38. package/packages/lib/plop/templates/component/index.hbs +1 -1
  39. package/packages/lib/plop/templates/component/stories.hbs +17 -17
  40. package/packages/lib/plop/templates/component/style.hbs +1 -1
  41. package/packages/lib/plop/templates/component/test.hbs +11 -11
  42. package/packages/lib/plopfile.js +1 -1
  43. package/packages/lib/rollup.config.mjs +64 -64
  44. package/packages/lib/src/components/Accordion/Accordion.scss +67 -67
  45. package/packages/lib/src/components/Accordion/Accordion.tsx +36 -36
  46. package/packages/lib/src/components/Button/Button.scss +60 -60
  47. package/packages/lib/src/components/Button/Button.stories.tsx +26 -26
  48. package/packages/lib/src/components/Button/Button.tsx +40 -40
  49. package/packages/lib/src/components/Button/index.tsx +1 -1
  50. package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.scss +3 -3
  51. package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.stories.tsx +17 -17
  52. package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.test.tsx +11 -11
  53. package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.tsx +17 -17
  54. package/packages/lib/src/components/ButtonsGroup/index.tsx +1 -1
  55. package/packages/lib/src/components/CheckBox/CheckBox.scss +63 -63
  56. package/packages/lib/src/components/CheckBox/CheckBox.stories.tsx +22 -22
  57. package/packages/lib/src/components/CheckBox/CheckBox.tsx +42 -42
  58. package/packages/lib/src/components/CheckBox/index.tsx +1 -1
  59. package/packages/lib/src/components/DialogPrompt/DialogPrompt.scss +6 -6
  60. package/packages/lib/src/components/DialogPrompt/DialogPrompt.stories.tsx +17 -17
  61. package/packages/lib/src/components/DialogPrompt/DialogPrompt.test.tsx +11 -11
  62. package/packages/lib/src/components/DialogPrompt/DialogPrompt.tsx +41 -41
  63. package/packages/lib/src/components/DialogPrompt/index.tsx +1 -1
  64. package/packages/lib/src/components/Divider/Divider.scss +22 -22
  65. package/packages/lib/src/components/Divider/Divider.tsx +20 -20
  66. package/packages/lib/src/components/DropDown/DropDown.scss +70 -70
  67. package/packages/lib/src/components/DropDown/DropDown.stories.tsx +45 -45
  68. package/packages/lib/src/components/DropDown/DropDown.tsx +61 -61
  69. package/packages/lib/src/components/DropDown/index.tsx +1 -1
  70. package/packages/lib/src/components/Form/Form.scss +3 -3
  71. package/packages/lib/src/components/Form/Form.stories.tsx +20 -20
  72. package/packages/lib/src/components/Form/Form.tsx +25 -25
  73. package/packages/lib/src/components/FormButtons/FormButtons.scss +5 -5
  74. package/packages/lib/src/components/FormButtons/FormButtons.tsx +18 -18
  75. package/packages/lib/src/components/HeaderButtons/HeaderButtons.scss +6 -6
  76. package/packages/lib/src/components/HeaderButtons/HeaderButtons.stories.tsx +17 -17
  77. package/packages/lib/src/components/HeaderButtons/HeaderButtons.test.tsx +11 -11
  78. package/packages/lib/src/components/HeaderButtons/HeaderButtons.tsx +28 -28
  79. package/packages/lib/src/components/HeaderButtons/index.tsx +1 -1
  80. package/packages/lib/src/components/IconButton/IconButton.scss +64 -64
  81. package/packages/lib/src/components/IconButton/IconButton.tsx +44 -44
  82. package/packages/lib/src/components/MenuItem/MenuItem.scss +13 -13
  83. package/packages/lib/src/components/MenuItem/MenuItem.tsx +36 -36
  84. package/packages/lib/src/components/Modal/Modal.scss +71 -71
  85. package/packages/lib/src/components/Modal/Modal.tsx +60 -60
  86. package/packages/lib/src/components/Navbar/Navbar.scss +52 -52
  87. package/packages/lib/src/components/Navbar/Navbar.stories.tsx +25 -25
  88. package/packages/lib/src/components/Navbar/Navbar.tsx +38 -38
  89. package/packages/lib/src/components/NavbarLink/NavbarLink.scss +15 -15
  90. package/packages/lib/src/components/NavbarLink/NavbarLink.tsx +34 -34
  91. package/packages/lib/src/components/NavbarMenu/NavbarMenu.scss +156 -156
  92. package/packages/lib/src/components/NavbarMenu/NavbarMenu.stories.tsx +24 -24
  93. package/packages/lib/src/components/NavbarMenu/NavbarMenu.tsx +72 -72
  94. package/packages/lib/src/components/Panel/Panel.scss +29 -29
  95. package/packages/lib/src/components/Panel/Panel.stories.tsx +32 -32
  96. package/packages/lib/src/components/Panel/Panel.test.tsx +11 -11
  97. package/packages/lib/src/components/Panel/Panel.tsx +29 -29
  98. package/packages/lib/src/components/Panel/index.tsx +1 -1
  99. package/packages/lib/src/components/Paper/Paper.scss +5 -5
  100. package/packages/lib/src/components/Paper/Paper.stories.tsx +18 -18
  101. package/packages/lib/src/components/Paper/Paper.tsx +18 -18
  102. package/packages/lib/src/components/Paper/index.tsx +1 -1
  103. package/packages/lib/src/components/RangeSlider/RangeSlider.scss +83 -83
  104. package/packages/lib/src/components/RangeSlider/RangeSlider.stories.tsx +24 -24
  105. package/packages/lib/src/components/RangeSlider/RangeSlider.tsx +150 -150
  106. package/packages/lib/src/components/ResponsiveBar/ResponsiveBar.scss +72 -72
  107. package/packages/lib/src/components/ResponsiveBar/ResponsiveBar.tsx +38 -38
  108. package/packages/lib/src/components/ScrollView/ScrollView.scss +20 -20
  109. package/packages/lib/src/components/ScrollView/ScrollView.stories.tsx +17 -17
  110. package/packages/lib/src/components/ScrollView/ScrollView.test.tsx +11 -11
  111. package/packages/lib/src/components/ScrollView/ScrollView.tsx +19 -19
  112. package/packages/lib/src/components/ScrollView/index.tsx +1 -1
  113. package/packages/lib/src/components/Section/Section.scss +17 -17
  114. package/packages/lib/src/components/Section/Section.tsx +26 -26
  115. package/packages/lib/src/components/SelectField/SelectField.scss +42 -42
  116. package/packages/lib/src/components/SelectField/SelectField.stories.tsx +14 -14
  117. package/packages/lib/src/components/SelectField/SelectField.tsx +54 -54
  118. package/packages/lib/src/components/SelectField/index.tsx +1 -1
  119. package/packages/lib/src/components/Spacer/Spacer.scss +2 -2
  120. package/packages/lib/src/components/Spacer/Spacer.tsx +6 -6
  121. package/packages/lib/src/components/StackPanel/StackPanel.scss +8 -8
  122. package/packages/lib/src/components/StackPanel/StackPanel.stories.tsx +17 -17
  123. package/packages/lib/src/components/StackPanel/StackPanel.test.tsx +11 -11
  124. package/packages/lib/src/components/StackPanel/StackPanel.tsx +31 -31
  125. package/packages/lib/src/components/StackPanel/index.tsx +1 -1
  126. package/packages/lib/src/components/Submenu/Submenu.scss +55 -55
  127. package/packages/lib/src/components/Submenu/Submenu.stories.tsx +45 -45
  128. package/packages/lib/src/components/Submenu/Submenu.tsx +59 -59
  129. package/packages/lib/src/components/Submenu/index.tsx +1 -1
  130. package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.scss +75 -75
  131. package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.stories.tsx +17 -17
  132. package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.test.tsx +11 -11
  133. package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.tsx +63 -63
  134. package/packages/lib/src/components/SuccessCongratulation/index.tsx +1 -1
  135. package/packages/lib/src/components/TextArea/TextArea.scss +41 -41
  136. package/packages/lib/src/components/TextArea/TextArea.stories.tsx +14 -14
  137. package/packages/lib/src/components/TextArea/TextArea.tsx +50 -50
  138. package/packages/lib/src/components/TextArea/index.tsx +1 -1
  139. package/packages/lib/src/components/TextField/TextField.scss +56 -56
  140. package/packages/lib/src/components/TextField/TextField.stories.tsx +14 -14
  141. package/packages/lib/src/components/TextField/TextField.tsx +89 -89
  142. package/packages/lib/src/components/TextField/index.tsx +1 -1
  143. package/packages/lib/src/components/TitleEdit/TitleEdit.scss +17 -17
  144. package/packages/lib/src/components/TitleEdit/TitleEdit.tsx +69 -69
  145. package/packages/lib/src/components/Toast/Toast.scss +32 -32
  146. package/packages/lib/src/components/Toast/Toast.tsx +29 -29
  147. package/packages/lib/src/components/ToggleButton/ToggleButton.scss +47 -47
  148. package/packages/lib/src/components/ToggleButton/ToggleButton.stories.tsx +22 -22
  149. package/packages/lib/src/components/ToggleButton/ToggleButton.tsx +41 -41
  150. package/packages/lib/src/components/ToggleButton/index.tsx +1 -1
  151. package/packages/lib/src/components/Toolbar/Toolbar.scss +16 -16
  152. package/packages/lib/src/components/Toolbar/Toolbar.stories.tsx +17 -17
  153. package/packages/lib/src/components/Toolbar/Toolbar.test.tsx +11 -11
  154. package/packages/lib/src/components/Toolbar/Toolbar.tsx +20 -20
  155. package/packages/lib/src/components/Toolbar/index.tsx +1 -1
  156. package/packages/lib/src/components/Typography/Typography.scss +51 -51
  157. package/packages/lib/src/components/Typography/Typography.stories.tsx +18 -18
  158. package/packages/lib/src/components/Typography/Typography.tsx +19 -19
  159. package/packages/lib/src/components/index.tsx +34 -34
  160. package/packages/lib/src/hooks/index.tsx +3 -3
  161. package/packages/lib/src/hooks/use-click-outside.tsx +19 -19
  162. package/packages/lib/src/hooks/use-form.tsx +107 -107
  163. package/packages/lib/src/hooks/use-keys-enteresc.tsx +25 -25
  164. package/packages/lib/src/hooks/use-set-startup-focus.tsx +8 -8
  165. package/packages/lib/src/i18n/config.ts +8 -8
  166. package/packages/lib/src/i18n/en/translation.json +11 -11
  167. package/packages/lib/src/i18n/fr/translation.json +11 -11
  168. package/packages/lib/src/i18n/index.ts +11 -11
  169. package/packages/lib/src/index.tsx +7 -7
  170. package/packages/lib/src/stories/Intrduction.mdx +171 -171
  171. package/packages/lib/src/stories/assets/github.svg +3 -3
  172. package/packages/lib/src/styles/1-color-vars.scss +51 -51
  173. package/packages/lib/src/styles/2-font-variables.scss +2 -2
  174. package/packages/lib/src/styles/variables.scss +1 -1
  175. package/packages/lib/src/test/i18n.ts +17 -17
  176. package/packages/lib/src/utils/bem.ts +4 -4
  177. package/packages/lib/src/utils/formatError.ts +5 -5
  178. package/packages/lib/src/utils/index.ts +1 -1
  179. package/packages/lib/src/utils/interfaces.ts +5 -5
  180. package/packages/lib/tsconfig.json +26 -25
  181. package/packages/lib/vite.config.js +18 -18
  182. package/packages/ui-test/package-lock.json +97 -97
  183. package/packages/ui-test/package.json +19 -19
  184. package/packages/ui-test/playwright.config.ts +80 -80
  185. package/packages/ui-test/tests/example.spec.ts +18 -18
  186. package/packages/ui-test/tests-examples/demo-todo-app.spec.ts +437 -437
@@ -1,39 +1,39 @@
1
- import { ReactNode, Children, useState, useRef } from "react"
2
- import './Navbar.scss'
3
- import clsx from "clsx";
4
- import { bem } from '../../utils/bem';
5
- import { FaBars } from "react-icons/fa6";
6
- import { useClickOutside } from "../../hooks";
7
-
8
- export interface INavbarProps {
9
- children: ReactNode
10
- className?: string
11
- }
12
- const b = bem("navbar");
13
- export const Navbar = ({children, className}: INavbarProps) => {
14
- const [isOpen, setIsOpen] = useState(false);
15
- const buttonRef = useRef<HTMLButtonElement | null>(null);
16
- const dropdownRef = useRef<HTMLUListElement | null>(null);
17
- useClickOutside([buttonRef, dropdownRef], () => setIsOpen(false));
18
-
19
- const toggleDropdown = () => setIsOpen((prevIsOpen: boolean) => !prevIsOpen);
20
- return (<nav className={clsx(b(), className)}>
21
- <button
22
- className={b("expand-button")}
23
- onClick={toggleDropdown}
24
- ref={buttonRef}>
25
- <FaBars/>
26
- </button>
27
- <ul
28
- className={clsx(b("container"), isOpen && b("container", "open"))}
29
- ref={dropdownRef}
30
- >
31
- {
32
- Children.map(children, (c, i) => (
33
- <li key={i} className={b("item")}>{c}</li>
34
- ))
35
- }
36
- </ul>
37
- </nav>
38
- )
1
+ import { ReactNode, Children, useState, useRef } from "react"
2
+ import './Navbar.scss'
3
+ import clsx from "clsx";
4
+ import { bem } from '../../utils/bem';
5
+ import { FaBars } from "react-icons/fa6";
6
+ import { useClickOutside } from "../../hooks";
7
+
8
+ export interface INavbarProps {
9
+ children: ReactNode
10
+ className?: string
11
+ }
12
+ const b = bem("navbar");
13
+ export const Navbar = ({children, className}: INavbarProps) => {
14
+ const [isOpen, setIsOpen] = useState(false);
15
+ const buttonRef = useRef<HTMLButtonElement | null>(null);
16
+ const dropdownRef = useRef<HTMLUListElement | null>(null);
17
+ useClickOutside([buttonRef, dropdownRef], () => setIsOpen(false));
18
+
19
+ const toggleDropdown = () => setIsOpen((prevIsOpen: boolean) => !prevIsOpen);
20
+ return (<nav className={clsx(b(), className)}>
21
+ <button
22
+ className={b("expand-button")}
23
+ onClick={toggleDropdown}
24
+ ref={buttonRef}>
25
+ <FaBars/>
26
+ </button>
27
+ <ul
28
+ className={clsx(b("container"), isOpen && b("container", "open"))}
29
+ ref={dropdownRef}
30
+ >
31
+ {
32
+ Children.map(children, (c, i) => (
33
+ <li key={i} className={b("item")}>{c}</li>
34
+ ))
35
+ }
36
+ </ul>
37
+ </nav>
38
+ )
39
39
  }
@@ -1,16 +1,16 @@
1
- .r5ui-navbar-link {
2
- text-decoration: none;
3
- margin: 10px;
4
- color: $secondary_text_color;
5
- @media (min-width: 640px) {
6
- font-weight: 600;
7
- }
8
- &:hover,
9
- &:focus{
10
- color: $secondary_text_color;
11
- text-decoration: underline;
12
- }
13
- &:active{
14
- color: $secondary_text_color_highlight;
15
- }
1
+ .r5ui-navbar-link {
2
+ text-decoration: none;
3
+ margin: 10px;
4
+ color: $secondary_text_color;
5
+ @media (min-width: 640px) {
6
+ font-weight: 600;
7
+ }
8
+ &:hover,
9
+ &:focus{
10
+ color: $secondary_text_color;
11
+ text-decoration: underline;
12
+ }
13
+ &:active{
14
+ color: $secondary_text_color_highlight;
15
+ }
16
16
  }
@@ -1,34 +1,34 @@
1
- import type { ReactNode } from 'react';
2
- import "./NavbarLink.scss";
3
- import clsx from 'clsx';
4
- import { bem } from '../../utils/bem';
5
-
6
- export interface INavbarLinkProps {
7
- to?: string;
8
- onClick?: () => void;
9
- children: ReactNode;
10
- component?: any;
11
- className?: string;
12
- }
13
-
14
- const b = bem("navbar-link");
15
- export const NavbarLink = ({ to, children, onClick, component: Component, className }: INavbarLinkProps) => {
16
- if(Component) {
17
- return (
18
- <Component
19
- className={clsx(b(), className)}
20
- to={to}
21
- >{children}</Component>)
22
- }
23
- else if(onClick)
24
- return (
25
- <a
26
- className={clsx(b(), className)}
27
- href="#"
28
- onClick={onClick}
29
- >{children}</a>
30
- );
31
- return <a>{children}</a>;
32
- }
33
-
34
- export default NavbarLink
1
+ import type { ReactNode } from 'react';
2
+ import "./NavbarLink.scss";
3
+ import clsx from 'clsx';
4
+ import { bem } from '../../utils/bem';
5
+
6
+ export interface INavbarLinkProps {
7
+ to?: string;
8
+ onClick?: () => void;
9
+ children: ReactNode;
10
+ component?: any;
11
+ className?: string;
12
+ }
13
+
14
+ const b = bem("navbar-link");
15
+ export const NavbarLink = ({ to, children, onClick, component: Component, className }: INavbarLinkProps) => {
16
+ if(Component) {
17
+ return (
18
+ <Component
19
+ className={clsx(b(), className)}
20
+ to={to}
21
+ >{children}</Component>)
22
+ }
23
+ else if(onClick)
24
+ return (
25
+ <a
26
+ className={clsx(b(), className)}
27
+ href="#"
28
+ onClick={onClick}
29
+ >{children}</a>
30
+ );
31
+ return <a>{children}</a>;
32
+ }
33
+
34
+ export default NavbarLink
@@ -1,157 +1,157 @@
1
- .r5ui-navbar-menu {
2
- position: relative;
3
- display: inline-block;
4
-
5
- &__toggle-button {
6
- border: 0;
7
- margin: 0;
8
- padding: 0;
9
- background: none;
10
- cursor: pointer;
11
- }
12
- &__button {
13
- //padding: 5px 10px;
14
- text-transform: uppercase;
15
- margin: 0;
16
- padding: 0;
17
- width: 2rem;
18
- height: 2rem;
19
- text-align: center;
20
- background-color: $menu_bg_color;
21
- color: $page_text_color;
22
- border: $border_size solid $primary_border_color;
23
- //border: none;
24
- cursor: pointer;
25
- border-radius: 50%;
26
- outline: none;
27
-
28
- &:hover {
29
- background-color: $menu_bg_color;
30
- }
31
-
32
- &:focus {
33
- box-shadow: 0 0 0 2px $primary_border_color;
34
- }
35
- }
36
-
37
- &__indicator-primary {
38
- border: solid $primary_text_color;
39
- }
40
- &__indicator-secondary {
41
- border: solid $secondary_text_color;
42
- }
43
- &__indicator {
44
- margin-left: 0.6em;
45
- border-width: 0 2px 2px 0;
46
- display: inline-block;
47
- padding: 3px;
48
- transform: rotate(45deg);
49
- transition: transform 0.3s ease;
50
- }
51
-
52
- &__indicator--open {
53
- transform: rotate(-135deg);
54
- }
55
-
56
- &__container {
57
- display: none;
58
- flex-direction: column;
59
- position: absolute;
60
- background-color: $menu_bg_color;
61
- color: $menu_text_color;
62
- min-width: 210px;
63
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
64
- z-index: 1;
65
- padding: 0;
66
- margin: 0;
67
- border: 1px solid $primary_border_color;
68
- border-radius: $border_radius;
69
- right: 0;
70
-
71
- &--down {
72
- top: 100%;
73
- }
74
-
75
- &--up {
76
- bottom: 100%;
77
- }
78
- &--open {
79
- display: flex;
80
- }
81
- }
82
- &__drop-header {
83
- margin: 0;
84
- padding: 0.75em;
85
- min-height: 3em;
86
- text-align: center;
87
- color: $menu_text_color;
88
- border-bottom: 1px solid $primary_border_color;
89
- }
90
- &__list {
91
- padding: 0;
92
- margin: 0;
93
- list-style-type: none;
94
- right: 0;
95
-
96
- &--down {
97
- top: 100%;
98
- }
99
-
100
- &--up {
101
- bottom: 100%;
102
- }
103
- }
104
-
105
- &__item {
106
- padding: 0;
107
- display: flex;
108
- flex-direction: column;
109
- align-items: start;
110
- justify-content: left;
111
- }
112
- &__menu-item {
113
- color: $menu_text_color;
114
- padding: .5em 1em;
115
- text-decoration: none;
116
- display: block;
117
- cursor: pointer;
118
- border: 0;
119
- background: none;
120
-
121
- &:hover {
122
- //background-color: $secondary_bg_color_highlight;
123
- text-decoration: underline;
124
- }
125
- }
126
-
127
- @media (max-width: 240px) {
128
- &__drop-header {
129
- display: none;
130
- }
131
- &__container {
132
- display: flex;
133
- position: inherit;
134
- background: none;
135
- border: 0;
136
- box-shadow: none;
137
- align-items: end;
138
- justify-content: right;
139
- }
140
- &__item {
141
- align-items: end;
142
- justify-content: right;
143
- }
144
- &__menu-item {
145
- align-items: end;
146
- justify-content: right;
147
- padding: .5em;
148
- color: $menu_text_color;
149
- }
150
- &__toggle-button {
151
- display: none;
152
- }
153
- &__button {
154
- display: none;
155
- }
156
- }
1
+ .r5ui-navbar-menu {
2
+ position: relative;
3
+ display: inline-block;
4
+
5
+ &__toggle-button {
6
+ border: 0;
7
+ margin: 0;
8
+ padding: 0;
9
+ background: none;
10
+ cursor: pointer;
11
+ }
12
+ &__button {
13
+ //padding: 5px 10px;
14
+ text-transform: uppercase;
15
+ margin: 0;
16
+ padding: 0;
17
+ width: 2rem;
18
+ height: 2rem;
19
+ text-align: center;
20
+ background-color: $menu_bg_color;
21
+ color: $page_text_color;
22
+ border: $border_size solid $primary_border_color;
23
+ //border: none;
24
+ cursor: pointer;
25
+ border-radius: 50%;
26
+ outline: none;
27
+
28
+ &:hover {
29
+ background-color: $menu_bg_color;
30
+ }
31
+
32
+ &:focus {
33
+ box-shadow: 0 0 0 2px $primary_border_color;
34
+ }
35
+ }
36
+
37
+ &__indicator-primary {
38
+ border: solid $primary_text_color;
39
+ }
40
+ &__indicator-secondary {
41
+ border: solid $secondary_text_color;
42
+ }
43
+ &__indicator {
44
+ margin-left: 0.6em;
45
+ border-width: 0 2px 2px 0;
46
+ display: inline-block;
47
+ padding: 3px;
48
+ transform: rotate(45deg);
49
+ transition: transform 0.3s ease;
50
+ }
51
+
52
+ &__indicator--open {
53
+ transform: rotate(-135deg);
54
+ }
55
+
56
+ &__container {
57
+ display: none;
58
+ flex-direction: column;
59
+ position: absolute;
60
+ background-color: $menu_bg_color;
61
+ color: $menu_text_color;
62
+ min-width: 210px;
63
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
64
+ z-index: 1;
65
+ padding: 0;
66
+ margin: 0;
67
+ border: 1px solid $primary_border_color;
68
+ border-radius: $border_radius;
69
+ right: 0;
70
+
71
+ &--down {
72
+ top: 100%;
73
+ }
74
+
75
+ &--up {
76
+ bottom: 100%;
77
+ }
78
+ &--open {
79
+ display: flex;
80
+ }
81
+ }
82
+ &__drop-header {
83
+ margin: 0;
84
+ padding: 0.75em;
85
+ min-height: 3em;
86
+ text-align: center;
87
+ color: $menu_text_color;
88
+ border-bottom: 1px solid $primary_border_color;
89
+ }
90
+ &__list {
91
+ padding: 0;
92
+ margin: 0;
93
+ list-style-type: none;
94
+ right: 0;
95
+
96
+ &--down {
97
+ top: 100%;
98
+ }
99
+
100
+ &--up {
101
+ bottom: 100%;
102
+ }
103
+ }
104
+
105
+ &__item {
106
+ padding: 0;
107
+ display: flex;
108
+ flex-direction: column;
109
+ align-items: start;
110
+ justify-content: left;
111
+ }
112
+ &__menu-item {
113
+ color: $menu_text_color;
114
+ padding: .5em 1em;
115
+ text-decoration: none;
116
+ display: block;
117
+ cursor: pointer;
118
+ border: 0;
119
+ background: none;
120
+
121
+ &:hover {
122
+ //background-color: $secondary_bg_color_highlight;
123
+ text-decoration: underline;
124
+ }
125
+ }
126
+
127
+ @media (max-width: 240px) {
128
+ &__drop-header {
129
+ display: none;
130
+ }
131
+ &__container {
132
+ display: flex;
133
+ position: inherit;
134
+ background: none;
135
+ border: 0;
136
+ box-shadow: none;
137
+ align-items: end;
138
+ justify-content: right;
139
+ }
140
+ &__item {
141
+ align-items: end;
142
+ justify-content: right;
143
+ }
144
+ &__menu-item {
145
+ align-items: end;
146
+ justify-content: right;
147
+ padding: .5em;
148
+ color: $menu_text_color;
149
+ }
150
+ &__toggle-button {
151
+ display: none;
152
+ }
153
+ &__button {
154
+ display: none;
155
+ }
156
+ }
157
157
  }
@@ -1,24 +1,24 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { NavbarMenu } from './NavbarMenu';
4
-
5
- const meta: Meta<typeof NavbarMenu> = {
6
- component: NavbarMenu,
7
- };
8
-
9
- export default meta;
10
- type Story = StoryObj<typeof NavbarMenu>;
11
-
12
- /*
13
- *👇 Render functions are a framework specific feature to allow you control on how the component renders.
14
- * See https://storybook.js.org/docs/react/api/csf
15
- * to learn how to use render functions.
16
- */
17
- const menuItems = [{ to: '/about', title: 'About' }];
18
- export const Primary: Story = {
19
- render: () => (
20
- <div style={{ backgroundColor: '#333' }}>
21
- <NavbarMenu menuTitle="AF" items={menuItems}></NavbarMenu>
22
- </div>
23
- ),
24
- };
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+
3
+ import { NavbarMenu } from './NavbarMenu';
4
+
5
+ const meta: Meta<typeof NavbarMenu> = {
6
+ component: NavbarMenu,
7
+ };
8
+
9
+ export default meta;
10
+ type Story = StoryObj<typeof NavbarMenu>;
11
+
12
+ /*
13
+ *👇 Render functions are a framework specific feature to allow you control on how the component renders.
14
+ * See https://storybook.js.org/docs/react/api/csf
15
+ * to learn how to use render functions.
16
+ */
17
+ const menuItems = [{ to: '/about', title: 'About' }];
18
+ export const Primary: Story = {
19
+ render: () => (
20
+ <div style={{ backgroundColor: '#333' }}>
21
+ <NavbarMenu menuTitle="AF" items={menuItems}></NavbarMenu>
22
+ </div>
23
+ ),
24
+ };