h2o-library 1.2.0 → 1.3.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.
@@ -23,3 +23,5 @@ export * from "./src/table";
23
23
  export * from "./src/toast";
24
24
  export * from "./src/logo";
25
25
  export * from "./src/calendar";
26
+ export * from "./src/month-calendar";
27
+ export * from "./src/loader";
@@ -7,6 +7,7 @@ interface CalendarProps {
7
7
  minDate?: Date;
8
8
  maxDate?: Date;
9
9
  forceWeek?: boolean;
10
+ disabledDates?: Date[];
10
11
  }
11
- declare const Calendar: ({ mode, value, onChange, minDate, maxDate, forceWeek, }: CalendarProps) => JSX.Element | null;
12
+ declare const Calendar: ({ mode, value, onChange, minDate, maxDate, forceWeek, disabledDates, }: CalendarProps) => JSX.Element | null;
12
13
  export { Calendar };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const Loader: ({ className }: {
3
+ className?: string | undefined;
4
+ }) => React.JSX.Element;
5
+ export { Loader };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface MonthCalendarProps {
3
+ value?: Date;
4
+ onChange?: (value: Date) => void;
5
+ minDate?: Date;
6
+ maxDate?: Date;
7
+ disabledDates?: Date[];
8
+ }
9
+ declare const MonthCalendar: ({ value, onChange, minDate, maxDate, disabledDates, }: MonthCalendarProps) => JSX.Element;
10
+ export { MonthCalendar };
@@ -11,6 +11,8 @@ interface MultiSelectProps {
11
11
  maxSelectedOptions?: number;
12
12
  toggleLabel?: string;
13
13
  onToggle?: (checked: boolean) => void;
14
+ showSearch?: boolean;
15
+ showSelectAll?: boolean;
14
16
  }
15
- declare const MultiSelect: ({ options, selectedOptions, setSelectedOptions, optionsType, maxSelectedOptions, toggleLabel, onToggle, }: MultiSelectProps) => React.JSX.Element;
17
+ declare const MultiSelect: ({ options, selectedOptions, setSelectedOptions, optionsType, maxSelectedOptions, toggleLabel, onToggle, showSearch, showSelectAll, }: MultiSelectProps) => React.JSX.Element;
16
18
  export { MultiSelect };
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";
@@ -191,6 +191,12 @@
191
191
  color: hsl(var(--primary));
192
192
  }
193
193
 
194
+ .calendar-day.today:not(.selected):not(.range-start):not(.range-end):not(
195
+ :disabled
196
+ ):hover {
197
+ color: white;
198
+ }
199
+
194
200
  .today-indicator {
195
201
  z-index: 50;
196
202
  position: absolute;
@@ -201,6 +207,14 @@
201
207
  background-color: white;
202
208
  }
203
209
 
204
- .calendar-day.today:not(.selected):not(.range-start):not(.range-end) .today-indicator {
210
+ .calendar-day.today:not(.selected):not(.range-start):not(.range-end)
211
+ .today-indicator {
205
212
  background-color: hsl(var(--primary));
206
213
  }
214
+
215
+ .calendar-day.today:not(.selected):not(.range-start):not(.range-end):not(
216
+ :disabled
217
+ ):hover
218
+ .today-indicator {
219
+ background-color: white;
220
+ }
@@ -54,3 +54,5 @@
54
54
  @import "./src/pagination.css";
55
55
  @import "./src/table.css";
56
56
  @import "./src/toast.css";
57
+ @import "./src/month-calendar.css";
58
+ @import "./src/loader.css";
@@ -0,0 +1,18 @@
1
+ .h2o-loader {
2
+ width: 50px;
3
+ padding: 8px;
4
+ aspect-ratio: 1;
5
+ border-radius: 50%;
6
+ background: hsl(var(--primary));
7
+ --_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;
8
+ -webkit-mask: var(--_m);
9
+ mask: var(--_m);
10
+ -webkit-mask-composite: source-out;
11
+ mask-composite: subtract;
12
+ animation: l3 1s infinite linear;
13
+ }
14
+ @keyframes l3 {
15
+ to {
16
+ transform: rotate(1turn);
17
+ }
18
+ }
@@ -0,0 +1,92 @@
1
+ .month-calendar-container {
2
+ width: 100%;
3
+ max-width: 24rem;
4
+ background-color: hsl(var(--background));
5
+ border-radius: 0.5rem;
6
+ box-shadow: var(--primary-shadow);
7
+ border: 1px solid hsl(var(--primary-muted));
8
+ padding: 0 1rem;
9
+ }
10
+
11
+ .month-calendar-header {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ padding: 0.8rem 0.5rem;
16
+ border-bottom: 1px solid hsl(var(--muted) / 50%);
17
+ }
18
+
19
+ .month-calendar-title {
20
+ font-size: 1.2rem;
21
+ font-weight: 500;
22
+ background: none;
23
+ border: none;
24
+ cursor: pointer;
25
+ padding: 0.5rem 1rem;
26
+ border-radius: 0.25rem;
27
+ }
28
+
29
+ .month-calendar-title:hover {
30
+ color: hsl(var(--primary));
31
+ transition: all 0.2s ease-in-out;
32
+ }
33
+
34
+ .month-calendar-nav-button {
35
+ background: none;
36
+ border: none;
37
+ cursor: pointer;
38
+ padding: 0.2rem;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ border-radius: 0.25rem;
43
+ }
44
+
45
+ .month-calendar-nav-button:hover {
46
+ background-color: hsl(var(--muted-50));
47
+ color: hsl(var(--primary));
48
+ transition: all 0.2s ease-in-out;
49
+ }
50
+
51
+ .month-calendar-grid {
52
+ display: grid;
53
+ grid-template-columns: repeat(3, 1fr);
54
+ gap: 0.5rem;
55
+ padding: 1rem 0.5rem;
56
+ }
57
+
58
+ .month-calendar-item {
59
+ aspect-ratio: 1.8;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ cursor: pointer;
64
+ border: 1px solid transparent;
65
+ background: none;
66
+ font-size: 0.8rem;
67
+ border-radius: 0.5rem;
68
+ transition: all 0.2s ease-in-out;
69
+ }
70
+
71
+ .month-calendar-item:not(:disabled):not(.selected):hover {
72
+ border: 1px solid hsl(var(--primary));
73
+ color: hsl(var(--primary));
74
+ }
75
+
76
+ .month-calendar-item.selected {
77
+ background-color: hsl(var(--primary));
78
+ color: white;
79
+ }
80
+
81
+ .month-calendar-item.selected:hover {
82
+ background-color: hsl(var(--primary-200));
83
+ }
84
+
85
+ .month-calendar-item.disabled {
86
+ color: hsl(var(--muted));
87
+ cursor: not-allowed;
88
+ }
89
+
90
+ .month-calendar-grid[data-view="years"] {
91
+ grid-template-columns: repeat(3, 1fr);
92
+ }
@@ -25,6 +25,23 @@
25
25
  padding: 0 0.8rem;
26
26
  }
