@bccampus/ui-components 0.3.0 → 0.4.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.
- package/dist/composite.d.ts +151 -0
- package/dist/composite.js +472 -0
- package/dist/generate-tiles-DuagGD1d.js +244 -0
- package/dist/generate-tiles.d.ts +43 -0
- package/dist/generate-tiles.js +7 -0
- package/dist/icon-generator-tuhuqdpL.js +76 -0
- package/dist/icon-generator.d.ts +11 -4
- package/dist/icon-generator.js +4 -301
- package/dist/masked-image-generator.js +7 -7
- package/dist/ui-components.js +5 -5
- package/package.json +12 -1
- package/src/components/ui/composite/CompositeData.ts +215 -0
- package/src/components/ui/composite/CompositeDataItem.ts +144 -0
- package/src/components/ui/composite/composite-component-item.tsx +50 -0
- package/src/components/ui/composite/composite-component.tsx +100 -0
- package/src/components/ui/composite/composite-data-context.tsx +31 -0
- package/src/components/ui/composite/index.ts +4 -0
- package/src/components/ui/composite/types.ts +81 -0
- package/src/components/ui/icon-generator/index.ts +2 -0
- package/src/components/ui/popover.tsx +46 -0
- package/src/hooks/use-effect-after-mount.ts +27 -0
- package/src/hooks/use-id.ts +5 -0
- package/src/hooks/use-keyboard-event.ts +144 -0
- package/src/lib/object.ts +48 -0
- package/src/lib/set-operations.ts +52 -0
- package/tsconfig.node.json +25 -25
- package/vite.config.ts +3 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
export function isSuperset(set: Iterable<any>, subset: Iterable<any>) {
|
|
4
|
+
const _set = set instanceof Set ? set : new Set(set);
|
|
5
|
+
|
|
6
|
+
for (const elem of subset) {
|
|
7
|
+
if (!_set.has(elem)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function union(setA: Iterable<any>, setB: Iterable<any>) {
|
|
15
|
+
const _union = new Set(setA);
|
|
16
|
+
for (const elem of setB) {
|
|
17
|
+
_union.add(elem);
|
|
18
|
+
}
|
|
19
|
+
return _union;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function intersection(setA: Iterable<any>, setB: Iterable<any>) {
|
|
23
|
+
const _setA = setA instanceof Set ? setA : new Set(setA);
|
|
24
|
+
|
|
25
|
+
const _intersection = new Set();
|
|
26
|
+
for (const elem of setB) {
|
|
27
|
+
if (_setA.has(elem)) {
|
|
28
|
+
_intersection.add(elem);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _intersection;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function symmetricDifference(setA: Iterable<any>, setB: Iterable<any>) {
|
|
35
|
+
const _difference = new Set(setA);
|
|
36
|
+
for (const elem of setB) {
|
|
37
|
+
if (_difference.has(elem)) {
|
|
38
|
+
_difference.delete(elem);
|
|
39
|
+
} else {
|
|
40
|
+
_difference.add(elem);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return _difference;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function difference(setA: Iterable<any>, setB: Iterable<any>) {
|
|
47
|
+
const _difference = new Set(setA);
|
|
48
|
+
for (const elem of setB) {
|
|
49
|
+
_difference.delete(elem);
|
|
50
|
+
}
|
|
51
|
+
return _difference;
|
|
52
|
+
}
|
package/tsconfig.node.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"lib": ["ES2023"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
|
|
9
|
-
/* Bundler mode */
|
|
10
|
-
"moduleResolution": "bundler",
|
|
11
|
-
"allowImportingTsExtensions": true,
|
|
12
|
-
"verbatimModuleSyntax": true,
|
|
13
|
-
"moduleDetection": "force",
|
|
14
|
-
"noEmit": true,
|
|
15
|
-
|
|
16
|
-
/* Linting */
|
|
17
|
-
"strict": true,
|
|
18
|
-
"noUnusedLocals": true,
|
|
19
|
-
"noUnusedParameters": true,
|
|
20
|
-
"erasableSyntaxOnly": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
"noUncheckedSideEffectImports": true
|
|
23
|
-
},
|
|
24
|
-
"include": ["vite.config.ts"]
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"erasableSyntaxOnly": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["vite.config.ts"]
|
|
25
|
+
}
|
package/vite.config.ts
CHANGED
|
@@ -20,7 +20,9 @@ export default defineConfig({
|
|
|
20
20
|
formats: ['es'],
|
|
21
21
|
entry: {
|
|
22
22
|
'ui-components': path.resolve(__dirname, 'src/components/ui/index.ts'),
|
|
23
|
-
'
|
|
23
|
+
'composite': path.resolve(__dirname, 'src/components/ui/composite/index.ts'),
|
|
24
|
+
'icon-generator': path.resolve(__dirname, 'src/components/ui/icon-generator/index.ts'),
|
|
25
|
+
'generate-tiles': path.resolve(__dirname, 'src/components/ui/icon-generator/generate-tiles.tsx'),
|
|
24
26
|
'masked-image-generator': path.resolve(__dirname, 'src/components/ui/icon-generator/masked-image-generator.tsx'),
|
|
25
27
|
'caption': path.resolve(__dirname, 'src/components/ui/typography/caption.tsx'),
|
|
26
28
|
'banner': path.resolve(__dirname, 'src/components/ui/banner.tsx'),
|