mertani-web-toolkit 0.1.21 → 0.1.23

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 (229) hide show
  1. package/dist/components/Button/Button.svelte +95 -24
  2. package/dist/components/Button/Button.svelte.d.ts +12 -8
  3. package/dist/components/Button/button.css +104 -18
  4. package/dist/components/Icon/Icon.svelte +122 -0
  5. package/dist/components/Icon/Icon.svelte.d.ts +13 -0
  6. package/dist/components/Icon/IconLibrary.svelte +197 -0
  7. package/dist/components/Icon/IconLibrary.svelte.d.ts +11 -0
  8. package/dist/icons/BsActivity.svelte +3 -0
  9. package/dist/icons/BsActivity.svelte.d.ts +26 -0
  10. package/dist/icons/BsArrow90degLeft.svelte +6 -0
  11. package/dist/icons/BsArrow90degLeft.svelte.d.ts +26 -0
  12. package/dist/icons/BsArrow90degRight.svelte +6 -0
  13. package/dist/icons/BsArrow90degRight.svelte.d.ts +26 -0
  14. package/dist/icons/BsArrowDownCircle.svelte +6 -0
  15. package/dist/icons/BsArrowDownCircle.svelte.d.ts +26 -0
  16. package/dist/icons/BsArrowRepeat.svelte +4 -0
  17. package/dist/icons/BsArrowRepeat.svelte.d.ts +26 -0
  18. package/dist/icons/BsArrowReturnLeft.svelte +3 -0
  19. package/dist/icons/BsArrowReturnLeft.svelte.d.ts +26 -0
  20. package/dist/icons/BsArrowRightShort.svelte +3 -0
  21. package/dist/icons/BsArrowRightShort.svelte.d.ts +26 -0
  22. package/dist/icons/BsArrowUpCircle.svelte +6 -0
  23. package/dist/icons/BsArrowUpCircle.svelte.d.ts +26 -0
  24. package/dist/icons/BsBarChart.svelte +3 -0
  25. package/dist/icons/BsBarChart.svelte.d.ts +26 -0
  26. package/dist/icons/BsBarChartLine.svelte +3 -0
  27. package/dist/icons/BsBarChartLine.svelte.d.ts +26 -0
  28. package/dist/icons/BsBatteryHalf.svelte +4 -0
  29. package/dist/icons/BsBatteryHalf.svelte.d.ts +26 -0
  30. package/dist/icons/BsBoxArrowInRight.svelte +4 -0
  31. package/dist/icons/BsBoxArrowInRight.svelte.d.ts +26 -0
  32. package/dist/icons/BsBoxArrowLeft.svelte +7 -0
  33. package/dist/icons/BsBoxArrowLeft.svelte.d.ts +26 -0
  34. package/dist/icons/BsBoxArrowRight.svelte +7 -0
  35. package/dist/icons/BsBoxArrowRight.svelte.d.ts +26 -0
  36. package/dist/icons/BsBoxArrowUpRight.svelte +7 -0
  37. package/dist/icons/BsBoxArrowUpRight.svelte.d.ts +26 -0
  38. package/dist/icons/BsCalendar.svelte +6 -0
  39. package/dist/icons/BsCalendar.svelte.d.ts +26 -0
  40. package/dist/icons/BsCalendar3.svelte +7 -0
  41. package/dist/icons/BsCalendar3.svelte.d.ts +26 -0
  42. package/dist/icons/BsCalendar4.svelte +6 -0
  43. package/dist/icons/BsCalendar4.svelte.d.ts +26 -0
  44. package/dist/icons/BsCameraVideoOff.svelte +6 -0
  45. package/dist/icons/BsCameraVideoOff.svelte.d.ts +26 -0
  46. package/dist/icons/BsCheck2Circle.svelte +4 -0
  47. package/dist/icons/BsCheck2Circle.svelte.d.ts +26 -0
  48. package/dist/icons/BsCheckCircle.svelte +7 -0
  49. package/dist/icons/BsCheckCircle.svelte.d.ts +26 -0
  50. package/dist/icons/BsCheckCircleFill.svelte +6 -0
  51. package/dist/icons/BsCheckCircleFill.svelte.d.ts +26 -0
  52. package/dist/icons/BsCheckLg.svelte +3 -0
  53. package/dist/icons/BsCheckLg.svelte.d.ts +26 -0
  54. package/dist/icons/BsCheckSquare.svelte +7 -0
  55. package/dist/icons/BsCheckSquare.svelte.d.ts +26 -0
  56. package/dist/icons/BsChevronDown.svelte +3 -0
  57. package/dist/icons/BsChevronDown.svelte.d.ts +26 -0
  58. package/dist/icons/BsChevronLeft.svelte +3 -0
  59. package/dist/icons/BsChevronLeft.svelte.d.ts +26 -0
  60. package/dist/icons/BsChevronRight.svelte +3 -0
  61. package/dist/icons/BsChevronRight.svelte.d.ts +26 -0
  62. package/dist/icons/BsChevronUp.svelte +3 -0
  63. package/dist/icons/BsChevronUp.svelte.d.ts +26 -0
  64. package/dist/icons/BsClock.svelte +7 -0
  65. package/dist/icons/BsClock.svelte.d.ts +26 -0
  66. package/dist/icons/BsClockHistory.svelte +8 -0
  67. package/dist/icons/BsClockHistory.svelte.d.ts +26 -0
  68. package/dist/icons/BsCopy.svelte +6 -0
  69. package/dist/icons/BsCopy.svelte.d.ts +26 -0
  70. package/dist/icons/BsDashLg.svelte +3 -0
  71. package/dist/icons/BsDashLg.svelte.d.ts +26 -0
  72. package/dist/icons/BsDownload.svelte +4 -0
  73. package/dist/icons/BsDownload.svelte.d.ts +26 -0
  74. package/dist/icons/BsExclamationCircle.svelte +7 -0
  75. package/dist/icons/BsExclamationCircle.svelte.d.ts +26 -0
  76. package/dist/icons/BsExclamationOctagonFill.svelte +6 -0
  77. package/dist/icons/BsExclamationOctagonFill.svelte.d.ts +26 -0
  78. package/dist/icons/BsExclamationTriangle.svelte +7 -0
  79. package/dist/icons/BsExclamationTriangle.svelte.d.ts +26 -0
  80. package/dist/icons/BsEye.svelte +4 -0
  81. package/dist/icons/BsEye.svelte.d.ts +26 -0
  82. package/dist/icons/BsFileText.svelte +4 -0
  83. package/dist/icons/BsFileText.svelte.d.ts +26 -0
  84. package/dist/icons/BsFilter.svelte +3 -0
  85. package/dist/icons/BsFilter.svelte.d.ts +26 -0
  86. package/dist/icons/BsFloppy.svelte +7 -0
  87. package/dist/icons/BsFloppy.svelte.d.ts +26 -0
  88. package/dist/icons/BsFullscreen.svelte +6 -0
  89. package/dist/icons/BsFullscreen.svelte.d.ts +26 -0
  90. package/dist/icons/BsFullscreenExit.svelte +6 -0
  91. package/dist/icons/BsFullscreenExit.svelte.d.ts +26 -0
  92. package/dist/icons/BsGear.svelte +7 -0
  93. package/dist/icons/BsGear.svelte.d.ts +26 -0
  94. package/dist/icons/BsGrid.svelte +3 -0
  95. package/dist/icons/BsGrid.svelte.d.ts +26 -0
  96. package/dist/icons/BsGrid3x3Gap.svelte +3 -0
  97. package/dist/icons/BsGrid3x3Gap.svelte.d.ts +26 -0
  98. package/dist/icons/BsHdd.svelte +4 -0
  99. package/dist/icons/BsHdd.svelte.d.ts +26 -0
  100. package/dist/icons/BsImage.svelte +7 -0
  101. package/dist/icons/BsImage.svelte.d.ts +26 -0
  102. package/dist/icons/BsInfoCircle.svelte +7 -0
  103. package/dist/icons/BsInfoCircle.svelte.d.ts +26 -0
  104. package/dist/icons/BsInputPrefix.svelte +4 -0
  105. package/dist/icons/BsInputPrefix.svelte.d.ts +26 -0
  106. package/dist/icons/BsLayoutSidebar.svelte +3 -0
  107. package/dist/icons/BsLayoutSidebar.svelte.d.ts +26 -0
  108. package/dist/icons/BsList.svelte +3 -0
  109. package/dist/icons/BsList.svelte.d.ts +26 -0
  110. package/dist/icons/BsMap.svelte +6 -0
  111. package/dist/icons/BsMap.svelte.d.ts +26 -0
  112. package/dist/icons/BsNut.svelte +7 -0
  113. package/dist/icons/BsNut.svelte.d.ts +26 -0
  114. package/dist/icons/BsPencil.svelte +6 -0
  115. package/dist/icons/BsPencil.svelte.d.ts +26 -0
  116. package/dist/icons/BsPlusLg.svelte +3 -0
  117. package/dist/icons/BsPlusLg.svelte.d.ts +26 -0
  118. package/dist/icons/BsSearch.svelte +6 -0
  119. package/dist/icons/BsSearch.svelte.d.ts +26 -0
  120. package/dist/icons/BsSliders2Vertical.svelte +3 -0
  121. package/dist/icons/BsSliders2Vertical.svelte.d.ts +26 -0
  122. package/dist/icons/BsTextCenter.svelte +3 -0
  123. package/dist/icons/BsTextCenter.svelte.d.ts +26 -0
  124. package/dist/icons/BsTextLeft.svelte +3 -0
  125. package/dist/icons/BsTextLeft.svelte.d.ts +26 -0
  126. package/dist/icons/BsTextRight.svelte +3 -0
  127. package/dist/icons/BsTextRight.svelte.d.ts +26 -0
  128. package/dist/icons/BsThreeDots.svelte +3 -0
  129. package/dist/icons/BsThreeDots.svelte.d.ts +26 -0
  130. package/dist/icons/BsThreeDotsVertical.svelte +3 -0
  131. package/dist/icons/BsThreeDotsVertical.svelte.d.ts +26 -0
  132. package/dist/icons/BsTrash.svelte +4 -0
  133. package/dist/icons/BsTrash.svelte.d.ts +26 -0
  134. package/dist/icons/BsTypeBold.svelte +3 -0
  135. package/dist/icons/BsTypeBold.svelte.d.ts +26 -0
  136. package/dist/icons/BsTypeItalic.svelte +3 -0
  137. package/dist/icons/BsTypeItalic.svelte.d.ts +26 -0
  138. package/dist/icons/BsTypeUnderline.svelte +3 -0
  139. package/dist/icons/BsTypeUnderline.svelte.d.ts +26 -0
  140. package/dist/icons/BsUpload.svelte +4 -0
  141. package/dist/icons/BsUpload.svelte.d.ts +26 -0
  142. package/dist/icons/BsViewStacked.svelte +3 -0
  143. package/dist/icons/BsViewStacked.svelte.d.ts +26 -0
  144. package/dist/icons/BsXCircle.svelte +7 -0
  145. package/dist/icons/BsXCircle.svelte.d.ts +26 -0
  146. package/dist/icons/BsXCircleFill.svelte +6 -0
  147. package/dist/icons/BsXCircleFill.svelte.d.ts +26 -0
  148. package/dist/icons/BsXLg.svelte +4 -0
  149. package/dist/icons/BsXLg.svelte.d.ts +26 -0
  150. package/dist/icons/BsXSquare.svelte +7 -0
  151. package/dist/icons/BsXSquare.svelte.d.ts +26 -0
  152. package/dist/icons/ChevronDown.svelte +3 -10
  153. package/dist/icons/ChevronDown.svelte.d.ts +0 -2
  154. package/dist/icons/CoGarisLurus.svelte +13 -0
  155. package/dist/icons/CoGarisLurus.svelte.d.ts +26 -0
  156. package/dist/icons/CoLink.svelte +13 -0
  157. package/dist/icons/CoLink.svelte.d.ts +26 -0
  158. package/dist/icons/CoPadi.svelte +13 -0
  159. package/dist/icons/CoPadi.svelte.d.ts +26 -0
  160. package/dist/icons/CoPalawija.svelte +17 -0
  161. package/dist/icons/CoPalawija.svelte.d.ts +26 -0
  162. package/dist/icons/CoTebu.svelte +17 -0
  163. package/dist/icons/CoTebu.svelte.d.ts +26 -0
  164. package/dist/icons/GearTwo.svelte +16 -8
  165. package/dist/icons/GearTwo.svelte.d.ts +25 -6
  166. package/dist/icons/Logout.svelte +15 -3
  167. package/dist/icons/MsArrowRange.svelte +13 -0
  168. package/dist/icons/MsArrowRange.svelte.d.ts +26 -0
  169. package/dist/icons/MsControlCamera.svelte +13 -0
  170. package/dist/icons/MsControlCamera.svelte.d.ts +26 -0
  171. package/dist/icons/MsGarageDoor.svelte +13 -0
  172. package/dist/icons/MsGarageDoor.svelte.d.ts +26 -0
  173. package/dist/icons/MsGarageHome.svelte +13 -0
  174. package/dist/icons/MsGarageHome.svelte.d.ts +26 -0
  175. package/dist/icons/MsGraph1.svelte +13 -0
  176. package/dist/icons/MsGraph1.svelte.d.ts +26 -0
  177. package/dist/icons/MsGridOn.svelte +13 -0
  178. package/dist/icons/MsGridOn.svelte.d.ts +26 -0
  179. package/dist/icons/MsHighDensity.svelte +13 -0
  180. package/dist/icons/MsHighDensity.svelte.d.ts +26 -0
  181. package/dist/icons/MsRoute.svelte +13 -0
  182. package/dist/icons/MsRoute.svelte.d.ts +26 -0
  183. package/dist/icons/MsSpatialSpeaker.svelte +13 -0
  184. package/dist/icons/MsSpatialSpeaker.svelte.d.ts +26 -0
  185. package/dist/icons/Sim_B_Bagi.svelte +10 -0
  186. package/dist/icons/Sim_B_Bagi.svelte.d.ts +26 -0
  187. package/dist/icons/Sim_B_Bagi_Sadap.svelte +11 -0
  188. package/dist/icons/Sim_B_Bagi_Sadap.svelte.d.ts +26 -0
  189. package/dist/icons/Sim_B_Intake_Bendung.svelte +23 -0
  190. package/dist/icons/Sim_B_Intake_Bendung.svelte.d.ts +26 -0
  191. package/dist/icons/Sim_B_Sadap.svelte +10 -0
  192. package/dist/icons/Sim_B_Sadap.svelte.d.ts +26 -0
  193. package/dist/icons/Sim_Box_Tersier.svelte +18 -0
  194. package/dist/icons/Sim_Box_Tersier.svelte.d.ts +26 -0
  195. package/dist/icons/Sim_Freetext.svelte +12 -0
  196. package/dist/icons/Sim_Freetext.svelte.d.ts +26 -0
  197. package/dist/icons/Sim_Gorong2.svelte +27 -0
  198. package/dist/icons/Sim_Gorong2.svelte.d.ts +26 -0
  199. package/dist/icons/Sim_Jembatan.svelte +21 -0
  200. package/dist/icons/Sim_Jembatan.svelte.d.ts +26 -0
  201. package/dist/icons/Sim_Petak_Tersier.svelte +18 -0
  202. package/dist/icons/Sim_Petak_Tersier.svelte.d.ts +26 -0
  203. package/dist/icons/Sim_Saluran_Pembuang.svelte +15 -0
  204. package/dist/icons/Sim_Saluran_Pembuang.svelte.d.ts +26 -0
  205. package/dist/icons/Sim_Saluran_Primer.svelte +16 -0
  206. package/dist/icons/Sim_Saluran_Primer.svelte.d.ts +26 -0
  207. package/dist/icons/Sim_Saluran_Sekunder.svelte +16 -0
  208. package/dist/icons/Sim_Saluran_Sekunder.svelte.d.ts +26 -0
  209. package/dist/icons/Sim_Saluran_Tersier.svelte +16 -0
  210. package/dist/icons/Sim_Saluran_Tersier.svelte.d.ts +26 -0
  211. package/dist/icons/Sim_Subskema.svelte +17 -0
  212. package/dist/icons/Sim_Subskema.svelte.d.ts +26 -0
  213. package/dist/icons/Sim_Syphon.svelte +40 -0
  214. package/dist/icons/Sim_Syphon.svelte.d.ts +26 -0
  215. package/dist/icons/Sim_Talang.svelte +19 -0
  216. package/dist/icons/Sim_Talang.svelte.d.ts +26 -0
  217. package/dist/icons/Sim_Terowongan.svelte +42 -0
  218. package/dist/icons/Sim_Terowongan.svelte.d.ts +26 -0
  219. package/dist/icons/User.svelte +19 -10
  220. package/dist/icons/Window.svelte +2 -6
  221. package/dist/icons/Window.svelte.d.ts +24 -15
  222. package/dist/icons/index.js +221 -0
  223. package/dist/index.d.ts +1 -1
  224. package/dist/index.js +1 -1
  225. package/dist/layouts/IMS/IMSLayout1/components/ImsSidebar.svelte +4 -1
  226. package/package.json +1 -1
  227. package/dist/components/Header/Header.svelte +0 -45
  228. package/dist/components/Header/Header.svelte.d.ts +0 -12
  229. package/dist/components/Header/header.css +0 -32
