lupine.components 1.1.13 → 1.1.14

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 (92) hide show
  1. package/README.md +3 -3
  2. package/package.json +42 -42
  3. package/src/components/action-sheet.tsx +419 -419
  4. package/src/components/button-push-animation.tsx +147 -138
  5. package/src/components/button.tsx +55 -55
  6. package/src/components/desktop-footer.tsx +17 -17
  7. package/src/components/desktop-header.tsx +52 -52
  8. package/src/components/drag-refresh.tsx +129 -129
  9. package/src/components/editable-label.tsx +83 -83
  10. package/src/components/float-window.tsx +233 -233
  11. package/src/components/grid.tsx +18 -18
  12. package/src/components/html-load.tsx +41 -41
  13. package/src/components/html-var.tsx +81 -81
  14. package/src/components/index.ts +43 -44
  15. package/src/components/input-with-title.tsx +24 -24
  16. package/src/components/link-item.tsx +13 -13
  17. package/src/components/link-list.tsx +62 -62
  18. package/src/components/menu-bar.tsx +219 -219
  19. package/src/components/menu-item-props.tsx +13 -13
  20. package/src/components/menu-sidebar.tsx +325 -318
  21. package/src/components/message-box.tsx +44 -44
  22. package/src/components/meta-data.tsx +36 -36
  23. package/src/components/meta-description.tsx +12 -12
  24. package/src/components/mobile-components/icon-menu-item-props.ts +6 -6
  25. package/src/components/mobile-components/index.ts +8 -9
  26. package/src/components/mobile-components/mobile-footer-menu.tsx +95 -95
  27. package/src/components/mobile-components/mobile-header-component.tsx +101 -101
  28. package/src/components/mobile-components/mobile-header-title-icon.tsx +109 -101
  29. package/src/components/mobile-components/mobile-header-with-back.tsx +127 -117
  30. package/src/components/mobile-components/mobile-side-menu.tsx +154 -154
  31. package/src/components/mobile-components/mobile-top-sys-icon.tsx +18 -18
  32. package/src/components/mobile-components/mobile-top-sys-menu.tsx +62 -62
  33. package/src/components/modal.tsx +33 -33
  34. package/src/components/notice-message.tsx +118 -118
  35. package/src/components/page-title.tsx +6 -6
  36. package/src/components/paging-link.tsx +175 -175
  37. package/src/components/panel.tsx +21 -21
  38. package/src/components/popup-menu.tsx +289 -289
  39. package/src/components/progress.tsx +91 -91
  40. package/src/components/radio-label-component.tsx +36 -36
  41. package/src/components/redirect.tsx +19 -19
  42. package/src/components/resizable-splitter.tsx +128 -128
  43. package/src/components/select-angle-component.tsx +127 -127
  44. package/src/components/select-with-title.tsx +37 -37
  45. package/src/components/slide-tab-component.tsx +144 -149
  46. package/src/components/spinner.tsx +106 -100
  47. package/src/components/stars-component.tsx +66 -66
  48. package/src/components/svg.tsx +24 -24
  49. package/src/components/tabs.tsx +279 -279
  50. package/src/components/text-glow.tsx +37 -37
  51. package/src/components/text-scale.tsx +42 -42
  52. package/src/components/text-wave.tsx +55 -55
  53. package/src/components/theme-selector.tsx +28 -28
  54. package/src/components/toggle-base.tsx +269 -269
  55. package/src/components/toggle-switch.tsx +160 -160
  56. package/src/frames/index.ts +3 -3
  57. package/src/frames/responsive-frame.tsx +83 -83
  58. package/src/frames/slider-frame.tsx +111 -111
  59. package/src/frames/top-frame.tsx +30 -30
  60. package/src/index.ts +5 -5
  61. package/src/lib/back-action-helper.ts +54 -54
  62. package/src/lib/base62.ts +23 -23
  63. package/src/lib/blob-utils.ts +23 -23
  64. package/src/lib/calculate-text-width.ts +13 -13
  65. package/src/lib/date-utils.ts +317 -317
  66. package/src/lib/deep-merge.ts +37 -37
  67. package/src/lib/document-ready.ts +34 -34
  68. package/src/lib/dom-utils.ts +32 -32
  69. package/src/lib/download-file.ts +118 -118
  70. package/src/lib/download-link.ts +12 -12
  71. package/src/lib/download-stream.ts +19 -19
  72. package/src/lib/drag-util.ts +118 -118
  73. package/src/lib/dynamical-load.ts +134 -134
  74. package/src/lib/encode-html.ts +27 -27
  75. package/src/lib/find-parent-tag.ts +8 -8
  76. package/src/lib/format-bytes.ts +11 -11
  77. package/src/lib/index.ts +24 -24
  78. package/src/lib/lite-dom.ts +225 -225
  79. package/src/lib/message-hub.ts +103 -104
  80. package/src/lib/observable.ts +188 -188
  81. package/src/lib/path-utils.ts +42 -42
  82. package/src/lib/promise-timeout.ts +1 -1
  83. package/src/lib/simple-storage.ts +40 -40
  84. package/src/lib/stop-propagation.ts +7 -7
  85. package/src/lib/upload-file.ts +101 -101
  86. package/src/styles/base-themes.ts +17 -17
  87. package/src/styles/dark-themes.ts +99 -99
  88. package/src/styles/index.ts +5 -5
  89. package/src/styles/light-themes.ts +106 -106
  90. package/src/styles/media-query.ts +93 -93
  91. package/src/styles/shared-themes.ts +57 -57
  92. package/tsconfig.json +113 -113
