lupine.web 1.0.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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/jsx-runtime/index.js +14 -0
  4. package/jsx-runtime/package.json +16 -0
  5. package/jsx-runtime/src/index.d.ts +2 -0
  6. package/package.json +51 -0
  7. package/src/assets/themes/base-themes.ts +16 -0
  8. package/src/assets/themes/dark-themes.ts +85 -0
  9. package/src/assets/themes/index.ts +4 -0
  10. package/src/assets/themes/light-themes.ts +92 -0
  11. package/src/assets/themes/shared-themes.ts +50 -0
  12. package/src/components/button-push-animation.tsx +138 -0
  13. package/src/components/button.tsx +55 -0
  14. package/src/components/drag-refresh.tsx +110 -0
  15. package/src/components/editable-label.tsx +83 -0
  16. package/src/components/float-window.tsx +226 -0
  17. package/src/components/grid.tsx +18 -0
  18. package/src/components/html-var.tsx +41 -0
  19. package/src/components/index.ts +36 -0
  20. package/src/components/input-with-title.tsx +24 -0
  21. package/src/components/link-item.tsx +13 -0
  22. package/src/components/link-list.tsx +62 -0
  23. package/src/components/menu-bar.tsx +220 -0
  24. package/src/components/menu-item-props.tsx +10 -0
  25. package/src/components/menu-sidebar.tsx +289 -0
  26. package/src/components/message-box.tsx +44 -0
  27. package/src/components/meta-data.tsx +54 -0
  28. package/src/components/meta-description.tsx +19 -0
  29. package/src/components/meta-title.tsx +19 -0
  30. package/src/components/modal.tsx +29 -0
  31. package/src/components/notice-message.tsx +119 -0
  32. package/src/components/paging-link.tsx +100 -0
  33. package/src/components/panel.tsx +24 -0
  34. package/src/components/popup-menu.tsx +218 -0
  35. package/src/components/progress.tsx +91 -0
  36. package/src/components/redirect.tsx +19 -0
  37. package/src/components/resizable-splitter.tsx +129 -0
  38. package/src/components/select-with-title.tsx +37 -0
  39. package/src/components/spinner.tsx +100 -0
  40. package/src/components/svg.tsx +24 -0
  41. package/src/components/tabs.tsx +252 -0
  42. package/src/components/text-glow.tsx +36 -0
  43. package/src/components/text-wave.tsx +54 -0
  44. package/src/components/theme-selector.tsx +35 -0
  45. package/src/components/toggle-base.tsx +260 -0
  46. package/src/components/toggle-switch.tsx +156 -0
  47. package/src/core/bind-attributes.ts +58 -0
  48. package/src/core/bind-lang.ts +51 -0
  49. package/src/core/bind-links.ts +16 -0
  50. package/src/core/bind-ref.ts +33 -0
  51. package/src/core/bind-styles.ts +180 -0
  52. package/src/core/bind-theme.ts +51 -0
  53. package/src/core/camel-to-hyphens.ts +3 -0
  54. package/src/core/core.ts +179 -0
  55. package/src/core/index.ts +15 -0
  56. package/src/core/mount-components.ts +259 -0
  57. package/src/core/page-loaded-events.ts +16 -0
  58. package/src/core/page-router.ts +170 -0
  59. package/src/core/replace-innerhtml.ts +10 -0
  60. package/src/core/server-cookie.ts +22 -0
  61. package/src/core/web-version.ts +12 -0
  62. package/src/global.d.ts +66 -0
  63. package/src/index.ts +15 -0
  64. package/src/jsx.ts +1041 -0
  65. package/src/lib/date-utils.ts +317 -0
  66. package/src/lib/debug-watch.ts +31 -0
  67. package/src/lib/deep-merge.ts +37 -0
  68. package/src/lib/document-ready.ts +36 -0
  69. package/src/lib/dom/calculate-text-width.ts +13 -0
  70. package/src/lib/dom/cookie.ts +41 -0
  71. package/src/lib/dom/download-stream.ts +17 -0
  72. package/src/lib/dom/download.ts +12 -0
  73. package/src/lib/dom/index.ts +71 -0
  74. package/src/lib/dynamical-load.ts +138 -0
  75. package/src/lib/format-bytes.ts +11 -0
  76. package/src/lib/index.ts +17 -0
  77. package/src/lib/lite-dom.ts +227 -0
  78. package/src/lib/logger.ts +55 -0
  79. package/src/lib/message-hub.ts +105 -0
  80. package/src/lib/observable.ts +188 -0
  81. package/src/lib/promise-timeout.ts +1 -0
  82. package/src/lib/simple-storage.ts +40 -0
  83. package/src/lib/stop-propagation.ts +7 -0
  84. package/src/lib/unique-id.ts +39 -0
  85. package/src/lib/upload-file.ts +68 -0
  86. package/src/lib/web-env.ts +98 -0
  87. package/src/models/index.ts +2 -0
  88. package/src/models/simple-storage-props.ts +9 -0
  89. package/src/models/to-client-delivery-props.ts +8 -0
  90. package/src/types/css-styles.ts +814 -0
  91. package/src/types/css-types.ts +17 -0
  92. package/src/types/index.ts +6 -0
  93. package/src/types/media-query.ts +93 -0
  94. package/tsconfig.json +113 -0
