@functionalcms/svelte-components 2.1.12 → 2.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.
@@ -1,22 +1,22 @@
1
- <style>
2
- a {
3
- display: var(--functional-logo-display, 'inline-block');
4
- }
5
- a img {
6
- width: 80vw;
7
- }
8
-
9
- @media (min-width: 960px) {
10
- a img {
11
- width: 100%;
12
- }
13
- }
14
- </style>
15
-
1
+ <style>
2
+ a {
3
+ display: var(--functional-logo-display, 'inline-block');
4
+ }
5
+ a img {
6
+ width: 80vw;
7
+ }
8
+
9
+ @media (min-width: 960px) {
10
+ a img {
11
+ width: 100%;
12
+ }
13
+ }
14
+ </style>
15
+
16
16
  <script>export let companyName;
17
17
  export let logoUrl;
18
- </script>
19
-
20
- <a href="/">
21
- <img src={logoUrl} alt={companyName} />
18
+ </script>
19
+
20
+ <a href="/">
21
+ <img src={logoUrl} alt={companyName} />
22
22
  </a>
@@ -0,0 +1,75 @@
1
+ @import '../../../node_modules/agnostic-svelte/css/common.min';
2
+
3
+ html, body, body > div { height: 100%; }
4
+
5
+ .fw { width:100%; }
6
+
7
+ .flex-row { flex-direction: row; }
8
+ .flex-column { flex-direction: column; }
9
+ .flex-row-dynamic { flex-direction: column; }
10
+
11
+ .h0 { height: 0 !important; }
12
+ .h2 { height: var(--fluid-2) !important; }
13
+ .h4 { height: var(--fluid-4) !important; }
14
+ .h6 { height: var(--fluid-6) !important; }
15
+ .h8 { height: var(--fluid-8) !important; }
16
+ .h10 { height: var(--fluid-10) !important; }
17
+ .h12 { height: var(--fluid-12) !important; }
18
+ .h14 { height: var(--fluid-14) !important; }
19
+ .h16 { height: var(--fluid-16) !important; }
20
+ .h18 { height: var(--fluid-18) !important; }
21
+ .h20 { height: var(--fluid-20) !important; }
22
+ .h24 { height: var(--fluid-24) !important; }
23
+ .h32 { height: var(--fluid-32) !important; }
24
+ .h36 { height: var(--fluid-36) !important; }
25
+ .h40 { height: var(--fluid-40) !important; }
26
+ .h48 { height: var(--fluid-48) !important; }
27
+ .h56 { height: var(--fluid-56) !important; }
28
+ .h64 { height: var(--fluid-64) !important; }
29
+
30
+ .h33p { height: 33% !important; }
31
+ .h66p { height: 66% !important; }
32
+ .h25p { height: 25% !important; }
33
+ .h75p { height: 75% !important; }
34
+ .h50p { height: 50% !important; }
35
+
36
+ .w0 { width: 0 !important; }
37
+ .w2 { width: var(--fluid-2) !important; }
38
+ .w4 { width: var(--fluid-4) !important; }
39
+ .w6 { width: var(--fluid-6) !important; }
40
+ .w8 { width: var(--fluid-8) !important; }
41
+ .w10 { width: var(--fluid-10) !important; }
42
+ .w12 { width: var(--fluid-12) !important; }
43
+ .w14 { width: var(--fluid-14) !important; }
44
+ .w16 { width: var(--fluid-16) !important; }
45
+ .w18 { width: var(--fluid-18) !important; }
46
+ .w20 { width: var(--fluid-20) !important; }
47
+ .w24 { width: var(--fluid-24) !important; }
48
+ .w32 { width: var(--fluid-32) !important; }
49
+ .w36 { width: var(--fluid-36) !important; }
50
+ .w40 { width: var(--fluid-40) !important; }
51
+ .w48 { width: var(--fluid-48) !important; }
52
+ .w56 { width: var(--fluid-56) !important; }
53
+ .w64 { width: var(--fluid-64) !important; }
54
+
55
+ .w33p { width: 100% !important; }
56
+ .w66p { width: 100% !important; }
57
+ .w25p { width: 100% !important; }
58
+ .w75p { width: 100% !important; }
59
+ .w50p { width: 100% !important; }
60
+
61
+ @media (min-width: 960px) {
62
+ .flex-row-dynamic { flex-direction: row; }
63
+
64
+ .w33p { width: 33% !important; }
65
+ .w66p { width: 66% !important; }
66
+ .w25p { width: 25% !important; }
67
+ .w75p { width: 75% !important; }
68
+ .w50p { width: 50% !important; }
69
+
70
+ .h33p { height: 33% !important; }
71
+ .h66p { height: 66% !important; }
72
+ .h25p { height: 25% !important; }
73
+ .h75p { height: 75% !important; }
74
+ .h50p { height: 50% !important; }
75
+ }
package/dist/index.d.ts CHANGED
@@ -2,11 +2,11 @@ import FlatMenu from './components/menu/FlatMenu.svelte';
2
2
  import HamburgerMenu from './components/menu/HamburgerMenu.svelte';