27
27
 
28
+ .multi-select-tag {
29
+ font-size: 0.75rem;
30
+ font-weight: 500;
31
+ overflow: hidden;
32
+ text-overflow: ellipsis;
33
+ white-space: nowrap;
34
+ }
35
+
36
+ .multi-select-show-more {
37
+ font-size: 0.875rem;
38
+ font-weight: 500;
39
+ color: hsl(var(--primary));
40
+ text-decoration: underline;
41
+ cursor: pointer;
42
+ text-wrap: nowrap;
43
+ }
44
+
28
45
  .multi-select-trigger {
29
46
  display: flex;
30
47
  align-items: center;
@@ -48,6 +65,28 @@
48
65
 
49
66
  .multi-select-trigger-icon {
50
67
  color: hsl(var(--muted-200));
68
+ transition: all 0.2s;
69
+ }
70
+
71
+ .multi-select-trigger-icon-open {
72
+ transform: rotate(180deg);
73
+ color: hsl(var(--primary));
74
+ }
75
+
76
+ .multi-select-search-input {
77
+ margin-top: 0.25rem;
78
+ margin-bottom: 0.25rem;
79
+ }
80
+
81
+ .multi-select-toggle {
82
+ margin-top: 0.25rem;
83
+ margin-bottom: 0.25rem;
84
+ font-size: 0.875rem;
85
+ line-height: 1.4rem;
86
+ }
87
+
88
+ .multi-select-option {
89
+ font-size: 0.875rem;
51
90
  }
52
91
 
53
92
  .multi-select-options-container {
@@ -23,3 +23,5 @@ export * from "./src/table";
23
23
  export * from "./src/toast";
24
24
  export * from "./src/logo";
25
25
  export * from "./src/calendar";
26
+ export * from "./src/month-calendar";
27
+ export * from "./src/loader";
@@ -7,6 +7,7 @@ interface CalendarProps {
7
7
  minDate?: Date;
8
8
  maxDate?: Date;
9
9
  forceWeek?: boolean;
10
+ disabledDates?: Date[];
10
11
  }
11
- declare const Calendar: ({ mode, value, onChange, minDate, maxDate, forceWeek, }: CalendarProps) => JSX.Element | null;
12
+ declare const Calendar: ({ mode, value, onChange, minDate, maxDate, forceWeek, disabledDates, }: CalendarProps) => JSX.Element | null;
12
13
  export { Calendar };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const Loader: ({ className }: {
3
+ className?: string | undefined;
4
+ }) => React.JSX.Element;
5
+ export { Loader };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface MonthCalendarProps {
3
+ value?: Date;
4
+ onChange?: (value: Date) => void;
5
+ minDate?: Date;
6
+ maxDate?: Date;
7
+ disabledDates?: Date[];
8
+ }
9
+ declare const MonthCalendar: ({ value, onChange, minDate, maxDate, disabledDates, }: MonthCalendarProps) => JSX.Element;
10
+ export { MonthCalendar };
@@ -11,6 +11,8 @@ interface MultiSelectProps {
11
11
  maxSelectedOptions?: number;
12
12
  toggleLabel?: string;
13
13
  onToggle?: (checked: boolean) => void;
14
+ showSearch?: boolean;
15
+ showSelectAll?: boolean;
14
16
  }
15
- declare const MultiSelect: ({ options, selectedOptions, setSelectedOptions, optionsType, maxSelectedOptions, toggleLabel, onToggle, }: MultiSelectProps) => React.JSX.Element;
17
+ declare const MultiSelect: ({ options, selectedOptions, setSelectedOptions, optionsType, maxSelectedOptions, toggleLabel, onToggle, showSearch, showSelectAll, }: MultiSelectProps) => React.JSX.Element;
16
18
  export { MultiSelect };
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";