@worknice/whiteboard 0.21.0 → 0.21.1

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.
@@ -1,5 +1,5 @@
1
1
  .item-fTF_UR {
2
- padding: var(--size-n1);
2
+ padding: var(--size-n2);
3
3
  gap: var(--size-n2);
4
4
  border-radius: var(--size-n3);
5
5
  font: var(--font-regular);
@@ -8,8 +8,8 @@
8
8
  }
9
9
 
10
10
  .item-fTF_UR.active-VGPKer {
11
- background: var(--color-purple-000);
12
11
  color: var(--color-white);
12
+ background: var(--color-purple-000);
13
13
  }
14
14
 
15
15
  @media (hover: hover) {
@@ -18,3 +18,9 @@
18
18
  }
19
19
  }
20
20
 
21
+ @media (hover: hover) and (prefers-color-scheme: dark) {
22
+ .item-fTF_UR:not(.active-VGPKer):hover {
23
+ background: var(--color-grey-000);
24
+ }
25
+ }
26
+
@@ -10,8 +10,8 @@
10
10
  }
11
11
 
12
12
  .item-BpUNGR.active-V65GY2 {
13
- background: var(--color-purple-000);
14
13
  color: var(--color-white);
14
+ background: var(--color-purple-000);
15
15
  }
16
16
 
17
17
  .label-c5y730 {
@@ -24,3 +24,9 @@
24
24
  }
25
25
  }
26
26
 
27
+ @media (hover: hover) and (prefers-color-scheme: dark) {
28
+ .item-BpUNGR:not(.active-V65GY2):hover {
29
+ background: var(--color-grey-000);
30
+ }
31
+ }
32
+
@@ -6,6 +6,7 @@ const NavSection_module_rslib_entry_ = {
6
6
  accordionIcon: "accordionIcon-dT_gT8",
7
7
  item: "item-wy5vrc",
8
8
  wrapper: "wrapper-UlczY5",
9
- label: "label-AjYjxK"
9
+ label: "label-AjYjxK",
10
+ active: "active-VmEpXA"
10
11
  };
11
12
  export { NavSection_module_rslib_entry_ as default };
@@ -42,3 +42,9 @@
42
42
  }
43
43
  }
44
44
 