3
3
  import { Visiblity, HeaderNavigationItem } from './components/menu/Menu.js';
4
4
  import Banner from './components/Banner.svelte';
5
- import Card from './components/Card.svelte';
6
5
  import Layout from './components/Layout.svelte';
7
6
  import Logo from './components/Logo.svelte';
8
7
  import SimpleFooter from './components/SimpleFooter.svelte';
9
8
  import Spacer from './components/Spacer.svelte';
10
9
  import Well from './components/Well.svelte';
11
10
  import { Justify, Placement, Orientation, Position, Sizes } from './components/Styling.js';
12
- export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Card, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes };
11
+ import { Card } from 'agnostic-svelte';
12
+ export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes, Card };
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import FlatMenu from './components/menu/FlatMenu.svelte';
3
3
  import HamburgerMenu from './components/menu/HamburgerMenu.svelte';
4
4
  import { Visiblity, HeaderNavigationItem } from './components/menu/Menu.js';
5
5
  import Banner from './components/Banner.svelte';
6
- import Card from './components/Card.svelte';
7
6
  import Layout from './components/Layout.svelte';
8
7
  import Logo from './components/Logo.svelte';
9
8
  import SimpleFooter from './components/SimpleFooter.svelte';
10
9
  import Spacer from './components/Spacer.svelte';
11
10
  import Well from './components/Well.svelte';
12
11
  import { Justify, Placement, Orientation, Position, Sizes } from './components/Styling.js';
13
- export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Card, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes };
12
+ import { Card } from 'agnostic-svelte';
13
+ export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes, Card };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
+ "build-css": "sass ./src/lib/css/properties.scss ./css/functional.css",
6
7
  "build": "vite build && npm run package",
7
8
  "preview": "vite preview",
8
- "package": "svelte-kit sync && svelte-package && publint",
9
+ "package": "npm run build-css && svelte-kit sync && svelte-package && publint",
9
10
  "prepublishOnly": "npm run package",
10
11
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
12
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
@@ -26,9 +27,9 @@
26
27
  "!dist/**/*.spec.*"
27
28
  ],