@@ -1,100 +1,106 @@
1
- export enum SpinnerSize {
2
- Small = '22px',
3
- Medium = '30px',
4
- Large = '40px',
5
- LargeLarge = '60px',
6
- }
7
- export const Spinner01 = ({
8
- size = SpinnerSize.Medium,
9
- color = 'var(--primary-color)',
10
- }: {
11
- size?: SpinnerSize;
12
- color?: string;
13
- }) => {
14
- const borderWidth =
15
- size === SpinnerSize.Small || size === SpinnerSize.Medium ? '4px' : size === SpinnerSize.Large ? '6px' : '9px';
16
- const css: any = {
17
- width: size,
18
- aspectRatio: 1,
19
- borderRadius: '50%',
20
- background: `radial-gradient(farthest-side,${color} 94%,#0000) top/8px 8px no-repeat, conic-gradient(#0000 30%,${color})`,
21
- '-webkit-mask': `radial-gradient(farthest-side,#0000 calc(100% - ${borderWidth}),#000 0)`,
22
- animation: 'spinner01 1s infinite linear',
23
- '@keyframes spinner01': {
24
- '100%': { transform: 'rotate(1turn)' },
25
- },
26
- };
27
- return <div css={css}></div>;
28
- };
29
-
30
- export const Spinner02 = ({
31
- size = SpinnerSize.Medium,
32
- color = 'var(--primary-color)',
33
- }: {
34
- size?: SpinnerSize;
35
- color?: string;
36
- }) => {
37
- const base = parseInt(size.replace('px', ''));
38
- const ballSize = Array.from({ length: 7 }, (_, i) => `${(i * base / 15 / 7).toFixed(2)}px`);
39
- const css: any = {
40
- width: size,
41
- height: size,
42
- display: 'flex',
43
- placeItems: 'center',
44
- justifyContent: 'center',
45
- '.spinner02-box': {
46
- '--spin02-w': `${base / 2 - 3}px`,
47
- width: '4px',
48
- height: '4px',
49
- borderRadius: '50%',
50
- color,
51
- boxShadow: `
52
- calc(1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 0,
53
- calc(0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[1]},
54
- calc(0*var(--spin02-w)) calc(1*var(--spin02-w)) 0 ${ballSize[2]},
55
- calc(-0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[3]},
56
- calc(-1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 ${ballSize[4]},
57
- calc(-0.707*var(--spin02-w)) calc(-0.707*var(--spin02-w)) 0 ${ballSize[5]},
58
- calc(0*var(--spin02-w)) calc(-1*var(--spin02-w)) 0 ${ballSize[6]}`,
59
- animation: 'spinner02 1s infinite steps(8)',
60
- },
61
- '@keyframes spinner02': {
62
- '100%': { transform: 'rotate(1turn)' },
63
- },
64
- };
65
- return (
66
- <div css={css}>
67
- <div class='spinner02-box'></div>
68
- </div>
69
- );
70
- };
71
-
72
- // color should be space splited RGB colors
73
- export const Spinner03 = ({ size = SpinnerSize.Medium, colorRGB = '55 55 55' }: { size?: SpinnerSize; colorRGB?: string }) => {
74
- const css: any = {
75
- width: size,
76
- height: size,
77
- aspectRatio: 1,
78
- display: 'grid',
79
- borderRadius: '50%',
80
- background: `linear-gradient(0deg, rgb(${colorRGB} / 50%) 30%, #0000 0 70%, rgb(${colorRGB} / 100%) 0) 50% / 8% 100%, linear-gradient(90deg, rgb(${colorRGB} / 25%) 30%, #0000 0 70%, rgb(${colorRGB} / 75%) 0) 50% / 100% 8%`,
81
- backgroundRepeat: 'no-repeat',
82
- animation: 'spinner03 1s infinite steps(12)',
83
- '&::before, &::after': {
84
- content: '""',
85
- gridArea: '1/1',
86
- borderRadius: '50%',
87
- background: 'inherit',
88
- opacity: 0.915,
89
- transform: 'rotate(30deg)',
90
- },
91
- '&::after': {
92
- opacity: 0.83,
93
- transform: 'rotate(60deg)',
94
- },
95
- '@keyframes spinner03': {
96
- '100%': { transform: 'rotate(1turn)' },
97
- },
98
- };
99
- return <div css={css}></div>;
100
- };
1
+ export enum SpinnerSize {
2
+ Small = '22px',
3
+ Medium = '30px',
4
+ Large = '40px',
5
+ LargeLarge = '60px',
6
+ }
7
+ export const Spinner01 = ({
8
+ size = SpinnerSize.Medium,
9
+ color = 'var(--primary-color)',
10
+ }: {
11
+ size?: SpinnerSize;
12
+ color?: string;
13
+ }) => {
14
+ const borderWidth =
15
+ size === SpinnerSize.Small || size === SpinnerSize.Medium ? '4px' : size === SpinnerSize.Large ? '6px' : '9px';
16
+ const css: any = {
17
+ width: size,
18
+ aspectRatio: 1,
19
+ borderRadius: '50%',
20
+ background: `radial-gradient(farthest-side,${color} 94%,#0000) top/8px 8px no-repeat, conic-gradient(#0000 30%,${color})`,
21
+ '-webkit-mask': `radial-gradient(farthest-side,#0000 calc(100% - ${borderWidth}),#000 0)`,
22
+ animation: 'spinner01 1s infinite linear',
23
+ '@keyframes spinner01': {
24
+ '100%': { transform: 'rotate(1turn)' },
25
+ },
26
+ };
27
+ return <div css={css}></div>;
28
+ };
29
+
30
+ export const Spinner02 = ({
31
+ size = SpinnerSize.Medium,
32
+ color = 'var(--primary-color)',
33
+ }: {
34
+ size?: SpinnerSize;
35
+ color?: string;
36
+ }) => {
37
+ const base = parseInt(size.replace('px', ''));
38
+ const ballSize = Array.from({ length: 7 }, (_, i) => `${((i * base) / 15 / 7).toFixed(2)}px`);
39
+ const css: any = {
40
+ width: size,
41
+ height: size,
42
+ display: 'flex',
43
+ placeItems: 'center',
44
+ justifyContent: 'center',
45
+ '.spinner02-box': {
46
+ '--spin02-w': `${base / 2 - 3}px`,
47
+ width: '4px',
48
+ height: '4px',
49
+ borderRadius: '50%',
50
+ color,
51
+ boxShadow: `
52
+ calc(1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 0,
53
+ calc(0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[1]},
54
+ calc(0*var(--spin02-w)) calc(1*var(--spin02-w)) 0 ${ballSize[2]},
55
+ calc(-0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[3]},
56
+ calc(-1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 ${ballSize[4]},
57
+ calc(-0.707*var(--spin02-w)) calc(-0.707*var(--spin02-w)) 0 ${ballSize[5]},
58
+ calc(0*var(--spin02-w)) calc(-1*var(--spin02-w)) 0 ${ballSize[6]}`,
59
+ animation: 'spinner02 1s infinite steps(8)',
60
+ },
61
+ '@keyframes spinner02': {
62
+ '100%': { transform: 'rotate(1turn)' },
63
+ },
64
+ };
65
+ return (
66
+ <div css={css}>
67
+ <div class='spinner02-box'></div>
68
+ </div>
69
+ );
70
+ };
71
+
72
+ // color should be space splited RGB colors
73
+ export const Spinner03 = ({
74
+ size = SpinnerSize.Medium,
75
+ colorRGB = '55 55 55',
76
+ }: {
77
+ size?: SpinnerSize;
78
+ colorRGB?: string;
79
+ }) => {
80
+ const css: any = {
81
+ width: size,
82
+ height: size,
83
+ aspectRatio: 1,
84
+ display: 'grid',
85
+ borderRadius: '50%',
86
+ background: `linear-gradient(0deg, rgb(${colorRGB} / 50%) 30%, #0000 0 70%, rgb(${colorRGB} / 100%) 0) 50% / 8% 100%, linear-gradient(90deg, rgb(${colorRGB} / 25%) 30%, #0000 0 70%, rgb(${colorRGB} / 75%) 0) 50% / 100% 8%`,
87
+ backgroundRepeat: 'no-repeat',
88
+ animation: 'spinner03 1s infinite steps(12)',
89
+ '&::before, &::after': {
90
+ content: '""',
91
+ gridArea: '1/1',
92
+ borderRadius: '50%',
93
+ background: 'inherit',
94
+ opacity: 0.915,
95
+ transform: 'rotate(30deg)',
96
+ },
97
+ '&::after': {
98
+ opacity: 0.83,
99
+ transform: 'rotate(60deg)',
100
+ },
101
+ '@keyframes spinner03': {
102
+ '100%': { transform: 'rotate(1turn)' },
103
+ },
104
+ };
105
+ return <div css={css}></div>;
106
+ };
@@ -1,66 +1,66 @@
1
- import { bindGlobalStyle, CssProps, RefProps } from 'lupine.components';
2
-
3
- export type StarsHookComponentProps = {
4
- setValue: (value: number) => void;
5
- getValue: () => number;
6
- };
7
- export type StarsComponentProps = {
8
- maxLength: number;
9
- value: number;
10
- onChange?: (value: number) => void;
11
- hook?: StarsHookComponentProps;
12
- fontSize?: string;
13
- };
14
- export const StarsComponent = (props: StarsComponentProps) => {
15
- const css: CssProps = {
16
- display: 'flex',
17
- flexDirection: 'row',
18
- '.stars-label': {
19
- color: '#9d9d9d',
20
- cursor: 'pointer',
21
- display: 'flex',
22
- alignItems: 'center',
23
- },
24
- '.stars-label.active': {
25
- color: 'blue',
26
- },
27
- '.stars-label .full, .stars-label.active .outline': {
28
- display: 'none',
29
- },
30
- '.stars-label.active .full, .stars-label .outline': {
31
- display: 'inline',
32
- },
33
- };
34
- bindGlobalStyle('stars-box', css);
35
-
36
- const setValue = (value: number) => {
37
- props.value = value;
38
- const stars = ref.$all('.stars-label') as NodeListOf<Element>;
39
- stars.forEach((star, index) => {
40
- star.classList.toggle('active', index < value);
41
- });
42
- };
43
- if (props.hook) {
44
- props.hook.setValue = (value) => {
45
- setValue(value);
46
- };
47
- props.hook.getValue = () => props.value;
48
- }
49
- const ref: RefProps = {};
50
- return (
51
- <div style={{ fontSize: props.fontSize || '20px' }} ref={ref} class='stars-box'>
52
- {Array.from({ length: props.maxLength }).map((value, index) => (
53
- <label
54
- class={'stars-label' + (index < props.value ? ' active' : '')}
55
- onClick={() => {
56
- setValue(index + 1);
57
- props.onChange?.(index + 1);
58
- }}
59
- >
60
- <i class='ifc-icon ma-cards-heart full'></i>
61
- <i class='ifc-icon ma-cards-heart-outline outline'></i>
62
- </label>
63
- ))}
64
- </div>
65
- );
66
- };
1
+ import { bindGlobalStyle, CssProps, RefProps } from 'lupine.components';
2
+
3
+ export type StarsHookComponentProps = {
4
+ setValue: (value: number) => void;
5
+ getValue: () => number;
6
+ };
7
+ export type StarsComponentProps = {
8
+ maxLength: number;
9
+ value: number;
10
+ onChange?: (value: number) => void;
11
+ hook?: StarsHookComponentProps;
12
+ fontSize?: string;
13
+ };
14
+ export const StarsComponent = (props: StarsComponentProps) => {
15
+ const css: CssProps = {
16
+ display: 'flex',
17
+ flexDirection: 'row',
18
+ '.stars-label': {
19
+ color: '#9d9d9d',
20
+ cursor: 'pointer',
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ },
24
+ '.stars-label.active': {
25
+ color: 'blue',
26
+ },
27
+ '.stars-label .full, .stars-label.active .outline': {
28
+ display: 'none',
29
+ },
30
+ '.stars-label.active .full, .stars-label .outline': {
31
+ display: 'inline',
32
+ },
33
+ };
34
+ bindGlobalStyle('stars-box', css);
35
+
36
+ const setValue = (value: number) => {
37
+ props.value = value;
38
+ const stars = ref.$all('.stars-label') as NodeListOf<Element>;
39
+ stars.forEach((star, index) => {
40
+ star.classList.toggle('active', index < value);
41
+ });
42
+ };
43
+ if (props.hook) {
44
+ props.hook.setValue = (value) => {
45
+ setValue(value);
46
+ };
47
+ props.hook.getValue = () => props.value;
48
+ }
49
+ const ref: RefProps = {};
50
+ return (
51
+ <div style={{ fontSize: props.fontSize || '20px' }} ref={ref} class='stars-box'>
52
+ {Array.from({ length: props.maxLength }).map((value, index) => (
53
+ <label
54
+ class={'stars-label' + (index < props.value ? ' active' : '')}
55
+ onClick={() => {
56
+ setValue(index + 1);
57
+ props.onChange?.(index + 1);
58
+ }}
59
+ >
60
+ <i class='ifc-icon ma-cards-heart full'></i>
61
+ <i class='ifc-icon ma-cards-heart-outline outline'></i>
62
+ </label>
63
+ ))}
64
+ </div>
65
+ );
66
+ };
@@ -1,24 +1,24 @@
1
- // this is not a good approach because if one svg file is used in multiple places
2
- // then the svg string will be rendered multiple times.
3
- export const Svg = ({
4
- children,
5
- width,
6
- height,
7
- color,
8
- }: {
9
- children: string;
10
- width?: string;
11
- height?: string;
12
- color?: string;
13
- }) => {
14
- const css: any = {
15
- svg: {
16
- maxWidth: '100%',
17
- maxHeight: '100%',
18
- width,
19
- height,
20
- fill: color,
21
- },
22
- };
23
- return <div css={css}>{children}</div>;
24
- };
1
+ // this is not a good approach because if one svg file is used in multiple places
2
+ // then the svg string will be rendered multiple times.
3
+ export const Svg = ({
4
+ children,
5
+ width,
6
+ height,
7
+ color,
8
+ }: {
9
+ children: string;
10
+ width?: string;
11
+ height?: string;
12
+ color?: string;
13
+ }) => {
14
+ const css: any = {
15
+ svg: {
16
+ maxWidth: '100%',
17
+ maxHeight: '100%',
18
+ width,
19
+ height,
20
+ fill: color,
21
+ },
22
+ };
23
+ return <div css={css}>{children}</div>;
24
+ };