@sharadox/sharadox-web-library 0.6.5 → 0.7.0
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/README.md +46 -8
- package/distribution/action/send-contact/index.d.ts +5 -6
- package/distribution/action/send-contact/index.d.ts.map +1 -1
- package/distribution/action/send-contact/index.js +13 -49
- package/distribution/action/send-contact/index.js.map +1 -1
- package/distribution/action/send-contact/type.d.ts +1 -3
- package/distribution/action/send-contact/type.d.ts.map +1 -1
- package/distribution/component/button/index.module.css +1 -58
- package/distribution/component/button/index.module.scss +60 -0
- package/distribution/component/capability/index.js +2 -2
- package/distribution/component/capability/index.module.css +1 -94
- package/distribution/component/capability/index.module.scss +85 -0
- package/distribution/component/capability/type.d.ts +1 -1
- package/distribution/component/consent/index.d.ts +1 -4
- package/distribution/component/consent/index.d.ts.map +1 -1
- package/distribution/component/consent/index.js +19 -32
- package/distribution/component/consent/index.js.map +1 -1
- package/distribution/component/consent/index.module.css +1 -183
- package/distribution/component/consent/index.module.scss +45 -0
- package/distribution/component/consent/preferences-link/index.js +1 -1
- package/distribution/component/consent/type.d.ts +1 -1
- package/distribution/component/contact/form/index.d.ts.map +1 -1
- package/distribution/component/contact/form/index.js +4 -4
- package/distribution/component/contact/form/index.js.map +1 -1
- package/distribution/component/contact/form/index.module.css +1 -168
- package/distribution/component/contact/form/index.module.scss +163 -0
- package/distribution/component/contact/form/type.d.ts +1 -1
- package/distribution/component/contact/index.js +2 -2
- package/distribution/component/contact/index.module.css +1 -56
- package/distribution/component/contact/index.module.scss +52 -0
- package/distribution/component/contact/type.d.ts +1 -1
- package/distribution/component/cross/index.module.css +1 -53
- package/distribution/component/cross/index.module.scss +50 -0
- package/distribution/component/eyebrow/index.module.css +1 -9
- package/distribution/component/eyebrow/index.module.scss +9 -0
- package/distribution/component/footer/index.js +4 -4
- package/distribution/component/footer/index.js.map +1 -1
- package/distribution/component/footer/index.module.css +1 -138
- package/distribution/component/footer/index.module.scss +125 -0
- package/distribution/component/footer/type.d.ts +1 -1
- package/distribution/component/globe/index.d.ts +2 -2
- package/distribution/component/globe/index.d.ts.map +1 -1
- package/distribution/component/globe/index.js +23 -32
- package/distribution/component/globe/index.js.map +1 -1
- package/distribution/component/globe/index.module.css +1 -25
- package/distribution/component/globe/index.module.scss +7 -0
- package/distribution/component/hero/guide/index.module.css +1 -97
- package/distribution/component/hero/guide/index.module.scss +94 -0
- package/distribution/component/hero/index.js +1 -1
- package/distribution/component/hero/index.module.css +1 -124
- package/distribution/component/hero/index.module.scss +109 -0
- package/distribution/component/hero/type.d.ts +1 -1
- package/distribution/component/language-switch/index.js +4 -4
- package/distribution/component/language-switch/index.js.map +1 -1
- package/distribution/component/language-switch/index.module.css +1 -20
- package/distribution/component/language-switch/index.module.scss +22 -0
- package/distribution/component/language-switch/type.d.ts +1 -1
- package/distribution/component/marquee/index.js +1 -1
- package/distribution/component/marquee/index.module.css +1 -43
- package/distribution/component/marquee/index.module.scss +39 -0
- package/distribution/component/navigation/index.js +1 -1
- package/distribution/component/navigation/index.module.css +1 -81
- package/distribution/component/navigation/index.module.scss +76 -0
- package/distribution/component/navigation/type.d.ts +1 -1
- package/distribution/component/process/index.js +1 -1
- package/distribution/component/process/index.module.css +1 -43
- package/distribution/component/process/index.module.scss +40 -0
- package/distribution/component/process/step/index.module.css +1 -33
- package/distribution/component/process/step/index.module.scss +31 -0
- package/distribution/component/process/type.d.ts +1 -1
- package/distribution/component/section/index.module.css +1 -35
- package/distribution/component/section/index.module.scss +32 -0
- package/distribution/component/section-heading/index.js +1 -1
- package/distribution/component/section-heading/index.module.css +1 -7
- package/distribution/component/section-heading/index.module.scss +7 -0
- package/distribution/component/section-indicator/index.js +2 -2
- package/distribution/component/section-indicator/index.module.css +1 -145
- package/distribution/component/section-indicator/index.module.scss +143 -0
- package/distribution/component/section-indicator/type.d.ts +1 -1
- package/distribution/component/service-index/index.js +1 -1
- package/distribution/component/service-index/index.module.css +1 -88
- package/distribution/component/service-index/index.module.scss +83 -0
- package/distribution/component/service-index/type.d.ts +1 -1
- package/distribution/component/services/campaign-visual/index.js +2 -2
- package/distribution/component/services/campaign-visual/index.module.css +1 -128
- package/distribution/component/services/campaign-visual/index.module.scss +122 -0
- package/distribution/component/services/campaign-visual/stage/index.js +3 -3
- package/distribution/component/services/campaign-visual/stage/index.js.map +1 -1
- package/distribution/component/services/campaign-visual/stage/type.d.ts +1 -1
- package/distribution/component/services/campaign-visual/type.d.ts +1 -1
- package/distribution/component/services/cell/index.js +2 -2
- package/distribution/component/services/cell/index.module.css +1 -86
- package/distribution/component/services/cell/index.module.scss +81 -0
- package/distribution/component/services/design-visual/index.js +1 -1
- package/distribution/component/services/design-visual/index.module.css +1 -130
- package/distribution/component/services/design-visual/index.module.scss +117 -0
- package/distribution/component/services/index.js +2 -2
- package/distribution/component/services/index.module.css +1 -84
- package/distribution/component/services/index.module.scss +66 -0
- package/distribution/component/services/mobile-visual/index.d.ts.map +1 -1
- package/distribution/component/services/mobile-visual/index.js +2 -1
- package/distribution/component/services/mobile-visual/index.js.map +1 -1
- package/distribution/component/services/mobile-visual/index.module.css +1 -104
- package/distribution/component/services/mobile-visual/index.module.scss +93 -0
- package/distribution/component/services/mobile-visual/type.d.ts +1 -1
- package/distribution/component/services/platform-visual/index.module.css +1 -46
- package/distribution/component/services/platform-visual/index.module.scss +39 -0
- package/distribution/component/services/social-visual/index.js +5 -5
- package/distribution/component/services/social-visual/index.js.map +1 -1
- package/distribution/component/services/social-visual/index.module.css +1 -131
- package/distribution/component/services/social-visual/index.module.scss +120 -0
- package/distribution/component/services/social-visual/type.d.ts +1 -1
- package/distribution/component/services/type.d.ts +1 -1
- package/distribution/component/services/web-visual/index.js +1 -1
- package/distribution/component/services/web-visual/index.module.css +1 -142
- package/distribution/component/services/web-visual/index.module.scss +132 -0
- package/distribution/component/share-image/index.d.ts +1 -2
- package/distribution/component/share-image/index.d.ts.map +1 -1
- package/distribution/component/share-image/index.js +3 -3
- package/distribution/component/share-image/index.js.map +1 -1
- package/distribution/component/share-image/type.d.ts +1 -1
- package/distribution/component/statement/index.js +1 -1
- package/distribution/component/statement/index.module.css +1 -11
- package/distribution/component/statement/index.module.scss +10 -0
- package/distribution/component/structured-data/index.d.ts.map +1 -1
- package/distribution/component/structured-data/index.js +48 -53
- package/distribution/component/structured-data/index.js.map +1 -1
- package/distribution/component/structured-data/type.d.ts +1 -1
- package/distribution/component/style-switch/index.d.ts +2 -2
- package/distribution/component/style-switch/index.d.ts.map +1 -1
- package/distribution/component/style-switch/index.js +11 -18
- package/distribution/component/style-switch/index.js.map +1 -1
- package/distribution/component/style-switch/index.module.css +1 -36
- package/distribution/component/style-switch/index.module.scss +37 -0
- package/distribution/component/style-switch/type.d.ts +1 -1
- package/distribution/component/touchpoint/index.js +3 -3
- package/distribution/component/touchpoint/index.module.css +1 -85
- package/distribution/component/touchpoint/index.module.scss +75 -0
- package/distribution/component/touchpoint/plate/index.module.css +1 -136
- package/distribution/component/touchpoint/plate/index.module.scss +129 -0
- package/distribution/component/touchpoint/type.d.ts +1 -1
- package/distribution/component/wordmark/index.module.css +1 -23
- package/distribution/component/wordmark/index.module.scss +22 -0
- package/distribution/content/locale/index.d.ts +6 -0
- package/distribution/content/locale/index.d.ts.map +1 -0
- package/distribution/content/locale/index.js +7 -0
- package/distribution/content/locale/index.js.map +1 -0
- package/distribution/{utility → content}/locale/type.d.ts +3 -2
- package/distribution/content/locale/type.d.ts.map +1 -0
- package/distribution/{utility → content}/locale/type.js.map +1 -1
- package/distribution/content/style/index.d.ts +47 -43
- package/distribution/content/style/index.d.ts.map +1 -1
- package/distribution/content/style/index.js +20 -13
- package/distribution/content/style/index.js.map +1 -1
- package/distribution/utility/separate/index.d.ts +6 -1
- package/distribution/utility/separate/index.d.ts.map +1 -1
- package/distribution/utility/separate/index.js +8 -2
- package/distribution/utility/separate/index.js.map +1 -1
- package/llms.txt +10 -0
- package/package.json +37 -28
- package/distribution/component/consent/toggle/index.d.ts +0 -4
- package/distribution/component/consent/toggle/index.d.ts.map +0 -1
- package/distribution/component/consent/toggle/index.js +0 -7
- package/distribution/component/consent/toggle/index.js.map +0 -1
- package/distribution/component/consent/toggle/type.d.ts +0 -10
- package/distribution/component/consent/toggle/type.d.ts.map +0 -1
- package/distribution/component/consent/toggle/type.js.map +0 -1
- package/distribution/component/cursor/index.d.ts +0 -3
- package/distribution/component/cursor/index.d.ts.map +0 -1
- package/distribution/component/cursor/index.js +0 -45
- package/distribution/component/cursor/index.js.map +0 -1
- package/distribution/component/cursor/index.module.css +0 -55
- package/distribution/component/globe/arc/index.d.ts +0 -4
- package/distribution/component/globe/arc/index.d.ts.map +0 -1
- package/distribution/component/globe/arc/index.js +0 -29
- package/distribution/component/globe/arc/index.js.map +0 -1
- package/distribution/component/globe/arc/type.d.ts +0 -12
- package/distribution/component/globe/arc/type.d.ts.map +0 -1
- package/distribution/component/globe/arc/type.js +0 -2
- package/distribution/component/globe/arc/type.js.map +0 -1
- package/distribution/component/globe/color/index.d.ts +0 -4
- package/distribution/component/globe/color/index.d.ts.map +0 -1
- package/distribution/component/globe/color/index.js +0 -16
- package/distribution/component/globe/color/index.js.map +0 -1
- package/distribution/component/globe/color/type.d.ts +0 -13
- package/distribution/component/globe/color/type.d.ts.map +0 -1
- package/distribution/component/globe/color/type.js +0 -2
- package/distribution/component/globe/color/type.js.map +0 -1
- package/distribution/component/globe/dots/index.d.ts +0 -4
- package/distribution/component/globe/dots/index.d.ts.map +0 -1
- package/distribution/component/globe/dots/index.js +0 -38
- package/distribution/component/globe/dots/index.js.map +0 -1
- package/distribution/component/globe/dots/type.d.ts +0 -7
- package/distribution/component/globe/dots/type.d.ts.map +0 -1
- package/distribution/component/globe/dots/type.js +0 -2
- package/distribution/component/globe/dots/type.js.map +0 -1
- package/distribution/component/globe/marker/index.d.ts +0 -4
- package/distribution/component/globe/marker/index.d.ts.map +0 -1
- package/distribution/component/globe/marker/index.js +0 -21
- package/distribution/component/globe/marker/index.js.map +0 -1
- package/distribution/component/globe/marker/type.d.ts +0 -9
- package/distribution/component/globe/marker/type.d.ts.map +0 -1
- package/distribution/component/globe/marker/type.js +0 -2
- package/distribution/component/globe/marker/type.js.map +0 -1
- package/distribution/component/globe/shader/arc/index.d.ts +0 -6
- package/distribution/component/globe/shader/arc/index.d.ts.map +0 -1
- package/distribution/component/globe/shader/arc/index.js +0 -24
- package/distribution/component/globe/shader/arc/index.js.map +0 -1
- package/distribution/component/globe/shader/atmosphere/index.d.ts +0 -6
- package/distribution/component/globe/shader/atmosphere/index.d.ts.map +0 -1
- package/distribution/component/globe/shader/atmosphere/index.js +0 -15
- package/distribution/component/globe/shader/atmosphere/index.js.map +0 -1
- package/distribution/component/globe/shader/body/index.d.ts +0 -6
- package/distribution/component/globe/shader/body/index.d.ts.map +0 -1
- package/distribution/component/globe/shader/body/index.js +0 -15
- package/distribution/component/globe/shader/body/index.js.map +0 -1
- package/distribution/component/globe/shader/dot/index.d.ts +0 -6
- package/distribution/component/globe/shader/dot/index.d.ts.map +0 -1
- package/distribution/component/globe/shader/dot/index.js +0 -29
- package/distribution/component/globe/shader/dot/index.js.map +0 -1
- package/distribution/component/globe/shader/glow-vertex/index.d.ts +0 -3
- package/distribution/component/globe/shader/glow-vertex/index.d.ts.map +0 -1
- package/distribution/component/globe/shader/glow-vertex/index.js +0 -9
- package/distribution/component/globe/shader/glow-vertex/index.js.map +0 -1
- package/distribution/component/globe/world/index.d.ts +0 -4
- package/distribution/component/globe/world/index.d.ts.map +0 -1
- package/distribution/component/globe/world/index.js +0 -39
- package/distribution/component/globe/world/index.js.map +0 -1
- package/distribution/component/globe/world/type.d.ts +0 -10
- package/distribution/component/globe/world/type.d.ts.map +0 -1
- package/distribution/component/globe/world/type.js +0 -2
- package/distribution/component/globe/world/type.js.map +0 -1
- package/distribution/component/locale-link/index.d.ts +0 -4
- package/distribution/component/locale-link/index.d.ts.map +0 -1
- package/distribution/component/locale-link/index.js +0 -9
- package/distribution/component/locale-link/index.js.map +0 -1
- package/distribution/component/locale-link/type.d.ts +0 -10
- package/distribution/component/locale-link/type.d.ts.map +0 -1
- package/distribution/component/locale-link/type.js +0 -2
- package/distribution/component/locale-link/type.js.map +0 -1
- package/distribution/hook/globe-drag/index.d.ts +0 -10
- package/distribution/hook/globe-drag/index.d.ts.map +0 -1
- package/distribution/hook/globe-drag/index.js +0 -99
- package/distribution/hook/globe-drag/index.js.map +0 -1
- package/distribution/hook/globe-drag/type.d.ts +0 -11
- package/distribution/hook/globe-drag/type.d.ts.map +0 -1
- package/distribution/hook/globe-drag/type.js +0 -2
- package/distribution/hook/globe-drag/type.js.map +0 -1
- package/distribution/hook/land-points/index.d.ts +0 -3
- package/distribution/hook/land-points/index.d.ts.map +0 -1
- package/distribution/hook/land-points/index.js +0 -17
- package/distribution/hook/land-points/index.js.map +0 -1
- package/distribution/style/token/index.css +0 -1
- package/distribution/utility/hex-channel/index.d.ts +0 -3
- package/distribution/utility/hex-channel/index.d.ts.map +0 -1
- package/distribution/utility/hex-channel/index.js +0 -8
- package/distribution/utility/hex-channel/index.js.map +0 -1
- package/distribution/utility/latitude-longitude-to-vector/index.d.ts +0 -7
- package/distribution/utility/latitude-longitude-to-vector/index.d.ts.map +0 -1
- package/distribution/utility/latitude-longitude-to-vector/index.js +0 -12
- package/distribution/utility/latitude-longitude-to-vector/index.js.map +0 -1
- package/distribution/utility/locale/index.d.ts +0 -6
- package/distribution/utility/locale/index.d.ts.map +0 -1
- package/distribution/utility/locale/index.js +0 -8
- package/distribution/utility/locale/index.js.map +0 -1
- package/distribution/utility/locale/type.d.ts.map +0 -1
- package/distribution/utility/locale/type.js +0 -2
- package/distribution/utility/parse-contact/index.d.ts +0 -4
- package/distribution/utility/parse-contact/index.d.ts.map +0 -1
- package/distribution/utility/parse-contact/index.js +0 -23
- package/distribution/utility/parse-contact/index.js.map +0 -1
- package/distribution/utility/parse-contact/type.d.ts +0 -20
- package/distribution/utility/parse-contact/type.d.ts.map +0 -1
- package/distribution/utility/parse-contact/type.js +0 -2
- package/distribution/utility/parse-contact/type.js.map +0 -1
- package/distribution/utility/web-gl-support/index.d.ts +0 -3
- package/distribution/utility/web-gl-support/index.d.ts.map +0 -1
- package/distribution/utility/web-gl-support/index.js +0 -11
- package/distribution/utility/web-gl-support/index.js.map +0 -1
- /package/distribution/{component/consent/toggle → content/locale}/type.js +0 -0
package/README.md
CHANGED
|
@@ -1,17 +1,55 @@
|
|
|
1
1
|
# @sharadox/sharadox-web-library
|
|
2
2
|
|
|
3
|
-
Everything sharadox.com
|
|
3
|
+
Everything that makes sharadox.com Sharadox: its content in English and Portuguese, branded components, the Sharadox styles and design helpers, and the contact-form configuration. It is imported by [sharadox-web-application](https://github.com/Sharadox/sharadox-web-application), which keeps only routes and configuration.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Everything generic comes from the open-source Sharadox libraries, configured here:
|
|
6
|
+
|
|
7
|
+
| Need | Library |
|
|
8
|
+
| ------------------------------------------- | -------------------------------------------- |
|
|
9
|
+
| Languages, translations, language links | `@sharadox/internationalization-web-library` |
|
|
10
|
+
| Metadata, structured data, share images | `@sharadox/metadata-web-library` |
|
|
11
|
+
| Styles (Black, White, System) | `@sharadox/style-web-library` |
|
|
12
|
+
| Cookie panel | `@sharadox/consent-web-library` |
|
|
13
|
+
| Reveal, scroll-lit words, counters, marquee | `@sharadox/animation-web-library` |
|
|
14
|
+
| Active section | `@sharadox/scroll-web-library` |
|
|
15
|
+
| Spotlight, tilt | `@sharadox/pointer-web-library` |
|
|
16
|
+
| Contact form action | `@sharadox/form-web-library` |
|
|
17
|
+
| The 3D globe | `@sharadox/globe-web-library` |
|
|
18
|
+
| Utilities (`separate`, `classNames`…) | `@sharadox/web-library` |
|
|
19
|
+
|
|
20
|
+
## What is here
|
|
21
|
+
|
|
22
|
+
- **`content/`:** all copy and settings, one topic per folder.
|
|
23
|
+
- `locale`: `LOCALES`, built with `defineLocales`.
|
|
24
|
+
- `style`: `STYLES`, with Black and White in the colour group; colours live only here.
|
|
25
|
+
- `separator`: the Sharadox separator •.
|
|
26
|
+
- `consent`, `contact`, `services`, `site`, `globe`, and so on.
|
|
27
|
+
- **`component/`:** the page's branded parts:
|
|
28
|
+
- grid frame, `Cross` marks, navigation and footer
|
|
29
|
+
- hero and its guides, service index, statement, the five service cells and their live visuals
|
|
30
|
+
- the 3D touchpoint stack, capabilities sheet, process, contact, section indicator, style switch
|
|
31
|
+
- Sharadox wrappers around the shared globe and cookie panel, structured data, share image
|
|
32
|
+
- **`action/send-contact`:** `sendContact(form, ip)`, the shared contact action set up for Sharadox ("Contact • Name (Company)" subjects, sent to contact@sharadox.com as "Sharadox Web Application").
|
|
33
|
+
- **`utility/`:** `separate()` (the Sharadox separator) and the share card's horizon dots.
|
|
34
|
+
- **`style/token`:** Sass helpers (`tint()`, `shade()`, `dashed()`, `on-scroll()`, `below()`) used by every component's styles.
|
|
6
35
|
|
|
7
36
|
## Use in the application
|
|
8
37
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
```tsx
|
|
39
|
+
import { Hero } from "@sharadox/sharadox-web-library/component/hero";
|
|
40
|
+
import { LOCALES } from "@sharadox/sharadox-web-library/content/locale";
|
|
41
|
+
import { STYLES } from "@sharadox/sharadox-web-library/content/style";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- **Sass:** `@use "style/token" as *;` works once `node_modules/@sharadox/sharadox-web-library/distribution` is on the Sass load path (`@sharadox/next-js-configuration-web-library` does this).
|
|
45
|
+
- **Contact:** the application's server action reads the visitor's IP address and calls `sendContact(form, ip)`.
|
|
46
|
+
|
|
47
|
+
## Develop
|
|
48
|
+
|
|
49
|
+
- **Checks:** `pnpm verify` runs formatting, lint, type-check, tests at 100% coverage and the build (`library-build`).
|
|
50
|
+
- **How the tests run:** components render in a browser-like environment (`test-fixture/browser`), the whole page renders in both languages, and the contact email is checked against a local SMTP server.
|
|
51
|
+
- **Flow:** branches follow `<feature>.development` → `development` → `index`, and releases are `v<version>` tags on `index`.
|
|
14
52
|
|
|
15
53
|
## Licence
|
|
16
54
|
|
|
17
|
-
The source is public so anyone can read and verify it, but it is **not open source
|
|
55
|
+
The source is public so anyone can read and verify it, but it is **not open source**. It's under the Licença Sharadox de Código Verificável, versão 0.1.0: the [Portuguese text](LICENCA.md) is binding, with an [English translation](LICENSE.md). The Sharadox name, brand and design are reserved.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ContactState } from "@sharadox/sharadox-web-library/action/send-contact/type";
|
|
2
1
|
/**
|
|
3
|
-
* The contact form's work, called by the application's server action (which adds the visitor's
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The contact form's work, called by the application's server action (which adds the visitor's IP address). It
|
|
3
|
+
* emails contact@sharadox.com from the sending subdomain (`EMAIL_SENDER_ADDRESS`, through Amazon SES over SMTP:
|
|
4
|
+
* `EMAIL_SERVER_*`) as "Sharadox Web Application", with the visitor as reply-to and the subject
|
|
5
|
+
* "Contact • Name (Company)".
|
|
7
6
|
*/
|
|
8
|
-
export declare
|
|
7
|
+
export declare const sendContact: (form: FormData, ip: string) => Promise<import("@sharadox/form-web-library/contact-action/type").ContactState>;
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/action/send-contact/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/action/send-contact/index.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,gHAOtB,CAAC"}
|
|
@@ -1,54 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createEmailSender, EmailError, readEmailServerConfiguration } from "@sharadox/email-web-library";
|
|
1
|
+
import { createContactAction } from "@sharadox/form-web-library/contact-action";
|
|
3
2
|
import { CONTACT } from "@sharadox/sharadox-web-library/content/contact";
|
|
4
3
|
import { SITE } from "@sharadox/sharadox-web-library/content/site";
|
|
5
|
-
import {
|
|
6
|
-
import { parseContact } from "@sharadox/sharadox-web-library/utility/parse-contact";
|
|
7
|
-
import { createRateLimiter } from "@sharadox/web-library/form/rate-limit";
|
|
8
|
-
const allow = createRateLimiter({ window: 60 * 60 * 1000, maximum: 5 });
|
|
4
|
+
import { separate } from "@sharadox/sharadox-web-library/utility/separate";
|
|
9
5
|
/**
|
|
10
|
-
* The contact form's work, called by the application's server action (which adds the visitor's
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* The contact form's work, called by the application's server action (which adds the visitor's IP address). It
|
|
7
|
+
* emails contact@sharadox.com from the sending subdomain (`EMAIL_SENDER_ADDRESS`, through Amazon SES over SMTP:
|
|
8
|
+
* `EMAIL_SERVER_*`) as "Sharadox Web Application", with the visitor as reply-to and the subject
|
|
9
|
+
* "Contact • Name (Company)".
|
|
14
10
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const { name, email, company, message, locale, needs } = parsed.value;
|
|
23
|
-
if (!allow(ip))
|
|
24
|
-
return { status: "rate-limited" };
|
|
25
|
-
const subject = separate(CONTACT.subject, company ? `${name} (${company})` : name);
|
|
26
|
-
const needed = CONTACT.needs.options.filter((need) => needs.includes(need.key)).map((need) => need.en);
|
|
27
|
-
const text = `Name: ${name}\nEmail: ${email}\nCompany: ${company || "—"}\nNeeds: ${needed.join(", ") || "—"}\nLanguage: ${locale}\nIP: ${ip}\n\n${message}`;
|
|
28
|
-
const html = `<div style="font-family:-apple-system,Segoe UI,sans-serif;font-size:15px;line-height:1.6;color:#111">
|
|
29
|
-
<p style="color:#666;font-size:13px;margin:0 0 16px">New enquiry from sharadox.com (${escapeHtml(locale)})</p>
|
|
30
|
-
<p style="margin:0">${separate(`<b>${escapeHtml(name)}</b>`, company && escapeHtml(company))}<br><a href="mailto:${escapeHtml(email)}">${escapeHtml(email)}</a></p>
|
|
31
|
-
${needed.length ? `<p style="margin:12px 0 0;color:#444">${escapeHtml(separate(...needed))}</p>` : ""}
|
|
32
|
-
<hr style="border:0;border-top:1px solid #eee;margin:18px 0">
|
|
33
|
-
<p style="white-space:pre-wrap;margin:0">${escapeHtml(message)}</p></div>`;
|
|
34
|
-
try {
|
|
35
|
-
const configuration = readEmailServerConfiguration();
|
|
36
|
-
await createEmailSender(configuration).send({
|
|
37
|
-
from: { name: CONTACT.senderName, address: process.env.EMAIL_SENDER_ADDRESS || configuration.username },
|
|
38
|
-
// Replying to the email answers the visitor at the address they typed in the form.
|
|
39
|
-
to: SITE.email,
|
|
40
|
-
replyTo: { name: name.replace(/[\r\n]+/g, " "), address: email },
|
|
41
|
-
subject: subject.replace(/[\r\n]+/g, " ").slice(0, 300),
|
|
42
|
-
text,
|
|
43
|
-
html,
|
|
44
|
-
});
|
|
45
|
-
return { status: "sent" };
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
if (error instanceof EmailError && error.code === "invalid-message")
|
|
49
|
-
return { status: "invalid" };
|
|
50
|
-
console.error("contact: sending failed", error);
|
|
51
|
-
return { status: "failed" };
|
|
52
|
-
}
|
|
53
|
-
}
|
|
11
|
+
export const sendContact = createContactAction({
|
|
12
|
+
to: SITE.email,
|
|
13
|
+
senderName: CONTACT.senderName,
|
|
14
|
+
site: "sharadox.com",
|
|
15
|
+
subject: (message) => separate(CONTACT.subject, message.company ? `${message.name} (${message.company})` : message.name),
|
|
16
|
+
choices: Object.fromEntries(CONTACT.needs.options.map((need) => [need.key, need.en])),
|
|
17
|
+
});
|
|
54
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/action/send-contact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/action/send-contact/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,6CAA6C,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;IAC7C,EAAE,EAAE,IAAI,CAAC,KAAK;IACd,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACpG,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;CACtF,CAAC,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
/** Result of a contact form submission, shown by the form. */
|
|
2
|
-
export type ContactState
|
|
3
|
-
status: "idle" | "sent" | "invalid" | "rate-limited" | "failed";
|
|
4
|
-
};
|
|
2
|
+
export type { ContactState } from "@sharadox/form-web-library/contact-action/type";
|
|
5
3
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/action/send-contact/type.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/action/send-contact/type.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC"}
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 10px;
|
|
6
|
-
height: 46px;
|
|
7
|
-
padding: 0 22px;
|
|
8
|
-
border-radius: 99px;
|
|
9
|
-
font-weight: 500;
|
|
10
|
-
font-size: 15px;
|
|
11
|
-
border: 1px solid transparent;
|
|
12
|
-
transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.4s var(--ease);
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
}
|
|
15
|
-
.button:active {
|
|
16
|
-
transform: scale(0.98);
|
|
17
|
-
}
|
|
18
|
-
.button:disabled {
|
|
19
|
-
opacity: 0.6;
|
|
20
|
-
}
|
|
21
|
-
.button:hover .arrow {
|
|
22
|
-
transform: translateX(4px);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.solid {
|
|
26
|
-
background: var(--foreground);
|
|
27
|
-
color: var(--background);
|
|
28
|
-
box-shadow: 0 0 0 0 color-mix(in srgb, var(--foreground) 0%, transparent);
|
|
29
|
-
}
|
|
30
|
-
.solid:hover {
|
|
31
|
-
background: color-mix(in srgb, var(--foreground) 88%, transparent);
|
|
32
|
-
box-shadow: 0 0 0 5px color-mix(in srgb, var(--foreground) 10%, transparent);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.ghost {
|
|
36
|
-
border-color: var(--line-2);
|
|
37
|
-
color: var(--foreground);
|
|
38
|
-
background: color-mix(in srgb, var(--background) 40%, transparent);
|
|
39
|
-
}
|
|
40
|
-
.ghost:hover {
|
|
41
|
-
background: color-mix(in srgb, var(--foreground) 6%, transparent);
|
|
42
|
-
border-color: color-mix(in srgb, var(--foreground) 30%, transparent);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.small {
|
|
46
|
-
height: 36px;
|
|
47
|
-
padding: 0 16px;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.block {
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 52px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.arrow {
|
|
57
|
-
transition: transform 0.4s var(--ease);
|
|
58
|
-
}
|
|
1
|
+
.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;height:46px;padding:0 22px;border-radius:99px;font-weight:500;font-size:15px;border:1px solid rgba(0,0,0,0);transition:background .3s,color .3s,border-color .3s,box-shadow .3s,transform .4s var(--ease);white-space:nowrap}.button:active{transform:scale(0.98)}.button:disabled{opacity:.6}.button:hover .arrow{transform:translateX(4px)}.solid{background:var(--foreground);color:var(--background);box-shadow:0 0 0 0 color-mix(in srgb, var(--foreground) 0%, transparent)}.solid:hover{background:color-mix(in srgb, var(--foreground) 88%, transparent);box-shadow:0 0 0 5px color-mix(in srgb, var(--foreground) 10%, transparent)}.ghost{border-color:var(--line-2);color:var(--foreground);background:color-mix(in srgb, var(--background) 40%, transparent)}.ghost:hover{background:color-mix(in srgb, var(--foreground) 6%, transparent);border-color:color-mix(in srgb, var(--foreground) 30%, transparent)}.small{height:36px;padding:0 16px;font-size:14px}.block{width:100%;height:52px}.arrow{transition:transform .4s var(--ease)}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@use "style/token" as *;
|
|
2
|
+
|
|
3
|
+
.button {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: 10px;
|
|
8
|
+
height: 46px;
|
|
9
|
+
padding: 0 22px;
|
|
10
|
+
border-radius: 99px;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
font-size: 15px;
|
|
13
|
+
border: 1px solid transparent;
|
|
14
|
+
transition:
|
|
15
|
+
background 0.3s,
|
|
16
|
+
color 0.3s,
|
|
17
|
+
border-color 0.3s,
|
|
18
|
+
box-shadow 0.3s,
|
|
19
|
+
transform 0.4s var(--ease);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
&:active {
|
|
22
|
+
transform: scale(0.98);
|
|
23
|
+
}
|
|
24
|
+
&:disabled {
|
|
25
|
+
opacity: 0.6;
|
|
26
|
+
}
|
|
27
|
+
&:hover .arrow {
|
|
28
|
+
transform: translateX(4px);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.solid {
|
|
32
|
+
background: var(--foreground);
|
|
33
|
+
color: var(--background);
|
|
34
|
+
box-shadow: 0 0 0 0 tint(0%);
|
|
35
|
+
&:hover {
|
|
36
|
+
background: tint(88%);
|
|
37
|
+
box-shadow: 0 0 0 5px tint(10%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.ghost {
|
|
41
|
+
border-color: var(--line-2);
|
|
42
|
+
color: var(--foreground);
|
|
43
|
+
background: shade(40%);
|
|
44
|
+
&:hover {
|
|
45
|
+
background: tint(6%);
|
|
46
|
+
border-color: tint(30%);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.small {
|
|
50
|
+
height: 36px;
|
|
51
|
+
padding: 0 16px;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
}
|
|
54
|
+
.block {
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 52px;
|
|
57
|
+
}
|
|
58
|
+
.arrow {
|
|
59
|
+
transition: transform 0.4s var(--ease);
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Reveal } from "@sharadox/web-library/
|
|
3
|
-
import { translate } from "@sharadox/web-library/
|
|
2
|
+
import { Reveal } from "@sharadox/animation-web-library/reveal";
|
|
3
|
+
import { translate } from "@sharadox/internationalization-web-library/translate";
|
|
4
4
|
import { Section } from "@sharadox/sharadox-web-library/component/section";
|
|
5
5
|
import { SectionHeading } from "@sharadox/sharadox-web-library/component/section-heading";
|
|
6
6
|
import { CAPABILITY } from "@sharadox/sharadox-web-library/content/capability";
|
|
@@ -1,94 +1 @@
|
|
|
1
|
-
.heading {
|
|
2
|
-
padding: clamp(72px, 10vw, 128px) var(--padding) 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.sheet {
|
|
6
|
-
display: grid;
|
|
7
|
-
grid-template-columns: repeat(5, 1fr);
|
|
8
|
-
/* Each column spans the title row plus one row per capability, shared by all columns, so lines line up. */
|
|
9
|
-
grid-auto-rows: auto;
|
|
10
|
-
border-top: 1px solid var(--line);
|
|
11
|
-
}
|
|
12
|
-
@media (max-width: 960px) {
|
|
13
|
-
.sheet {
|
|
14
|
-
grid-template-columns: repeat(2, 1fr);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
@media (max-width: 600px) {
|
|
18
|
-
.sheet {
|
|
19
|
-
grid-template-columns: 1fr;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.column {
|
|
24
|
-
position: relative;
|
|
25
|
-
display: grid;
|
|
26
|
-
grid-row: span var(--rows);
|
|
27
|
-
grid-template-rows: subgrid;
|
|
28
|
-
}
|
|
29
|
-
@media (max-width: 600px) {
|
|
30
|
-
.column {
|
|
31
|
-
grid-row: auto;
|
|
32
|
-
grid-template-rows: none;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
.column:not(:last-child)::after {
|
|
36
|
-
content: "";
|
|
37
|
-
position: absolute;
|
|
38
|
-
top: 0;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
right: 0;
|
|
41
|
-
width: 1px;
|
|
42
|
-
background: linear-gradient(180deg, var(--line-2) 50%, transparent 0) 0 0/1px 8px repeat-y;
|
|
43
|
-
}
|
|
44
|
-
.column ul {
|
|
45
|
-
display: contents;
|
|
46
|
-
}
|
|
47
|
-
.column li {
|
|
48
|
-
position: relative;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
padding: 13px 20px;
|
|
52
|
-
font-size: 14.5px;
|
|
53
|
-
color: var(--foreground-2);
|
|
54
|
-
transition: color 0.25s;
|
|
55
|
-
}
|
|
56
|
-
.column li::after {
|
|
57
|
-
content: "";
|
|
58
|
-
position: absolute;
|
|
59
|
-
left: 0;
|
|
60
|
-
right: 0;
|
|
61
|
-
bottom: 0;
|
|
62
|
-
height: 1px;
|
|
63
|
-
background: linear-gradient(90deg, var(--line) 50%, transparent 0) 0 0/8px 1px repeat-x;
|
|
64
|
-
}
|
|
65
|
-
.column li:hover {
|
|
66
|
-
color: var(--foreground);
|
|
67
|
-
}
|
|
68
|
-
@media (max-width: 960px) {
|
|
69
|
-
.column {
|
|
70
|
-
border-bottom: 1px solid var(--line);
|
|
71
|
-
}
|
|
72
|
-
.column:nth-child(2n)::after {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
@media (max-width: 600px) {
|
|
77
|
-
.column::after {
|
|
78
|
-
display: none;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.title {
|
|
83
|
-
display: grid;
|
|
84
|
-
gap: 6px;
|
|
85
|
-
padding: 22px 20px 18px;
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
letter-spacing: -0.02em;
|
|
88
|
-
border-bottom: 1px solid var(--line);
|
|
89
|
-
}
|
|
90
|
-
.title span {
|
|
91
|
-
font-size: 11.5px;
|
|
92
|
-
font-weight: 400;
|
|
93
|
-
color: var(--foreground-3);
|
|
94
|
-
}
|
|
1
|
+
.heading{padding:clamp(72px,10vw,128px) var(--padding) 0}.sheet{display:grid;grid-template-columns:repeat(5, 1fr);grid-auto-rows:auto;border-top:1px solid var(--line)}@media(max-width: 960px){.sheet{grid-template-columns:repeat(2, 1fr)}}@media(max-width: 600px){.sheet{grid-template-columns:1fr}}.column{position:relative;display:grid;grid-row:span var(--rows);grid-template-rows:subgrid}@media(max-width: 600px){.column{grid-row:auto;grid-template-rows:none}}.column:not(:last-child)::after{content:"";position:absolute;top:0;bottom:0;right:0;width:1px;background:linear-gradient(180deg, var(--line-2) 50%, transparent 0) 0 0/1px 8px repeat-y}.column ul{display:contents}.column li{position:relative;display:flex;align-items:center;padding:13px 20px;font-size:14.5px;color:var(--foreground-2);transition:color .25s}.column li::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:linear-gradient(90deg, var(--line) 50%, transparent 0) 0 0/8px 1px repeat-x}.column li:hover{color:var(--foreground)}@media(max-width: 960px){.column{border-bottom:1px solid var(--line)}.column:nth-child(2n)::after{display:none}}@media(max-width: 600px){.column::after{display:none}}.title{display:grid;gap:6px;padding:22px 20px 18px;font-weight:600;letter-spacing:-0.02em;border-bottom:1px solid var(--line)}.title span{font-size:11.5px;font-weight:400;color:var(--foreground-3)}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@use "style/token" as *;
|
|
2
|
+
|
|
3
|
+
.heading {
|
|
4
|
+
padding: clamp(72px, 10vw, 128px) var(--padding) 0;
|
|
5
|
+
}
|
|
6
|
+
.sheet {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: repeat(5, 1fr);
|
|
9
|
+
/* Each column spans the title row plus one row per capability, shared by all columns, so lines line up. */
|
|
10
|
+
grid-auto-rows: auto;
|
|
11
|
+
border-top: 1px solid var(--line);
|
|
12
|
+
@include below(960px) {
|
|
13
|
+
grid-template-columns: repeat(2, 1fr);
|
|
14
|
+
}
|
|
15
|
+
@include below(600px) {
|
|
16
|
+
grid-template-columns: 1fr;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.column {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-row: span var(--rows);
|
|
23
|
+
grid-template-rows: subgrid;
|
|
24
|
+
@include below(600px) {
|
|
25
|
+
grid-row: auto;
|
|
26
|
+
grid-template-rows: none;
|
|
27
|
+
}
|
|
28
|
+
&:not(:last-child)::after {
|
|
29
|
+
content: "";
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
width: 1px;
|
|
35
|
+
@include dashed(vertical);
|
|
36
|
+
}
|
|
37
|
+
ul {
|
|
38
|
+
display: contents;
|
|
39
|
+
}
|
|
40
|
+
li {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: 13px 20px;
|
|
45
|
+
font-size: 14.5px;
|
|
46
|
+
color: var(--foreground-2);
|
|
47
|
+
transition: color 0.25s;
|
|
48
|
+
&::after {
|
|
49
|
+
content: "";
|
|
50
|
+
position: absolute;
|
|
51
|
+
left: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
height: 1px;
|
|
55
|
+
@include dashed(horizontal, var(--line));
|
|
56
|
+
}
|
|
57
|
+
&:hover {
|
|
58
|
+
color: var(--foreground);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
@include below(960px) {
|
|
62
|
+
border-bottom: 1px solid var(--line);
|
|
63
|
+
&:nth-child(2n)::after {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
@include below(600px) {
|
|
68
|
+
&::after {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
.title {
|
|
74
|
+
display: grid;
|
|
75
|
+
gap: 6px;
|
|
76
|
+
padding: 22px 20px 18px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
letter-spacing: -0.02em;
|
|
79
|
+
border-bottom: 1px solid var(--line);
|
|
80
|
+
span {
|
|
81
|
+
font-size: 11.5px;
|
|
82
|
+
font-weight: 400;
|
|
83
|
+
color: var(--foreground-3);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { ConsentProperties } from "@sharadox/sharadox-web-library/component/consent/type";
|
|
2
|
-
/**
|
|
3
|
-
* The cookie panel. It shows while there is no stored answer: Accept All and manual choices are kept for good;
|
|
4
|
-
* Deny lasts only for this visit, so the visitor is asked again next time. "Cookie Preferences" reopens it.
|
|
5
|
-
*/
|
|
2
|
+
/** The Sharadox cookie panel: the shared consent panel with Sharadox copy, grid marks and a small turning cookie. */
|
|
6
3
|
export declare function Consent({ locale }: ConsentProperties): import("react").JSX.Element;
|
|
7
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/component/consent/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/component/consent/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE/F,qHAAqH;AACrH,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,+BAsCpD"}
|
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { translate } from "@sharadox/web-library/internationalization/translate";
|
|
6
|
-
import { CONSENT_OPEN_EVENT, requiredOnly } from "@sharadox/web-library/privacy/consent";
|
|
7
|
-
import { useConsent } from "@sharadox/web-library/privacy/use-consent";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ConsentPanel } from "@sharadox/consent-web-library/consent-panel";
|
|
4
|
+
import { translate } from "@sharadox/internationalization-web-library/translate";
|
|
8
5
|
import { Cross } from "@sharadox/sharadox-web-library/component/cross";
|
|
9
|
-
import { Toggle } from "@sharadox/sharadox-web-library/component/consent/toggle";
|
|
10
6
|
import { CONSENT, CONSENT_CONFIGURATION } from "@sharadox/sharadox-web-library/content/consent";
|
|
11
7
|
import styles from "./index.module.css";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The cookie panel. It shows while there is no stored answer: Accept All and manual choices are kept for good;
|
|
15
|
-
* Deny lasts only for this visit, so the visitor is asked again next time. "Cookie Preferences" reopens it.
|
|
16
|
-
*/
|
|
8
|
+
/** The Sharadox cookie panel: the shared consent panel with Sharadox copy, grid marks and a small turning cookie. */
|
|
17
9
|
export function Consent({ locale }) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const visible = reopened || status?.kind === "unknown";
|
|
33
|
-
const close = (action) => () => {
|
|
34
|
-
action();
|
|
35
|
-
setReopened(false);
|
|
36
|
-
setManual(false);
|
|
10
|
+
const copy = {
|
|
11
|
+
title: translate(CONSENT.title, locale),
|
|
12
|
+
text: translate(CONSENT.text, locale),
|
|
13
|
+
acceptAll: translate(CONSENT.acceptAll, locale),
|
|
14
|
+
deny: translate(CONSENT.deny, locale),
|
|
15
|
+
customize: translate(CONSENT.customize, locale),
|
|
16
|
+
save: translate(CONSENT.save, locale),
|
|
17
|
+
back: translate(CONSENT.back, locale),
|
|
18
|
+
close: translate(CONSENT.close, locale),
|
|
19
|
+
alwaysOn: translate(CONSENT.alwaysOn, locale),
|
|
20
|
+
categories: Object.fromEntries(Object.entries(CONSENT.categories).map(([key, category]) => [
|
|
21
|
+
key,
|
|
22
|
+
{ title: translate(category.title, locale), text: translate(category.text, locale) },
|
|
23
|
+
])),
|
|
37
24
|
};
|
|
38
|
-
return (_jsx(
|
|
25
|
+
return (_jsx(ConsentPanel, { configuration: CONSENT_CONFIGURATION, copy: copy, className: styles.consent, icon: _jsxs("span", { className: styles.cookie, "aria-hidden": true, children: [_jsx("i", {}), _jsx("i", {}), _jsx("i", {})] }), decoration: _jsxs(_Fragment, { children: [_jsx(Cross, { corner: "top-left" }), _jsx(Cross, { corner: "top-right" })] }) }));
|
|
39
26
|
}
|
|
40
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/component/consent/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/component/consent/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sDAAsD,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC,qHAAqH;AACrH,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAqB;IACnD,MAAM,IAAI,GAAG;QACX,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;QACvC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;QACrC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;QAC/C,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;QACrC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;QAC/C,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;QACrC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;QACrC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;QACvC,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC7C,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;YAC1D,GAAG;YACH,EAAE,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;SACrF,CAAC,CACH;KACF,CAAC;IACF,OAAO,CACL,KAAC,YAAY,IACX,aAAa,EAAE,qBAAqB,EACpC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,CAAC,OAAO,EACzB,IAAI,EACF,gBAAM,SAAS,EAAE,MAAM,CAAC,MAAM,kCAC5B,aAAK,EACL,aAAK,EACL,aAAK,IACA,EAET,UAAU,EACR,8BACE,KAAC,KAAK,IAAC,MAAM,EAAC,UAAU,GAAG,EAC3B,KAAC,KAAK,IAAC,MAAM,EAAC,WAAW,GAAG,IAC3B,GAEL,CACH,CAAC;AACJ,CAAC"}
|