28
29
  "peerDependencies": {
30
+ "@sveltejs/kit": "^2.3.2",
29
31
  "agnostic-svelte": "^1.1.27",
30
- "svelte": "^4.2.8",
31
- "@sveltejs/kit": "^2.3.2"
32
+ "svelte": "^4.2.8"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@sveltejs/adapter-auto": "^3.1.0",
@@ -36,6 +37,7 @@
36
37
  "@sveltejs/vite-plugin-svelte": "^3.0.1",
37
38
  "agnostic-svelte": "^1.1.27",
38
39
  "publint": "^0.2.7",
40
+ "sass": "^1.69.7",
39
41
  "svelte": "^4.2.8",
40
42
  "svelte-check": "^3.6.2",
41
43
  "tslib": "^2.6.2",
@@ -1,137 +0,0 @@
1
- <style>
2
- /**
3
- * Cards
4
- *
5
- * I drew some inspiration from the article on media-query less cards:
6
- * https://css-tricks.com/how-to-make-a-media-query-less-card-component/
7
- */
8
- .card,
9
- .card-base {
10
- display: flex;
11
- flex-wrap: wrap;
12
- align-items: center;
13
- position: relative;
14
- box-sizing: border-box;
15
- width: 100%;
16
- }
17
-
18
- .card-border {
19
- border: 1px solid var(--functional-card-border-color, var(--functional-gray-light));
20
- }
21
-
22
- .card-rounded {
23
- border-radius: var(--functional-radius, 0.25rem);
24
- }
25
-
26
- .card-shadow {
27
- box-shadow:
28
- var(--functional-card-boxshadow1-offset-x, 0)
29
- var(--functional-card-boxshadow1-offset-y, 0.375rem)
30
- var(--functional-card-boxshadow1-blur, 0.5625rem)
31
- var(--functional-card-boxshadow1-color, rgb(6 6 6 / 7.5%)),
32
- var(--functional-card-boxshadow2-offset-x, 0) var(--functional-card-boxshadow2-offset-y, 0)
33
- var(--functional-card-boxshadow2-blur, 1px)
34
- var(--functional-card-boxshadow2-color, rgb(5 5 5 / 10%));
35
- border-radius: var(--functional-card-border-radius, var(--functional-radius, 0.25rem));
36
- overflow: hidden;
37
- }
38
-
39
- .card-shadow:hover {
40
- box-shadow:
41
- var(--functional-card-boxshadow1-offset-x, 0)
42
- var(--functional-card-boxshadow1-offset-y, 0.375rem)
43
- var(--functional-card-boxshadow1-blur, 0.875rem)
44
- var(--functional-card-boxshadow1-color, rgb(4 4 4 / 10%)),
45
- var(--functional-card-boxshadow2-offset-x, 0) var(--functional-card-boxshadow2-offset-y, 0)
46
- var(--functional-card-boxshadow2-blur, 2px)
47
- var(--functional-card-boxshadow2-color, rgb(3 3 3 / 10%));
48
- }
49
-
50
- /**
51
- * Animates the y position and box shadow on hover
52
- */
53
- .card-animated {
54
- transition:
55
- box-shadow ease-out 5s,
56
- transform var(--functional-timing-fast)
57
- cubic-bezier(
58
- var(--functional-card-cubic-1, 0.39),
59
- var(--functional-card-cubic-2, 0.575),
60
- var(--functional-card-cubic-3, 0.565),
61
- var(--functional-card-cubic-4, 1)
62
- );
63
- }
64
-
65
- .card-animated:hover {
66
- transform: translateY(var(--functional-card-translate-y-hover, -3px));
67
- transition:
68
- box-shadow ease-out var(--functional-timing-fast),
69
- transform var(--functional-timing-slow)
70
- cubic-bezier(
71
- var(--functional-card-cubic-1, 0.39),
72
- var(--functional-card-cubic-2, 0.575),
73
- var(--functional-card-cubic-3, 0.565),
74
- var(--functional-card-cubic-4, 1)
75
- );
76
- }
77
-
78
- @media (prefers-reduced-motion), (update: slow) {
79
- .card-animated,
80
- .card-animated:hover {
81
- transition-duration: 0.001ms !important;
82
- }
83
- }
84
-
85
- .card-stacked {
86
- flex-direction: column;
87
- }
88
-
89
- .card-success {
90
- background: var(--functional-action-light);
91
- color: var(--functional-action-dark);
92
- }
93
-
94
- .card-info {
95
- background: var(--functional-primary-light);
96
- color: var(--functional-primary-dark);
97
- }
98
-
99
- .card-error {
100
- background: var(--functional-error-light);
101
- color: var(--functional-error-dark);
102
- }
103
-
104
- .card-warning {
105
- background: var(--functional-warning-light);
106
- color: var(--functional-warning-dark);
107
- }
108
-
109
- </style>
110
-
111
- <script>
112
- export let isAnimated = false;
113
- export let isSkinned = true;
114
- export let isStacked = false;
115
- export let isShadow = false;
116
- export let isBorder = false;
117
- export let isRounded = false;
118
- export let type = "";
119
- export let css = "";
120
-
121
- let klasses = [
122
- isSkinned ? "card" : "card-base",
123
- isAnimated ? "card-animated" : "",
124
- isStacked ? "card-stacked" : "",
125
- isShadow ? "card-shadow" : "",
126
- isRounded ? "card-rounded" : "",
127
- isBorder ? "card-border" : "",
128
- type ? `card-${type}` : "",
129
- css ? `${css}` : "",
130
- ]
131
- .filter((klass) => klass.length)
132
- .join(" ");
133
- </script>
134
-
135
- <div class={klasses} on:click on:focus on:blur>
136
- <slot />
137
- </div>
@@ -1,49 +0,0 @@
1
- /** @typedef {typeof __propDef.props} CardProps */
2
- /** @typedef {typeof __propDef.events} CardEvents */
3
- /** @typedef {typeof __propDef.slots} CardSlots */
4
- export default class Card extends SvelteComponent<{
5
- type?: string | undefined;
6
- css?: string | undefined;
7
- isAnimated?: boolean | undefined;
8
- isSkinned?: boolean | undefined;
9
- isStacked?: boolean | undefined;
10
- isShadow?: boolean | undefined;
11
- isBorder?: boolean | undefined;
12
- isRounded?: boolean | undefined;
13
- }, {
14
- click: MouseEvent;
15
- focus: FocusEvent;
16
- blur: FocusEvent;
17
- } & {
18
- [evt: string]: CustomEvent<any>;
19
- }, {
20
- default: {};
21
- }> {
22
- }
23
- export type CardProps = typeof __propDef.props;
24
- export type CardEvents = typeof __propDef.events;
25
- export type CardSlots = typeof __propDef.slots;
26
- import { SvelteComponent } from "svelte";
27
- declare const __propDef: {
28
- props: {
29
- type?: string | undefined;
30
- css?: string | undefined;
31
- isAnimated?: boolean | undefined;
32
- isSkinned?: boolean | undefined;
33
- isStacked?: boolean | undefined;
34
- isShadow?: boolean | undefined;
35
- isBorder?: boolean | undefined;
36
- isRounded?: boolean | undefined;
37
- };
38
- events: {
39
- click: MouseEvent;
40
- focus: FocusEvent;
41
- blur: FocusEvent;
42
- } & {
43
- [evt: string]: CustomEvent<any>;
44
- };
45
- slots: {
46
- default: {};
47
- };
48
- };
49
- export {};
@@ -1,187 +0,0 @@
1
- :root {
2
- /* In light mode we willl have white text against a dark green background. */
3
- --functional-light-modelight: white;
4
- --functional-primary-modelight: #053337;
5
- --functional-primary-hover-modelight: #0a474c;
6
- /* In dark mode we'll invert the text color and use a much lighter shade of green */
7
- --functional-primary-modedark: #12adba;
8
- --functional-light-modedark: black;
9
- --functional-primary-hover-modedark: #1ec3d1;
10
- }
11
- :root {
12
- --functional-content-width: 70%;
13
- --functional-logo-display: inline-block;
14
- --well-margin-size: 15%;
15
- --functional-radius: 2em;
16
- --functional-timing-fast: 200ms;
17
- }
18
- :root {
19
- [color-scheme="light"] {
20
- color-scheme: light;
21
- --functional-primary-color: var(--functional-light-modelight);
22
- }
23
- [color-scheme="dark"] {
24
- color-scheme: dark;
25
- --functional-primary-color: var(--functional-light-modelight);
26
- }
27
- }
28
- /**
29
- * define agnostic varaibles based on Functional ones
30
- **/
31
- :root {
32
- --agnostic-primary-modelight: var(--functional-primary-modelight);
33
- --agnostic-primary-modedark: var(--functional-primary-modedark);
34
-
35
- --agnostic-radius: var(--functional-radius);
36
- --agnostic-timing-fast: var(--functional-timing-fast);
37
- }
38
- /**
39
- * Banner variables
40
- **/
41
- :root {
42
- --functional-banner-margin: 0px auto;
43
- --functional-banner-padding: 0px;
44
- --functional-banner-background: var(--functional-background-color);
45
- }
46
- /**
47
- * Menu variables
48
- **/
49
- :root {
50
- --functional-menu-background: var(--functional-secondary-color);
51
- --functional-menu-color: var(--agnostic-font-color);
52
- --functional-menu-margin: 0px;
53
- --functional-menu-padding: 0px;
54
- --functional-menu-align-items: inherit;
55
- --functional-menu-justify-content: inherit;
56
-
57
- --functional-menu-item-color: #fff;
58
- --functional-menu-item-margin: 0px var(--fluid-12);
59
- --functional-menu-item-padding: var(--fluid-20) var(--fluid-20) var(--fluid-8) var(--fluid-20);
60
- --functional-menu-item-background: var(--functional-background-color);
61
- --functional-menu-item-font-size: var(--fluid-24);
62
- --functional-menu-item-border-top: none;
63
- --functional-menu-item-border-right: none;
64
- --functional-menu-item-border-bottom: none;
65
- --functional-menu-item-border-left: none;
66
-
67
- --functional-menu-item-hover-margin: 0px var(--fluid-12);
68
- --functional-menu-item-hover-padding: var(--fluid-20) var(--fluid-20) var(--fluid-8) var(--fluid-20);
69
- --functional-menu-item-hover-font: bolder;
70
- --functional-menu-item-hover-color: var(--functional-primary-color);
71
- --functional-menu-item-hover-text-decoration: none;
72
- --functional-menu-item-hover-background: #fff;
73
- --functional-menu-item-hover-border: none;
74
- --functional-menu-item-hover-border-top: none;
75
- --functional-menu-item-hover-border-right: none;
76
- --functional-menu-item-hover-border-bottom: none;
77
- --functional-menu-item-hover-border-left: none;
78
-
79
- --functional-menu-item-selected-text-decoration-hover: none;
80
- --functional-menu-item-selected-background: #fff;
81
- --functional-menu-item-selected-border-top: none;
82
- --functional-menu-item-selected-border-right: none;
83
- --functional-menu-item-selected-border-bottom: 6px solid var(--functional-primary-color);
84
- --functional-menu-item-selected-border-left: none;
85
- }
86
- /**
87
- * Card variables
88
- **/
89
- :root {
90
- --functional-card-border-color: var(--functional-primary-color);
91
- --functional-card-boxshadow1-offset-x: 0;
92
- --functional-card-boxshadow1-offset-y: 0.375rem;
93
- --functional-card-boxshadow1-blur: 0.5625rem;
94
- --functional-card-boxshadow1-color: rgb(6 6 6 / 7.5%);
95
- --functional-card-boxshadow2-offset-x: 0;
96
- --functional-card-boxshadow2-offset-y: 0;
97
- --functional-card-boxshadow2-blur: 1px;
98
- --functional-card-boxshadow2-color: rgb(5 5 5 / 10%);
99
- --functional-card-border-radius: var(--functional-radius: 0.25rem);
100
- --functional-card-boxshadow1-offset-x: 0;
101
- --functional-card-boxshadow1-offset-y: 0.375rem;
102
- --functional-card-boxshadow1-blur: 0.875rem;
103
- --functional-card-boxshadow1-color: rgb(4 4 4 / 10%);
104
- --functional-card-boxshadow2-offset-x: 0;
105
- --functional-card-boxshadow2-offset-y: 0;
106
- --functional-card-boxshadow2-blur: 2px;
107
- --functional-card-boxshadow2-color: rgb(3 3 3 / 10%);
108
- --functional-card-cubic-1: 0.39;
109
- --functional-card-cubic-2: 0.575;
110
- --functional-card-cubic-3: 0.565;
111
- --functional-card-cubic-4: 1;
112
- --functional-card-translate-y-hover: -3px;
113
- }
114
-
115
- html, body, body > div { height: 100%; }
116
-
117
- .fw { width:100%; }
118
-
119
- .flex-row { flex-direction: row; }
120
- .flex-column { flex-direction: column; }
121
- .flex-row-dynamic { flex-direction: column; }
122
-
123
- .h0 { height: 0 !important; }
124
- .h2 { height: var(--fluid-2) !important; }
125
- .h4 { height: var(--fluid-4) !important; }
126
- .h6 { height: var(--fluid-6) !important; }
127
- .h8 { height: var(--fluid-8) !important; }
128
- .h10 { height: var(--fluid-10) !important; }
129
- .h12 { height: var(--fluid-12) !important; }
130
- .h14 { height: var(--fluid-14) !important; }
131
- .h16 { height: var(--fluid-16) !important; }
132
- .h18 { height: var(--fluid-18) !important; }
133
- .h20 { height: var(--fluid-20) !important; }
134
- .h24 { height: var(--fluid-24) !important; }
135
- .h32 { height: var(--fluid-32) !important; }
136
- .h36 { height: var(--fluid-36) !important; }
137
- .h40 { height: var(--fluid-40) !important; }
138
- .h48 { height: var(--fluid-48) !important; }
139
- .h56 { height: var(--fluid-56) !important; }
140
- .h64 { height: var(--fluid-64) !important; }
141
-
142
- .h33p { height: 33% !important; }
143
- .h66p { height: 66% !important; }
144
- .h25p { height: 25% !important; }
145
- .h75p { height: 75% !important; }
146
- .h50p { height: 50% !important; }
147
-
148
- .w0 { width: 0 !important; }
149
- .w2 { width: var(--fluid-2) !important; }
150
- .w4 { width: var(--fluid-4) !important; }
151
- .w6 { width: var(--fluid-6) !important; }
152
- .w8 { width: var(--fluid-8) !important; }
153
- .w10 { width: var(--fluid-10) !important; }
154
- .w12 { width: var(--fluid-12) !important; }
155
- .w14 { width: var(--fluid-14) !important; }
156
- .w16 { width: var(--fluid-16) !important; }
157
- .w18 { width: var(--fluid-18) !important; }
158
- .w20 { width: var(--fluid-20) !important; }
159
- .w24 { width: var(--fluid-24) !important; }
160
- .w32 { width: var(--fluid-32) !important; }
161
- .w36 { width: var(--fluid-36) !important; }
162
- .w40 { width: var(--fluid-40) !important; }
163
- .w48 { width: var(--fluid-48) !important; }
164
- .w56 { width: var(--fluid-56) !important; }
165
- .w64 { width: var(--fluid-64) !important; }
166
-
167
- .w33p { width: 100% !important; }
168
- .w66p { width: 100% !important; }
169
- .w25p { width: 100% !important; }
170
- .w75p { width: 100% !important; }
171
- .w50p { width: 100% !important; }
172
-
173
- @media (min-width: 960px) {
174
- .flex-row-dynamic { flex-direction: row; }
175
-
176
- .w33p { width: 33% !important; }
177
- .w66p { width: 66% !important; }
178
- .w25p { width: 25% !important; }
179
- .w75p { width: 75% !important; }
180
- .w50p { width: 50% !important; }
181
-
182
- .h33p { height: 33% !important; }
183
- .h66p { height: 66% !important; }
184
- .h25p { height: 25% !important; }
185
- .h75p { height: 75% !important; }
186
- .h50p { height: 50% !important; }
187
- }