@planningcenter/sweetest-alert 0.1.0 → 0.3.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/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react-dom"),h=require("@planningcenter/tapestry");var o={},_;function C(){if(_)return o;_=1;var c=v;if(process.env.NODE_ENV==="production")o.createRoot=c.createRoot,o.hydrateRoot=c.hydrateRoot;else{var r=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;o.createRoot=function(l,n){r.usingClientEntryPoint=!0;try{return c.createRoot(l,n)}finally{r.usingClientEntryPoint=!1}},o.hydrateRoot=function(l,n,s){r.usingClientEntryPoint=!0;try{return c.hydrateRoot(l,n,s)}finally{r.usingClientEntryPoint=!1}}}return o}var f=C();const p="M8,0c2.1217,0 4.1566,0.84286 5.6569,2.34315c1.5002,1.50029 2.3431,3.53512 2.3431,5.65685c0,1.58225 -0.4692,3.129 -1.3482,4.4446c-0.8791,1.3156 -2.1285,2.3409 -3.5903,2.9464c-1.46184,0.6055 -3.07037,0.764 -4.62222,0.4553c-1.55185,-0.3087 -2.97731,-1.0706 -4.09613,-2.1894c-1.11882,-1.1189 -1.88075,-2.5443 -2.18943,-4.09618c-0.30868,-1.55185 -0.15025,-3.16038 0.45525,-4.62219c0.6055,-1.46181 1.63088,-2.71124 2.94647,-3.59029c1.31559,-0.87905 2.86231,-1.34824 4.44456,-1.34824zM12.57,6.07l-1.14,-1.14l-4.43,4.44l-2.43,-2.44l-1.14,1.14l3.57,3.56z",w="M15.7713,14.0548c0.0002,0.133 -0.0347,0.2638 -0.1011,0.3791c-0.0664,0.1153 -0.162,0.211 -0.2772,0.2776c-0.1152,0.0665 -0.246,0.1015 -0.379,0.1015h-14.02801c-0.13305,0 -0.26377,-0.035 -0.37898,-0.1015c-0.11521,-0.0666 -0.21084,-0.1623 -0.27725,-0.2776c-0.06642,-0.1153 -0.10127,-0.2461 -0.10106,-0.3791c0.00022,-0.1331 0.0355,-0.2637 0.10229,-0.3788l7.014,-12.11501c0.06631,-0.11506 0.16176,-0.21062 0.27675,-0.27707c0.11498,-0.06644 0.24544,-0.10142 0.37825,-0.10142c0.1328,0 0.26326,0.03498 0.37824,0.10142c0.11499,0.06645 0.21044,0.16201 0.27676,0.27707l7.01401,12.11501c0.0668,0.1151 0.1021,0.2457 0.1023,0.3788zM8.75699,11.028h-1.514v1.514h1.514zM8.75699,6.48499h-1.514v3.029h1.514z",E="M8.8,4h-1.6v1.6h1.6zM8.8,7.2h-1.6v4.8h1.6zM8,0c2.1217,0 4.1566,0.84286 5.6569,2.34315c1.5002,1.50029 2.3431,3.53512 2.3431,5.65685c0,1.58225 -0.4692,3.129 -1.3482,4.4446c-0.8791,1.3156 -2.1285,2.3409 -3.5903,2.9464c-1.46184,0.6055 -3.07037,0.764 -4.62222,0.4553c-1.55185,-0.3087 -2.97731,-1.0706 -4.09613,-2.1894c-1.11882,-1.1189 -1.88075,-2.5443 -2.18943,-4.09618c-0.30868,-1.55185 -0.15025,-3.16038 0.45525,-4.62219c0.6055,-1.46181 1.63088,-2.71124 2.94647,-3.59029c1.31559,-0.87905 2.86231,-1.34824 4.44456,-1.34824z",R="M11.3951,10.2621l-2.26245,-2.2621l2.26245,-2.26215l-1.1317,-1.1316l-2.2625,2.26215l-2.26246,-2.26215l-1.13175,1.1316l2.26246,2.26215l-2.26246,2.2621l1.13175,1.1316l2.26246,-2.2621l2.2625,2.2621zM16,8c0,2.1214 -0.8421,4.156 -2.3414,5.6569c-1.119,1.1188 -2.5446,1.8807 -4.09668,2.1894c-1.55205,0.3087 -3.16079,0.1502 -4.62278,-0.4553c-1.46199,-0.6055 -2.71157,-1.6309 -3.59073,-2.9465c-0.87916,-1.3156 -1.34841,-2.86226 -1.34841,-4.4445c0,-1.58224 0.46925,-3.12895 1.34841,-4.44453c0.87916,-1.31559 2.12874,-2.34097 3.59073,-2.94648c1.46199,-0.60551 3.07073,-0.76395 4.62278,-0.45529c1.55208,0.30866 2.97768,1.07056 4.09668,2.18935c1.4993,1.50098 2.3414,3.5356 2.3414,5.65695z";function x({onCancel:c,onConfirm:r,confirmButton:l="Okay",content:n,hideCancel:s=!1,title:y,type:a="warning"}){const t=document.createElement("dialog");t.className="pco-sweetest-alert",document.body.appendChild(t);const d=f.createRoot(t),i=()=>{d.unmount(),document.body.removeChild(t)},g=()=>{i(),r?.()},u=()=>{i(),c?.()},m=()=>{switch(a){case"success":return p;case"error":return R;case"info":return E;case"danger":case"warning":return w}};return d.render(e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:`pco-sweetest-alert__icon pco-sweetest-alert--${a}`,width:"48",height:"48",viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:m()})}),e.jsx("h2",{className:"pco-sweetest-alert__title",children:y}),e.jsx("div",{className:"pco-sweetest-alert__body",children:typeof n=="string"?e.jsx("p",{children:n}):n}),e.jsxs("div",{className:"pco-sweetest-alert__actions",children:[!s&&e.jsx(h.Button,{label:"Cancel",kind:"ghost",onClick:u}),e.jsx(h.Button,{label:l,kind:a==="danger"?"delete":"primary",onClick:g})]})]})),t.showModal(),t.addEventListener("close",u),{show:()=>t.showModal(),close:()=>t.close(),cleanup:i}}exports.SweetestAlert=x;
@@ -0,0 +1 @@
1
+ export { SweetestAlert } from "./sweetest_alert.tsx";
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ import { jsxs as u, Fragment as g, jsx as r } from "react/jsx-runtime";
2
+ import v from "react-dom";
3
+ import { Button as m } from "@planningcenter/tapestry";
4
+ var o = {}, _;
5
+ function y() {
6
+ if (_) return o;
7
+ _ = 1;
8
+ var c = v;
9
+ if (process.env.NODE_ENV === "production")
10
+ o.createRoot = c.createRoot, o.hydrateRoot = c.hydrateRoot;
11
+ else {
12
+ var n = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
13
+ o.createRoot = function(l, t) {
14
+ n.usingClientEntryPoint = !0;
15
+ try {
16
+ return c.createRoot(l, t);
17
+ } finally {
18
+ n.usingClientEntryPoint = !1;
19
+ }
20
+ }, o.hydrateRoot = function(l, t, a) {
21
+ n.usingClientEntryPoint = !0;
22
+ try {
23
+ return c.hydrateRoot(l, t, a);
24
+ } finally {
25
+ n.usingClientEntryPoint = !1;
26
+ }
27
+ };
28
+ }
29
+ return o;
30
+ }
31
+ var w = y();
32
+ const E = "M8,0c2.1217,0 4.1566,0.84286 5.6569,2.34315c1.5002,1.50029 2.3431,3.53512 2.3431,5.65685c0,1.58225 -0.4692,3.129 -1.3482,4.4446c-0.8791,1.3156 -2.1285,2.3409 -3.5903,2.9464c-1.46184,0.6055 -3.07037,0.764 -4.62222,0.4553c-1.55185,-0.3087 -2.97731,-1.0706 -4.09613,-2.1894c-1.11882,-1.1189 -1.88075,-2.5443 -2.18943,-4.09618c-0.30868,-1.55185 -0.15025,-3.16038 0.45525,-4.62219c0.6055,-1.46181 1.63088,-2.71124 2.94647,-3.59029c1.31559,-0.87905 2.86231,-1.34824 4.44456,-1.34824zM12.57,6.07l-1.14,-1.14l-4.43,4.44l-2.43,-2.44l-1.14,1.14l3.57,3.56z", R = "M15.7713,14.0548c0.0002,0.133 -0.0347,0.2638 -0.1011,0.3791c-0.0664,0.1153 -0.162,0.211 -0.2772,0.2776c-0.1152,0.0665 -0.246,0.1015 -0.379,0.1015h-14.02801c-0.13305,0 -0.26377,-0.035 -0.37898,-0.1015c-0.11521,-0.0666 -0.21084,-0.1623 -0.27725,-0.2776c-0.06642,-0.1153 -0.10127,-0.2461 -0.10106,-0.3791c0.00022,-0.1331 0.0355,-0.2637 0.10229,-0.3788l7.014,-12.11501c0.06631,-0.11506 0.16176,-0.21062 0.27675,-0.27707c0.11498,-0.06644 0.24544,-0.10142 0.37825,-0.10142c0.1328,0 0.26326,0.03498 0.37824,0.10142c0.11499,0.06645 0.21044,0.16201 0.27676,0.27707l7.01401,12.11501c0.0668,0.1151 0.1021,0.2457 0.1023,0.3788zM8.75699,11.028h-1.514v1.514h1.514zM8.75699,6.48499h-1.514v3.029h1.514z", M = "M8.8,4h-1.6v1.6h1.6zM8.8,7.2h-1.6v4.8h1.6zM8,0c2.1217,0 4.1566,0.84286 5.6569,2.34315c1.5002,1.50029 2.3431,3.53512 2.3431,5.65685c0,1.58225 -0.4692,3.129 -1.3482,4.4446c-0.8791,1.3156 -2.1285,2.3409 -3.5903,2.9464c-1.46184,0.6055 -3.07037,0.764 -4.62222,0.4553c-1.55185,-0.3087 -2.97731,-1.0706 -4.09613,-2.1894c-1.11882,-1.1189 -1.88075,-2.5443 -2.18943,-4.09618c-0.30868,-1.55185 -0.15025,-3.16038 0.45525,-4.62219c0.6055,-1.46181 1.63088,-2.71124 2.94647,-3.59029c1.31559,-0.87905 2.86231,-1.34824 4.44456,-1.34824z", z = "M11.3951,10.2621l-2.26245,-2.2621l2.26245,-2.26215l-1.1317,-1.1316l-2.2625,2.26215l-2.26246,-2.26215l-1.13175,1.1316l2.26246,2.26215l-2.26246,2.2621l1.13175,1.1316l2.26246,-2.2621l2.2625,2.2621zM16,8c0,2.1214 -0.8421,4.156 -2.3414,5.6569c-1.119,1.1188 -2.5446,1.8807 -4.09668,2.1894c-1.55205,0.3087 -3.16079,0.1502 -4.62278,-0.4553c-1.46199,-0.6055 -2.71157,-1.6309 -3.59073,-2.9465c-0.87916,-1.3156 -1.34841,-2.86226 -1.34841,-4.4445c0,-1.58224 0.46925,-3.12895 1.34841,-4.44453c0.87916,-1.31559 2.12874,-2.34097 3.59073,-2.94648c1.46199,-0.60551 3.07073,-0.76395 4.62278,-0.45529c1.55208,0.30866 2.97768,1.07056 4.09668,2.18935c1.4993,1.50098 2.3414,3.5356 2.3414,5.65695z";
33
+ function O({
34
+ // Optional: Callback function executed when cancel button is clicked
35
+ onCancel: c,
36
+ // Optional: Callback function executed when confirm button is clicked
37
+ onConfirm: n,
38
+ // Optional: Text for the confirm button. Defaults to "Okay".
39
+ confirmButton: l = "Okay",
40
+ // Required: The body content explaining the alert.
41
+ // Accepts a React fragment or a string of text.
42
+ content: t,
43
+ // Optional: When true, hides the cancel button for simple notifications.
44
+ // Defaults to "false".
45
+ hideCancel: a = !1,
46
+ // Required: The main heading text displayed at the top of the modal
47
+ title: f,
48
+ // Optional: The visual type of alert, affects icon and styling.
49
+ // Values can be "info", "success", "error", "danger", or "warning" (default).
50
+ type: s = "warning"
51
+ }) {
52
+ const e = document.createElement("dialog");
53
+ e.className = "pco-sweetest-alert", document.body.appendChild(e);
54
+ const d = w.createRoot(e), i = () => {
55
+ d.unmount(), document.body.removeChild(e);
56
+ }, p = () => {
57
+ i(), n?.();
58
+ }, h = () => {
59
+ i(), c?.();
60
+ }, C = () => {
61
+ switch (s) {
62
+ case "success":
63
+ return E;
64
+ case "error":
65
+ return z;
66
+ case "info":
67
+ return M;
68
+ case "danger":
69
+ case "warning":
70
+ return R;
71
+ }
72
+ };
73
+ return d.render(
74
+ /* @__PURE__ */ u(g, { children: [
75
+ /* @__PURE__ */ r(
76
+ "svg",
77
+ {
78
+ className: `pco-sweetest-alert__icon pco-sweetest-alert--${s}`,
79
+ width: "48",
80
+ height: "48",
81
+ viewBox: "0 0 16 16",
82
+ "aria-hidden": "true",
83
+ children: /* @__PURE__ */ r("path", { d: C() })
84
+ }
85
+ ),
86
+ /* @__PURE__ */ r("h2", { className: "pco-sweetest-alert__title", children: f }),
87
+ /* @__PURE__ */ r("div", { className: "pco-sweetest-alert__body", children: typeof t == "string" ? /* @__PURE__ */ r("p", { children: t }) : t }),
88
+ /* @__PURE__ */ u("div", { className: "pco-sweetest-alert__actions", children: [
89
+ !a && /* @__PURE__ */ r(m, { label: "Cancel", kind: "ghost", onClick: h }),
90
+ /* @__PURE__ */ r(
91
+ m,
92
+ {
93
+ label: l,
94
+ kind: s === "danger" ? "delete" : "primary",
95
+ onClick: p
96
+ }
97
+ )
98
+ ] })
99
+ ] })
100
+ ), e.showModal(), e.addEventListener("close", h), {
101
+ show: () => e.showModal(),
102
+ close: () => e.close(),
103
+ cleanup: i
104
+ };
105
+ }
106
+ export {
107
+ O as SweetestAlert
108
+ };
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ type AlertTypes = "info" | "success" | "error" | "danger" | "warning";
3
+ export declare function SweetestAlert({ onCancel, onConfirm, confirmButton, content, hideCancel, title, type, }: {
4
+ onCancel?: () => void;
5
+ onConfirm?: () => void;
6
+ confirmButton?: string;
7
+ content: string | React.ReactNode;
8
+ hideCancel?: boolean;
9
+ title: string;
10
+ type?: AlertTypes;
11
+ }): {
12
+ show: () => void;
13
+ close: () => void;
14
+ cleanup: () => void;
15
+ };
16
+ export {};
package/package.json CHANGED
@@ -1,9 +1,24 @@
1
1
  {
2
2
  "name": "@planningcenter/sweetest-alert",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "The sweetest alert ever",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@1.22.22",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ },
16
+ "./style.css": "./dist/style.css"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
7
22
  "repository": {
8
23
  "type": "git",
9
24
  "url": "git+https://github.com/planningcenter/sweetest-alert.git"
@@ -14,24 +29,27 @@
14
29
  "url": "https://github.com/planningcenter/sweetest-alert/issues"
15
30
  },
16
31
  "scripts": {
17
- "dev": "vite",
18
- "build": "vite build",
19
- "preview": "vite preview",
32
+ "dev": "vite --config vite.config.docs.ts",
33
+ "build": "vite build --config vite.config.docs.ts",
34
+ "build:lib": "vite build --config vite.config.lib.ts && tsc --project tsconfig.lib.json && cp src/sweetest_alert.css dist/style.css",
35
+ "build:docs": "vite build --config vite.config.docs.ts",
36
+ "preview": "vite preview --config vite.config.docs.ts",
20
37
  "test": "vitest",
21
38
  "lint:js": "eslint .",
22
- "lint:css": "stylelint \"**/*.css\""
39
+ "lint:css": "stylelint \"**/*.css\"",
40
+ "prepublishOnly": "yarn build:lib"
23
41
  },
24
42
  "peerDependencies": {
25
- "@planningcenter/icons": "^15.25.0",
26
- "@planningcenter/tapestry": "^2.3.0",
43
+ "@planningcenter/icons": "^15.26.0",
44
+ "@planningcenter/tapestry": "^2.5.0",
27
45
  "react": "^18.3.1 <19",
28
46
  "react-dom": "^18.3.1"
29
47
  },
30
48
  "devDependencies": {
31
49
  "@eslint/js": "^9.37.0",
32
- "@planningcenter/icons": "^15.25.0",
50
+ "@planningcenter/icons": "^15.26.0",
33
51
  "@planningcenter/stylelint-config-pco": "^0.0.5",
34
- "@planningcenter/tapestry": "^2.3.0",
52
+ "@planningcenter/tapestry": "^2.5.0",
35
53
  "@testing-library/dom": "^10.4.1",
36
54
  "@testing-library/jest-dom": "^6.9.1",
37
55
  "@testing-library/react": "^16.3.0",
package/.editorconfig DELETED
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- indent_size = 2
7
- indent_style = space
8
- insert_final_newline = true
@@ -1 +0,0 @@
1
- * @starzonmyarmz
@@ -1,24 +0,0 @@
1
- name: PCO-Release - Release Automation
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: write
10
- pull-requests: write
11
-
12
- jobs:
13
- release-automation:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v4
17
- - uses: actions/setup-node@v4
18
- with:
19
- node-version: "20"
20
- cache: "yarn"
21
- - uses: planningcenter/pco-release-action/release-by-pr@v1
22
- with:
23
- app-id: ${{ secrets.PCO_DEPENDENCIES_APP_ID }}
24
- private-key: ${{ secrets.PCO_DEPENDENCIES_PRIVATE_KEY}}
@@ -1,17 +0,0 @@
1
- name: PCO-Release - Create Release on Merge
2
-
3
- on:
4
- pull_request:
5
- types: [closed]
6
- branches:
7
- - main
8
-
9
- jobs:
10
- create-release:
11
- runs-on: ubuntu-latest
12
- if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'pco-release-pending')
13
- steps:
14
- - uses: planningcenter/pco-release-action/create-release-on-merge@v1
15
- with:
16
- app-id: ${{ secrets.PCO_DEPENDENCIES_APP_ID }}
17
- private-key: ${{ secrets.PCO_DEPENDENCIES_PRIVATE_KEY}}
@@ -1,15 +0,0 @@
1
- name: PCO-Release - Dependabot Automation (Update changelog)
2
-
3
- on: pull_request
4
-
5
- jobs:
6
- update-dependabot-pr-changelog:
7
- if: github.actor == 'dependabot[bot]'
8
- runs-on: ubuntu-latest
9
- permissions:
10
- contents: write
11
- steps:
12
- - uses: actions/checkout@v4
13
- with:
14
- ref: ${{ github.event.pull_request.head.ref }}
15
- - uses: planningcenter/pco-release-action/dependabot-automation@v1
@@ -1,22 +0,0 @@
1
- name: PCO-Release - Require Changelog Update
2
-
3
- on:
4
- pull_request:
5
- branches: [main]
6
-
7
- jobs:
8
- require-changelog-update:
9
- runs-on: ubuntu-latest
10
- permissions:
11
- pull-requests: read
12
- contents: read
13
- steps:
14
- - uses: actions/checkout@v4
15
- - id: changed-files
16
- uses: tj-actions/changed-files@v44
17
- with:
18
- files: CHANGELOG.md
19
- - if: steps.changed-files.outputs.any_changed == 'false'
20
- run: |
21
- echo "Pull Requests require an update to the CHANGELOG.md file."
22
- exit 1
@@ -1,18 +0,0 @@
1
- on:
2
- pull_request:
3
- types: [labeled]
4
-
5
- permissions:
6
- contents: write
7
- pull-requests: write
8
-
9
- name: PCO-Release - Sync With Labels
10
-
11
- jobs:
12
- sync-with-labels:
13
- if: ${{ github.event.pull_request.head.ref == 'pco-release--internal' && (github.event.label.name == 'pco-release-patch' || github.event.label.name == 'pco-release-minor' || github.event.label.name == 'pco-release-major') }}
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: planningcenter/pco-release-action/sync-with-labels@v1
17
- with:
18
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/.stylelintrc.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@planningcenter/stylelint-config-pco",
3
- "rules": {
4
- "number-leading-zero": "always",
5
- "order/properties-order": null,
6
- "order/properties-alphabetical-order": true
7
- }
8
- }
package/CHANGELOG.md DELETED
@@ -1,6 +0,0 @@
1
-
2
-
3
- ### Dependencies
4
-
5
- - Bump vite from 7.1.10 to 7.1.11
6
-
package/docs/demo.css DELETED
@@ -1,198 +0,0 @@
1
- * {
2
- box-sizing: border-box;
3
- margin: 0;
4
- padding: 0;
5
- }
6
-
7
- #root {
8
- display: contents;
9
- }
10
-
11
- body {
12
- background: linear-gradient(135deg, var(--t-fill-color-tag-blue-040) 0%, var(--t-fill-color-tag-purple-030) 100%);
13
- color: var(--t-text-color-default-primary);
14
- display: grid;
15
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
16
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
17
- sans-serif;
18
- line-height: 1.4;
19
- min-height: 100vh;
20
- padding: var(--t-spacing-3);
21
- place-items: center;
22
- text-wrap: pretty;
23
- gap:32px;
24
- }
25
-
26
- .container {
27
- background: var(--t-surface-color-card);
28
- border-radius: var(--t-border-radius-xl);
29
- box-shadow: 0 var(--t-spacing-3) var(--t-spacing-6) var(--t-fill-color-transparency-dark-030);
30
- max-width: 960px;
31
- padding: var(--t-spacing-6);
32
- width: 100%;
33
- }
34
-
35
- h1 {
36
- color: var(--t-text-color-default-headline);
37
- font-size: 2.5rem;
38
- margin: 0;
39
- text-align: center;
40
- }
41
-
42
- h2 {
43
- color: var(--t-text-color-default-secondary);
44
- font-size: 1.2rem;
45
- font-weight: var(--t-font-weight-normal);
46
- margin-bottom: var(--t-spacing-5);
47
- text-align: center;
48
- }
49
-
50
- ul {
51
- margin: 1rem;
52
- padding-left: 2ch;
53
- }
54
-
55
- table {
56
- border-collapse: collapse;
57
- }
58
-
59
- th, td {
60
- border-bottom: var(--t-border-width-default) solid var(--t-border-color-default-base);
61
- text-align: left;
62
- padding: var(--t-spacing-1);
63
- }
64
-
65
- tr:last-child :is(th, td) {
66
- border: 0;
67
- }
68
-
69
- .button-grid {
70
- display: grid;
71
- gap: var(--t-spacing-2);
72
- grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
73
- margin-bottom: var(--t-spacing-4);
74
- }
75
-
76
- .demo-button {
77
- background: var(--t-surface-color-card);
78
- border: var(--t-border-width-thick) solid var(--t-border-color-default-base);
79
- border-radius: 12px;
80
- color: var(--t-text-color-default-secondary);
81
- cursor: pointer;
82
- display: flex;
83
- flex-direction: column;
84
- font-family: inherit;
85
- font-size: 1rem;
86
- gap: var(--t-spacing-half);
87
- padding: var(--t-spacing-3);
88
- text-align: left;
89
- transition: all .2s ease;
90
-
91
- &:hover {
92
- box-shadow: 0 var(--t-spacing-half) var(--t-spacing-1) var(--t-fill-color-transparency-dark-010);
93
- translate: 0 -2px;
94
- }
95
-
96
- &:active {
97
- translate: 0;
98
- }
99
-
100
- h3 {
101
- color: var(--t-text-color-default-headline);
102
- font-size: 1.1rem;
103
- font-weight: var(--t-font-weight-semibold);
104
- }
105
- }
106
-
107
- .info {
108
- border-color: var(--t-border-color-status-info);
109
-
110
- &:hover {
111
- background: var(--t-fill-color-status-info-dim);
112
- border-color: var(--t-border-color-status-info);
113
- }
114
- }
115
-
116
- .success {
117
- border-color: var(--t-border-color-status-success);
118
-
119
- &:hover {
120
- background: var(--t-fill-color-status-success-ghost);
121
- border-color: var(--t-border-color-status-success);
122
- }
123
- }
124
-
125
- .warning {
126
- border-color: var(--t-border-color-status-warning);
127
-
128
- &:hover {
129
- background: var(--t-fill-color-status-warning-ghost);
130
- border-color: var(--t-border-color-status-warning);
131
- }
132
- }
133
-
134
- .error, .danger {
135
- border-color: var(--t-border-color-status-error);
136
-
137
- &:hover {
138
- background: var(--t-fill-color-status-error-ghost);
139
- border-color: var(--t-border-color-status-error);
140
- }
141
- }
142
-
143
- .custom {
144
- border-color: var(--t-border-color-default-darker);
145
-
146
- &:hover {
147
- background: var(--t-fill-color-tag-purple-010);
148
- border-color: var(--t-border-color-default-darkest);
149
- }
150
- }
151
-
152
- .tip {
153
- background: var(--t-fill-color-neutral-090);
154
- border: var(--t-border-width-default) solid var(--t-border-color-default-base);
155
- border-radius: var(--t-border-radius-lg);
156
- color: var(--t-text-color-default-secondary);
157
- font-size: 1rem;
158
- padding: var(--t-spacing-2) var(--t-spacing-3);
159
-
160
- strong {
161
- color: var(--t-text-color-default-primary);
162
- }
163
- }
164
-
165
- .codeblock {
166
- background: #2d2d2d;
167
- border-radius: var(--t-border-radius-lg);
168
- margin: var(--t-spacing-3) 0 var(--t-spacing-6);
169
- overflow-x: auto;
170
- padding: 0;
171
-
172
- pre {
173
- margin: 0;
174
- padding: 0;
175
- }
176
-
177
- code {
178
- display: block;
179
- font-family: 'Fira Code', 'Monaco', 'Menlo', 'Courier New', monospace;
180
- font-size: 0.9rem;
181
- line-height: 1.5;
182
- padding: var(--t-spacing-3);
183
- }
184
- }
185
-
186
- @media (max-width: 640px) {
187
- .demo-container {
188
- padding: var(--t-spacing-4) var(--t-spacing-3);
189
- }
190
-
191
- h1 {
192
- font-size: 2rem;
193
- }
194
-
195
- .button-grid {
196
- grid-template-columns: 1fr;
197
- }
198
- }