@@ -1,30 +1,101 @@
1
1
  <script lang="ts">
2
- import './button.css';
3
-
4
- interface Props {
5
- /** Is this the principal call to action on the page? */
6
- primary?: boolean;
7
- /** What background color to use */
8
- backgroundColor?: string;
9
- /** How large should the button be? */
10
- size?: 'small' | 'medium' | 'large';
11
- /** Button contents */
12
- label: string;
13
- /** The onclick event handler */
14
- onclick?: () => void;
15
- }
16
-
17
- const { primary = false, backgroundColor, size = 'medium', label, ...props }: Props = $props();
18
-
19
- let mode = $derived(primary ? 'storybook-button--primary' : 'storybook-button--secondary');
20
- let style = $derived(backgroundColor ? `background-color: ${backgroundColor}` : '');
2
+ import './button.css';
3
+ import { Icon } from '../../index.js';
4
+ import type { TIconName } from '../../types/Icon.js';
5
+
6
+ interface Props {
7
+ size?: 'small' | 'medium' | 'large';
8
+ variant?: 'primary' | 'secondary' | 'outline';
9
+ label?: string;
10
+ disabled?: boolean;
11
+ isLoading?: boolean;
12
+ backgroundColor?: string;
13
+ borderColor?: string;
14
+ textColor?: string;
15
+ iconLeft?: TIconName;
16
+ iconRight?: TIconName;
17
+ class?: string;
18
+ style?: string;
19
+ onclick?: () => void;
20
+ }
21
+
22
+ const {
23
+ size = 'medium',
24
+ variant = 'primary',
25
+ label = 'Button',
26
+ disabled = false,
27
+ isLoading = false,
28
+ backgroundColor = '',
29
+ borderColor = '',
30
+ textColor = '',
31
+ iconLeft,
32
+ iconRight,
33
+ class: className = '',
34
+ style: customStyle = '',
35
+ ...props
36
+ }: Props = $props();
37
+
38
+ let mode = $derived(
39
+ variant === 'primary'
40
+ ? 'storybook-button--primary'
41
+ : variant === 'secondary'
42
+ ? 'storybook-button--secondary'
43
+ : 'storybook-button--outline'
44
+ );
45
+
46
+ // Ukuran icon berdasarkan size button
47
+ const iconSize = $derived(() => {
48
+ switch (size) {
49
+ case 'small':
50
+ return 16;
51
+ case 'large':
52
+ return 18;
53
+ default:
54
+ return 18;
55
+ }
56
+ });
57
+
58
+ // Gabungkan classes
59
+ const buttonClasses = $derived(() => {
60
+ const classes = ['storybook-button', `storybook-button--${size}`, mode];
61
+ if (isLoading) classes.push('storybook-button--loading');
62
+ if (className) classes.push(className);
63
+ return classes.filter(Boolean).join(' ');
64
+ });
65
+
66
+ // Gabungkan styles
67
+ const buttonStyles = $derived(() => {
68
+ const styles: string[] = [];
69
+ if (backgroundColor) styles.push(`--background-color: ${backgroundColor};`);
70
+ if (borderColor) styles.push(`--border-color: ${borderColor};`);
71
+ if (textColor) styles.push(`--text-color: ${textColor};`);
72
+ if (customStyle) styles.push(customStyle);
73
+ return styles.join(' ');
74
+ });
75
+
76
+ // Button disabled jika disabled atau loading
77
+ const isButtonDisabled = $derived(disabled || isLoading);
21
78
  </script>