45
+ @media (hover: hover) and (prefers-color-scheme: dark) {
46
+ .item-wy5vrc:not(.active-VmEpXA):hover {
47
+ background: var(--color-grey-000);
48
+ }
49
+ }
50
+
@@ -0,0 +1,8 @@
1
+ declare const hasMaxLength: <Model extends {
2
+ [Field: string]: any;
3
+ }>(field: keyof Model, comparator: number, message?: string) => (data: Model) => {
4
+ id: string;
5
+ field: keyof Model;
6
+ message: string;
7
+ } | null;
8
+ export default hasMaxLength;
@@ -0,0 +1,11 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_uuid__ from "uuid";
2
+ const hasMaxLength = (field, comparator, message = `Must be at most ${comparator} characters.`)=>(data)=>{
3
+ const value = data[field];
4
+ return "string" == typeof value && value.length > comparator ? {
5
+ id: (0, __WEBPACK_EXTERNAL_MODULE_uuid__.v4)(),
6
+ field,
7
+ message
8
+ } : null;
9
+ };
10
+ const hasMaxLength_rslib_entry_ = hasMaxLength;
11
+ export { hasMaxLength_rslib_entry_ as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_vitest__ from "vitest";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__hasMaxLength_js_3c9969fb__ from "./hasMaxLength.js";
3
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("hasMaxLength", ()=>{
4
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length shorter than the comparator", ()=>{
5
+ const testValue = "short";
6
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
7
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMaxLength_js_3c9969fb__["default"])("name", 10);
8
+ const result = validator({
9
+ name: testValue
10
+ });
11
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toBeNull();
12
+ });
13
+ });
14
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length equal to the comparator", ()=>{
15
+ const testValue = "exact";
16
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
17
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMaxLength_js_3c9969fb__["default"])("name", 5);
18
+ const result = validator({
19
+ name: testValue
20
+ });
21
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toBeNull();
22
+ });
23
+ });
24
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length longer than the comparator", ()=>{
25
+ const testValue = "longer than";
26
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns an error", ()=>{
27
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMaxLength_js_3c9969fb__["default"])("name", 5);
28
+ const result = validator({
29
+ name: testValue
30
+ });
31
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toEqual({
32
+ id: __WEBPACK_EXTERNAL_MODULE_vitest__.expect.any(String),
33
+ field: "name",
34
+ message: "Must be at most 5 characters."
35
+ });
36
+ });
37
+ });
38
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a non-string value", ()=>{
39
+ const testValue = 12345;
40
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
41
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMaxLength_js_3c9969fb__["default"])("name", 10);
42
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(validator({
43
+ name: testValue
44
+ })).toBeNull();
45
+ });
46
+ });
47
+ });
@@ -0,0 +1,8 @@
1
+ declare const hasMinLength: <Model extends {
2
+ [Field: string]: any;
3
+ }>(field: keyof Model, comparator: number, message?: string) => (data: Model) => {
4
+ id: string;
5
+ field: keyof Model;
6
+ message: string;
7
+ } | null;
8
+ export default hasMinLength;
@@ -0,0 +1,11 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_uuid__ from "uuid";
2
+ const hasMinLength = (field, comparator, message = `Must be at least ${comparator} characters.`)=>(data)=>{
3
+ const value = data[field];
4
+ return "string" == typeof value && value.length < comparator ? {
5
+ id: (0, __WEBPACK_EXTERNAL_MODULE_uuid__.v4)(),
6
+ field,
7
+ message
8
+ } : null;
9
+ };
10
+ const hasMinLength_rslib_entry_ = hasMinLength;
11
+ export { hasMinLength_rslib_entry_ as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_vitest__ from "vitest";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__hasMinLength_js_dbd17c96__ from "./hasMinLength.js";
3
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("hasMinLength", ()=>{
4
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length shorter than the comparator", ()=>{
5
+ const testValue = "short";
6
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns an error", ()=>{
7
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMinLength_js_dbd17c96__["default"])("name", 10);
8
+ const result = validator({
9
+ name: testValue
10
+ });
11
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toEqual({
12
+ id: __WEBPACK_EXTERNAL_MODULE_vitest__.expect.any(String),
13
+ field: "name",
14
+ message: "Must be at least 10 characters."
15
+ });
16
+ });
17
+ });
18
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length equal to the comparator", ()=>{
19
+ const testValue = "exact";
20
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
21
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMinLength_js_dbd17c96__["default"])("name", 5);
22
+ const result = validator({
23
+ name: testValue
24
+ });
25
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toBeNull();
26
+ });
27
+ });
28
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a string length longer than the comparator", ()=>{
29
+ const testValue = "longer than";
30
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
31
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMinLength_js_dbd17c96__["default"])("name", 3);
32
+ const result = validator({
33
+ name: testValue
34
+ });
35
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(result).toBeNull();
36
+ });
37
+ });
38
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.describe)("given a non-string value", ()=>{
39
+ const testValue = 12345;
40
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.it)("returns null", ()=>{
41
+ const validator = (0, __WEBPACK_EXTERNAL_MODULE__hasMinLength_js_dbd17c96__["default"])("name", 3);
42
+ (0, __WEBPACK_EXTERNAL_MODULE_vitest__.expect)(validator({
43
+ name: testValue
44
+ })).toBeNull();
45
+ });
46
+ });
47
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@worknice/whiteboard",
3
3
  "description": "",
4
- "version": "0.21.0",
4
+ "version": "0.21.1",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "files": [
@@ -38,7 +38,7 @@
38
38
  "react-markdown": "^10.1.0",
39
39
  "utf8": "^3.0.0",
40
40
  "zod": "^3.22.3",
41
- "@worknice/utils": "^0.6.78"
41
+ "@worknice/utils": "^0.6.79"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@anolilab/semantic-release-pnpm": "^1.1.10",