@@ -0,0 +1,17 @@
1
+ export enum ContentPosition {
2
+ center = 'center',
3
+ end = 'end',
4
+ flexEnd = 'flex-end',
5
+ flexStart = 'flex-start',
6
+ start = 'start',
7
+ }
8
+
9
+ export type SelfPosition = 'center' | 'end' | 'flex-end' | 'flex-start' | 'self-end' | 'self-start' | 'start';
10
+
11
+ export enum Position {
12
+ absolute = 'absolute',
13
+ fixed = 'fixed',
14
+ relative = 'relative',
15
+ static = 'static',
16
+ sticky = 'sticky',
17
+ }
@@ -0,0 +1,6 @@
1
+ import { CssProps } from '../jsx';
2
+ export { CssProps as CSS };
3
+
4
+ export * from './css-styles';
5
+ export * from './css-types';
6
+ export * from './media-query';
@@ -0,0 +1,93 @@
1
+ // export enum MediaQuery {
2
+ // ExtraSmall = "@media only screen and (max-width: 480px)",
3
+ // Mobile = "@media only screen and (min-width: 481px) and (max-width: 767px)",
4
+ // Tablet = "@media only screen and (min-width: 768px) and (max-width: 991px)",
5
+ // Desktop = "@media only screen and (min-width: 992px) and (max-width: 1399px)",
6
+ // ExtraLarge = "@media only screen and (min-width: 1400px)",
7
+ // }
8
+
9
+ /*
10
+ --> Bootstrap – 576px, 768px, 992px, 1200px, 1400px
11
+ Tailwind - 640px, 768px, 1024px, 1280px, 1536px
12
+ Foundation: <640px, ≥640px, ≥1200px
13
+ Bulma: <769px, ≥769px, ≥1024px, ≥1216px, and ≥1408px
14
+ Semantic UI: <768px, ≥768px, ≥992px, ≥1400px, ≥1920px
15
+ Primer: <544px, ≥544px, ≥768px, ≥1012px, ≥1280px
16
+ UIKit: <479px, ≥480px, ≥768px, ≥960px, ≥1200px
17
+ */
18
+
19
+ export class MediaQueryMaxWidth {
20
+ private static _ExtraSmall = '480px';
21
+ private static _Mobile = '767px'; // Grid: col-1, 12
22
+ private static _Tablet = '991px'; // Grid: col-1-md, 12-md
23
+ private static _Desktop = '1399px'; // Grid: col-1-lg, 12-lg
24
+ public static get ExtraSmallMax() {
25
+ return MediaQueryMaxWidth._ExtraSmall;
26
+ }
27
+ public static get MobileMax() {
28
+ return MediaQueryMaxWidth._Mobile;
29
+ }
30
+ public static get TabletMax() {
31
+ return MediaQueryMaxWidth._Tablet;
32
+ }
33
+ public static get DesktopMax() {
34
+ return MediaQueryMaxWidth._Desktop;
35
+ }
36
+
37
+ public static set ExtraSmallMax(value: string) {
38
+ MediaQueryMaxWidth._ExtraSmall = value;
39
+ }
40
+ public static set MobileMax(value: string) {
41
+ MediaQueryMaxWidth._Mobile = value;
42
+ }
43
+ public static set TabletMax(value: string) {
44
+ MediaQueryMaxWidth._Tablet = value;
45
+ }
46
+ public static set DesktopMax(value: string) {
47
+ MediaQueryMaxWidth._Desktop = value;
48
+ }
49
+ }
50
+ export class MediaQueryRange {
51
+ public static get ExtraSmallBelow() {
52
+ return `@media only screen and (max-width: ${MediaQueryMaxWidth.ExtraSmallMax})`;
53
+ }
54
+ public static get ExtraSmallAbove() {
55
+ return `@media only screen and (min-width: ${MediaQueryMaxWidth.ExtraSmallMax})`;
56
+ }
57
+ public static get MobileBelow() {
58
+ return `@media only screen and (max-width: ${MediaQueryMaxWidth.MobileMax})`;
59
+ }
60
+ public static get MobileAbove() {
61
+ return `@media only screen and (min-width: ${MediaQueryMaxWidth.MobileMax})`;
62
+ }
63
+ public static get TabletBelow() {
64
+ return `@media only screen and (max-width: ${MediaQueryMaxWidth.TabletMax})`;
65
+ }
66
+ public static get TabletAbove() {
67
+ return `@media only screen and (min-width: ${MediaQueryMaxWidth.TabletMax})`;
68
+ }
69
+ public static get DesktopBelow() {
70
+ return `@media only screen and (max-width: ${MediaQueryMaxWidth.DesktopMax})`;
71
+ }
72
+ public static get DesktopAbove() {
73
+ return `@media only screen and (min-width: ${MediaQueryMaxWidth.DesktopMax})`;
74
+ }
75
+ }
76
+
77
+ export enum MediaQueryDirection {
78
+ Below,
79
+ Above,
80
+ }
81
+ export function adjustedMediaQueryRange(
82
+ direction: MediaQueryDirection,
83
+ mediaQueryWidth: string,
84
+ adjustWidth: number
85
+ ): string {
86
+ const adjustedWidth = Number.parseInt(mediaQueryWidth) + adjustWidth;
87
+ if (direction === MediaQueryDirection.Below) {
88
+ return `@media only screen and (max-width: ${adjustedWidth}px)`;
89
+ } else {
90
+ // if (direction === MediaQueryRangeDirection.Above) {
91
+ return `@media only screen and (min-width: ${adjustedWidth}px)`;
92
+ }
93
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ // "compileOnSave": false,
3
+ "compilerOptions": {
4
+ /* Visit https://aka.ms/tsconfig to read more about this file */
5
+
6
+ /* Projects */
7
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
8
+ "composite": true /* Enable constraints that allow a TypeScript project to be used with project references. */,
9
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
10
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
11
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
12
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
13
+
14
+ /* Language and Environment */
15
+ "target": "es2017" /* es2016, es6 Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
16
+ "lib": [
17
+ "es2016",
18
+ "es6",
19
+ "dom"
20
+ ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
21
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
22
+ "experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */,
23
+ "emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */,
24
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
25
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
26
+ "jsxImportSource": "lupine.js" /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */,
27
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
28
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
29
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
30
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
31
+
32
+ /* Modules */
33
+ // "module": "commonjs", amd, es2015 /* Specify what module code is generated. */,
34
+ "module": "amd" /* Specify what module code is generated. */,
35
+ // "rootDir": "./" /* Specify the root folder within your source files. */,
36
+ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
37
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
38
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
39
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
40
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
41
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
42
+ "types": ["node", "lupine.js"],
43
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
44
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
45
+ // "resolveJsonModule": true /* Enable importing .json files. */,
46
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
47
+
48
+ /* JavaScript Support */
49
+ "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
50
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
51
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
52
+
53
+ /* Emit */
54
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
55
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
56
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
57
+ "sourceMap": true /* Create source map files for emitted JavaScript files. */,
58
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
59
+ "outFile": "./dist/build.js",
60
+ "outDir": "./dist" /* Specify an output folder for all emitted files. */,
61
+ // "removeComments": true, /* Disable emitting comments. */
62
+ // "noEmit": true, /* Disable emitting files from a compilation. */
63
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
64
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
65
+ "downlevelIteration": true /* Emit more compliant, but verbose and less performant JavaScript for iteration. */,
66
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
67
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
68
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
69
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
70
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
71
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
72
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
73
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
74
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
75
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
76
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
77
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
78
+
79
+ /* Interop Constraints */
80
+ // "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
81
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
82
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
83
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
84
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
85
+
86
+ /* Type Checking */
87
+ "strict": true /* Enable all strict type-checking options. */,
88
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
89
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
90
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
91
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
92
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
93
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
94
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
95
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
96
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
97
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
98
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
99
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
100
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
101
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
102
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
103
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
104
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
105
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
106
+
107
+ /* Completeness */
108
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
109
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
110
+ },
111
+ "include": ["src/**/*.ts", "src/**/*.tsx"]
112
+ // "exclude": ["node_modules"]
113
+ }