22
79
 
23
80
  <button
24
- type="button"
25
- class={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
26
- {style}
27
- {...props}
81
+ type="button"
82
+ disabled={isButtonDisabled}
83
+ class={buttonClasses()}
84
+ style={buttonStyles()}
85
+ {...props}
28
86
  >
29
- {label}
87
+ {#if isLoading}
88
+ <span class="storybook-button__spinner"></span>
89
+ {/if}
90
+ {#if iconLeft && !isLoading}
91
+ <span class="storybook-button__icon storybook-button__icon--left">
92
+ <Icon name={iconLeft} width={iconSize()} height={iconSize()} color="currentColor" />
93
+ </span>
94
+ {/if}
95
+ <span class="storybook-button__label">{label}</span>
96
+ {#if iconRight && !isLoading}
97
+ <span class="storybook-button__icon storybook-button__icon--right">
98
+ <Icon name={iconRight} width={iconSize()} height={iconSize()} color="currentColor" />
99
+ </span>
100
+ {/if}
30
101
  </button>
@@ -1,14 +1,18 @@
1
1
  import './button.css';
2
+ import type { TIconName } from '../../types/Icon.js';
2
3
  interface Props {
3
- /** Is this the principal call to action on the page? */
4
- primary?: boolean;
5
- /** What background color to use */
6
- backgroundColor?: string;
7
- /** How large should the button be? */
8
4
  size?: 'small' | 'medium' | 'large';
9
- /** Button contents */
10
- label: string;
11
- /** The onclick event handler */
5
+ variant?: 'primary' | 'secondary' | 'outline';
6
+ label?: string;
7
+ disabled?: boolean;
8
+ isLoading?: boolean;
9
+ backgroundColor?: string;
10
+ borderColor?: string;
11
+ textColor?: string;
12
+ iconLeft?: TIconName;
13
+ iconRight?: TIconName;
14
+ class?: string;
15
+ style?: string;
12
16
  onclick?: () => void;
13
17
  }
14
18
  declare const Button: import("svelte").Component<Props, {}, "">;
@@ -1,30 +1,116 @@
1
1
  .storybook-button {
2
- display: inline-block;
3
- cursor: pointer;
4
- border: 0;
5
- border-radius: 3em;
6
- font-weight: 700;
7
- line-height: 1;
8
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 8px;
6
+ cursor: pointer;
7
+ border: 0;
8
+ font-weight: 500;
9
+ line-height: 1;
10
+ font-family: 'Inter', sans-serif;
11
+ }
12
+ .storybook-button:hover {
13
+ opacity: 0.8;
14
+ }
15
+ .storybook-button:active {
16
+ opacity: 0.6;
9
17
  }
10
18
  .storybook-button--primary {
11
- background-color: #555ab9;
12
- color: white;
19
+ background-color: var(--background-color, #f79b09);
20
+ border: 1px solid var(--border-color, var(--background-color, #f79b09));
21
+ color: var(--text-color, white);
22
+ }
23
+ .storybook-button--primary:disabled {
24
+ background-color: #ced4da;
25
+ border: 1px solid #ced4da;
26
+ color: #3f4047;
27
+ cursor: not-allowed;
13
28
  }
14
29
  .storybook-button--secondary {
15
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
16
- background-color: transparent;
17
- color: #333;
30
+ border: 1px solid #ced4da;
31
+ background-color: transparent;
32
+ color: var(--text-color, #3f4047);
33
+ }
34
+ .storybook-button--secondary:disabled {
35
+ border: 1px solid #a3a6b7;
36
+ color: #a3a6b7;
37
+ cursor: not-allowed;
38
+ }
39
+ .storybook-button--outline {
40
+ border: 1px solid var(--border-color, #f79b09);
41
+ background-color: transparent;
42
+ color: var(--text-color, #f79b09);
43
+ }
44
+ .storybook-button--outline:disabled {
45
+ border: 1px solid #a3a6b7;
46
+ color: #a3a6b7;
47
+ cursor: not-allowed;
18
48
  }
19
49
  .storybook-button--small {
20
- padding: 10px 16px;
21
- font-size: 12px;
50
+ padding: 6px 12px;
51
+ font-size: 14px;
52
+ border-radius: 6px;
22
53
  }
23
54
  .storybook-button--medium {
24
- padding: 11px 20px;
25
- font-size: 14px;
55
+ padding: 8px 16px;
56
+ font-size: 16px;
57
+ border-radius: 8px;
26
58
  }
27
59
  .storybook-button--large {
28
- padding: 12px 24px;
29
- font-size: 16px;
60
+ padding: 10px 24px;
61
+ font-size: 18px;
62
+ border-radius: 8px;
63
+ }
64
+ .storybook-button--disabled {
65
+ background-color: #ced4da;
66
+ cursor: not-allowed;
67
+ }
68
+
69
+ .storybook-button__icon {
70
+ display: inline-flex;
71
+ align-items: center;
72
+ justify-content: center;
73
+ flex-shrink: 0;
74
+ }
75
+
76
+ .storybook-button__label {
77
+ display: inline-block;
78
+ }
79
+
80
+ .storybook-button--loading {
81
+ cursor: wait;
82
+ position: relative;
83
+ }
84
+
85
+ .storybook-button--loading .storybook-button__label {
86
+ opacity: 0.7;
87
+ }
88
+
89
+ .storybook-button__spinner {
90
+ display: inline-block;
91
+ width: 14px;
92
+ height: 14px;
93
+ border: 2px solid currentColor;
94
+ border-right-color: transparent;
95
+ border-radius: 50%;
96
+ animation: storybook-button-spin 0.6s linear infinite;
97
+ flex-shrink: 0;
98
+ }
99
+
100
+ @keyframes storybook-button-spin {
101
+ to {
102
+ transform: rotate(360deg);
103
+ }
104
+ }
105
+
106
+ .storybook-button--small .storybook-button__spinner {
107
+ width: 12px;
108
+ height: 12px;
109
+ border-width: 1.5px;
110
+ }
111
+
112
+ .storybook-button--large .storybook-button__spinner {
113
+ width: 16px;
114
+ height: 16px;
115
+ border-width: 2.5px;
30
116
  }
@@ -0,0 +1,122 @@
1
+ <script lang="ts">
2
+ import { iconMap } from '../../icons/index.js';
3
+ import type { TIconName } from '../../icons/index.js';
4
+
5
+ interface IconProps {
6
+ name: TIconName;
7
+ width?: number | string;
8
+ height?: number | string;
9
+ color?: string;
10
+ style?: string;
11
+ action?: () => void;
12
+ opacity?: number;
13
+ }
14
+
15
+ const { name, width, height, color, style, action, opacity }: IconProps = $props();
16
+
17
+ const IconComponent = $derived(iconMap[name]);
18
+
19
+ const iconWidth = $derived(
20
+ width !== undefined ? (typeof width === 'number' ? `${width}px` : width) : 'auto'
21
+ );
22
+ const iconHeight = $derived(
23
+ height !== undefined ? (typeof height === 'number' ? `${height}px` : height) : 'auto'
24
+ );
25
+ const iconColor = $derived(color || 'currentColor');
26
+
27
+ const iconOpacity = $derived(() => {
28
+ if (opacity === undefined) return undefined;
29
+ const clamped = Math.max(0, Math.min(100, opacity));
30
+ return clamped / 100;
31
+ });
32
+
33
+ const combinedStyles = $derived(() => {
34
+ const styles: string[] = [];
35
+ styles.push(`--icon-width: ${iconWidth};`);
36
+ styles.push(`--icon-height: ${iconHeight};`);
37
+ styles.push(`--icon-color: ${iconColor};`);
38
+ const opacityValue = iconOpacity();
39
+ if (opacityValue !== undefined) {
40
+ styles.push(`--icon-opacity: ${opacityValue};`);
41
+ styles.push(`opacity: ${opacityValue};`);
42
+ } else {
43
+ styles.push(`--icon-opacity: 1;`);
44
+ }
45
+ if (style) {
46
+ styles.push(style);
47
+ }
48
+ return styles.join(' ');
49
+ });
50
+
51
+ function handleClick() {
52
+ if (action) {
53
+ action();
54
+ }
55
+ }
56
+ </script>
57
+
58
+ {#if IconComponent}
59
+ {@const Component = IconComponent as any}
60
+ <div
61
+ class="icon-wrapper"
62
+ class:icon-clickable={action !== undefined}
63
+ style={combinedStyles()}
64
+ onclick={action ? handleClick : undefined}
65
+ role={action ? 'button' : undefined}
66
+ onkeydown={(e) => {
67
+ if (action && (e.key === 'Enter' || e.key === ' ')) {
68
+ e.preventDefault();
69
+ handleClick();
70
+ }
71
+ }}
72
+ >
73
+ <div class="icon-fallback">
74
+ <Component />
75
+ </div>
76
+ </div>
77
+ {:else}
78
+ <span class="icon-error">Icon "{name}" tidak ditemukan</span>
79
+ {/if}
80
+
81
+ <style>
82
+ .icon-wrapper {
83
+ display: inline-flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ width: var(--icon-width, auto);
87
+ height: var(--icon-height, auto);
88
+ color: var(--icon-color, currentColor);
89
+ }
90
+
91
+ .icon-wrapper.icon-clickable {
92
+ cursor: pointer;
93
+ transition: opacity 0.2s ease, transform 0.2s ease;
94
+ }
95
+
96
+ .icon-wrapper.icon-clickable:hover {
97
+ opacity: calc(var(--icon-opacity, 1) * 0.8);
98
+ }
99
+
100
+ .icon-wrapper.icon-clickable:active {
101
+ transform: scale(0.95);
102
+ }
103
+
104
+ .icon-fallback {
105
+ width: 100%;
106
+ height: 100%;
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ }
111
+
112
+ .icon-fallback :global(svg) {
113
+ width: var(--icon-width, auto);
114
+ height: var(--icon-height, auto);
115
+ color: var(--icon-color, currentColor);
116
+ }
117
+
118
+ .icon-error {
119
+ color: red;
120
+ font-size: 12px;
121
+ }
122
+ </style>
@@ -0,0 +1,13 @@
1
+ import type { TIconName } from '../../icons/index.js';
2
+ interface IconProps {
3
+ name: TIconName;
4
+ width?: number | string;
5
+ height?: number | string;
6
+ color?: string;
7
+ style?: string;
8
+ action?: () => void;
9
+ opacity?: number;
10
+ }
11
+ declare const Icon: import("svelte").Component<IconProps, {}, "">;
12
+ type Icon = ReturnType<typeof Icon>;
13
+ export default Icon;
@@ -0,0 +1,197 @@
1
+ <script lang="ts">
2
+ import { iconMap } from '../../icons/index.js';
3
+
4
+ const {
5
+ iconWidth = 24,
6
+ iconHeight = 24,
7
+ iconColor = '#212529',
8
+ style,
9
+ opacity,
10
+ action
11
+ } = $props<{
12
+ iconWidth?: number | string;
13
+ iconHeight?: number | string;
14
+ iconColor?: string;
15
+ style?: string;
16
+ opacity?: number;
17
+ action?: (iconName: string) => void;
18
+ }>();
19
+
20
+ // Daftar semua icon - otomatis dari iconMap
21
+ const icons = Object.entries(iconMap).map(([name, component]) => ({
22
+ name,
23
+ component
24
+ }));
25
+
26
+ let searchQuery = $state('');
27
+
28
+ let filteredIcons = $derived(
29
+ searchQuery.trim() === ''
30
+ ? icons
31
+ : icons.filter((icon) => {
32
+ const query = searchQuery.toLowerCase();
33
+ return icon.name.toLowerCase().includes(query);
34
+ })
35
+ );
36
+
37
+ const iconOpacity = $derived(() => {
38
+ if (opacity === undefined) return undefined;
39
+ const clamped = Math.max(0, Math.min(100, opacity));
40
+ return clamped / 100;
41
+ });
42
+
43
+ const combinedStyles = $derived(() => {
44
+ const styles: string[] = [];
45
+ const opacityValue = iconOpacity();
46
+ if (opacityValue !== undefined) {
47
+ styles.push(`--icon-opacity: ${opacityValue};`);
48
+ styles.push(`opacity: ${opacityValue};`);
49
+ } else {
50
+ styles.push(`--icon-opacity: 1;`);
51
+ }
52
+ if (style) {
53
+ styles.push(style);
54
+ }
55
+ return styles.join(' ');
56
+ });
57
+
58
+ function handleIconClick(iconName: string) {
59
+ if (action) {
60
+ action(iconName);
61
+ }
62
+ }
63
+ </script>
64
+
65
+ <div class="icons-container">
66
+ <div class="search-container">
67
+ <input type="text" placeholder="Cari icon..." bind:value={searchQuery} class="search-input" />
68
+ <div class="search-info">
69
+ Menampilkan {filteredIcons.length} dari {icons.length} icon
70
+ </div>
71
+ </div>
72
+
73
+ <div
74
+ class="icons-grid"
75
+ style="--icon-width: {iconWidth}px; --icon-height: {iconHeight}px; --icon-color: {iconColor};"
76
+ >
77
+ {#each filteredIcons as icon}
78
+ {@const IconComponent = icon.component as any}
79
+ <div
80
+ class="icon-item"
81
+ class:icon-clickable={action !== undefined}
82
+ style={combinedStyles()}
83
+ onclick={action ? () => handleIconClick(icon.name) : undefined}
84
+ role={action ? 'button' : undefined}
85
+ onkeydown={(e) => {
86
+ if (action && (e.key === 'Enter' || e.key === ' ')) {
87
+ e.preventDefault();
88
+ handleIconClick(icon.name);
89
+ }
90
+ }}
91
+ >
92
+ <div class="icon-wrapper">
93
+ <IconComponent />
94
+ </div>
95
+ <div class="icon-name">{icon.name}</div>
96
+ </div>
97
+ {/each}
98
+ </div>
99
+
100
+ {#if filteredIcons.length === 0}
101
+ <div class="no-results">
102
+ <p>Tidak ada icon yang ditemukan untuk "{searchQuery}"</p>
103
+ </div>
104
+ {/if}
105
+ </div>
106
+
107
+ <style>
108
+ .icons-container {
109
+ padding: 24px;
110
+ max-width: 1400px;
111
+ margin: 0 auto;
112
+ }
113
+
114
+ .search-container {
115
+ margin-bottom: 32px;
116
+ }
117
+
118
+ .search-input {
119
+ width: 100%;
120
+ max-width: 500px;
121
+ padding: 12px 16px;
122
+ font-size: 16px;
123
+ border: 1px solid #e0e0e0;
124
+ outline: none;
125
+ transition: border-color 0.2s ease;
126
+ }
127
+
128
+ .search-input:focus {
129
+ border-color: #007bff;
130
+ }
131
+
132
+ .search-info {
133
+ margin-top: 8px;
134
+ color: #666;
135
+ font-size: 14px;
136
+ }
137
+
138
+ .icons-grid {
139
+ display: grid;
140
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
141
+ }
142
+
143
+ .icon-item {
144
+ display: flex;
145
+ flex-direction: column;
146
+ align-items: center;
147
+ padding: 16px 8px;
148
+ border: 1px solid #e0e0e0;
149
+ transition: all 0.2s ease;
150
+ cursor: pointer;
151
+ }
152
+
153
+ .icon-item:hover {
154
+ background: #f8f9fa;
155
+ }
156
+
157
+ .icon-item.icon-clickable {
158
+ cursor: pointer;
159
+ transition: opacity 0.2s ease, transform 0.2s ease;
160
+ }
161
+
162
+ .icon-item.icon-clickable:hover {
163
+ opacity: calc(var(--icon-opacity, 1) * 0.8);
164
+ }
165
+
166
+ .icon-item.icon-clickable:active {
167
+ transform: scale(0.95);
168
+ }
169
+
170
+ .icon-wrapper {
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ width: var(--icon-width, 24px);
175
+ height: var(--icon-height, 24px);
176
+ margin-bottom: 8px;
177
+ color: var(--icon-color, #212529);
178
+ }
179
+
180
+ .icon-name {
181
+ font-weight: 500;
182
+ font-size: 12px;
183
+ color: #212529;
184
+ text-align: center;
185
+ word-break: break-word;
186
+ }
187
+
188
+ .no-results {
189
+ text-align: center;
190
+ padding: 48px;
191
+ color: #999;
192
+ }
193
+
194
+ .no-results p {
195
+ font-size: 16px;
196
+ }
197
+ </style>
@@ -0,0 +1,11 @@
1
+ type $$ComponentProps = {
2
+ iconWidth?: number | string;
3
+ iconHeight?: number | string;
4
+ iconColor?: string;
5
+ style?: string;
6
+ opacity?: number;
7
+ action?: (iconName: string) => void;
8
+ };
9
+ declare const IconLibrary: import("svelte").Component<$$ComponentProps, {}, "">;
10
+ type IconLibrary = ReturnType<typeof IconLibrary>;
11
+ export default IconLibrary;
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 2C6.10276 2.00004 6.20301 2.03175 6.2871 2.09079C6.3712 2.14984 6.43506 2.23336 6.47 2.33L10 12.036L11.53 7.828C11.5653 7.73174 11.6293 7.64864 11.7133 7.58997C11.7974 7.5313 11.8975 7.49989 12 7.5H15.5C15.6326 7.5 15.7598 7.55268 15.8536 7.64645C15.9473 7.74021 16 7.86739 16 8C16 8.13261 15.9473 8.25979 15.8536 8.35355C15.7598 8.44732 15.6326 8.5 15.5 8.5H12.35L10.47 13.67C10.435 13.7665 10.3711 13.8499 10.287 13.9089C10.2029 13.9678 10.1027 13.9994 10 13.9994C9.89731 13.9994 9.79712 13.9678 9.71303 13.9089C9.62894 13.8499 9.56503 13.7665 9.53 13.67L6 3.964L4.47 8.171C4.4349 8.26745 4.37096 8.35076 4.28688 8.40962C4.2028 8.46847 4.10264 8.50003 4 8.5H0.5C0.367392 8.5 0.240215 8.44732 0.146447 8.35355C0.0526784 8.25979 0 8.13261 0 8C0 7.86739 0.0526784 7.74021 0.146447 7.64645C0.240215 7.55268 0.367392 7.5 0.5 7.5H3.65L5.53 2.33C5.56494 2.23336 5.6288 2.14984 5.7129 2.09079C5.79699 2.03175 5.89724 2.00004 6 2Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,26 @@
1
+ export default BsActivity;
2
+ type BsActivity = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const BsActivity: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,6 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.14592 4.85414C1.09935 4.8077 1.06241 4.75252 1.0372 4.69178C1.012 4.63103 0.999023 4.56591 0.999023 4.50014C0.999023 4.43438 1.012 4.36926 1.0372 4.30851C1.06241 4.24776 1.09935 4.19259 1.14592 4.14614L5.14592 0.146143C5.2398 0.0522567 5.36714 -0.000488281 5.49992 -0.000488281C5.63269 -0.000488281 5.76003 0.0522567 5.85392 0.146143C5.9478 0.24003 6.00055 0.367368 6.00055 0.500143C6.00055 0.632919 5.9478 0.760257 5.85392 0.854143L2.70692 4.00014H12.4999C13.163 4.00014 13.7988 4.26354 14.2677 4.73238C14.7365 5.20122 14.9999 5.8371 14.9999 6.50014V14.5001C14.9999 14.6328 14.9472 14.7599 14.8535 14.8537C14.7597 14.9475 14.6325 15.0001 14.4999 15.0001C14.3673 15.0001 14.2401 14.9475 14.1464 14.8537C14.0526 14.7599 13.9999 14.6328 13.9999 14.5001V6.50014C13.9999 6.10232 13.8419 5.72079 13.5606 5.43948C13.2793 5.15818 12.8977 5.00014 12.4999 5.00014H2.70692L5.85392 8.14614C5.9004 8.19263 5.93728 8.24782 5.96244 8.30856C5.9876 8.3693 6.00055 8.4344 6.00055 8.50014C6.00055 8.56589 5.9876 8.63099 5.96244 8.69173C5.93728 8.75247 5.9004 8.80766 5.85392 8.85414C5.80743 8.90063 5.75224 8.93751 5.6915 8.96267C5.63076 8.98783 5.56566 9.00077 5.49992 9.00077C5.43417 9.00077 5.36907 8.98783 5.30833 8.96267C5.24759 8.93751 5.1924 8.90063 5.14592 8.85414L1.14592 4.85414Z" fill="currentColor"/>
4
+
5
+
6
+ </svg>