@sublimee/surfaces 0.1.1
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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/index.d.mts +42 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +99 -0
- package/dist/index.mjs +63 -0
- package/dist/surface.css +261 -0
- package/package.json +73 -0
- package/src/index.ts +32 -0
- package/src/surface.css +261 -0
- package/src/surface.stories.tsx +674 -0
- package/src/surface.tsx +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Juan Figueroa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# @sublimee/surfaces
|
|
2
|
+
|
|
3
|
+
Surface container components for the Sublime design system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sublimee/surfaces
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Surface } from '@sublimee/surfaces';
|
|
15
|
+
import '@sublimee/surfaces/surface.css';
|
|
16
|
+
|
|
17
|
+
// Basic usage
|
|
18
|
+
<Surface>
|
|
19
|
+
Your content here
|
|
20
|
+
</Surface>
|
|
21
|
+
|
|
22
|
+
// With options
|
|
23
|
+
<Surface
|
|
24
|
+
variant="elevated"
|
|
25
|
+
padding="lg"
|
|
26
|
+
radius="xl"
|
|
27
|
+
border
|
|
28
|
+
interactive
|
|
29
|
+
>
|
|
30
|
+
<h2>Card Title</h2>
|
|
31
|
+
<p>Card content goes here</p>
|
|
32
|
+
</Surface>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Default | Description |
|
|
38
|
+
|------|------|---------|-------------|
|
|
39
|
+
| `variant` | `'base' \| 'elevated' \| 'higher' \| 'inset' \| 'glass'` | `'elevated'` | Visual elevation variant |
|
|
40
|
+
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Internal padding |
|
|
41
|
+
| `radius` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'lg'` | Border radius |
|
|
42
|
+
| `border` | `boolean` | `false` | Show border |
|
|
43
|
+
| `interactive` | `boolean` | `true` | Enable hover shadow lift |
|
|
44
|
+
| `as` | `keyof JSX.IntrinsicElements` | `'div'` | HTML element to render |
|
|
45
|
+
|
|
46
|
+
## Variants
|
|
47
|
+
|
|
48
|
+
- **`base`**: No elevation, for page-level containers
|
|
49
|
+
- **`elevated`**: Card-level elevation (default)
|
|
50
|
+
- **`higher`**: Modal/dropdown elevation
|
|
51
|
+
- **`inset`**: Depressed surface, for input wells
|
|
52
|
+
- **`glass`**: Frosted glass effect with backdrop blur
|
|
53
|
+
|
|
54
|
+
### Glass Variant
|
|
55
|
+
|
|
56
|
+
The `glass` variant creates a frosted glass effect using `backdrop-filter`. It's designed to be used over colorful or photographic backgrounds.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Surface variant="glass" padding="lg">
|
|
60
|
+
<h2>Glass Card</h2>
|
|
61
|
+
<p>Content over a colorful background</p>
|
|
62
|
+
</Surface>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Important:** The glass surface is semi-transparent and does not modify text styling. You are responsible for ensuring text readability:
|
|
66
|
+
|
|
67
|
+
- Use text shadows: `text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5)`
|
|
68
|
+
- Choose high-contrast text colors for your background
|
|
69
|
+
- Add a subtle backdrop behind text content
|
|
70
|
+
|
|
71
|
+
Browser support: Glass uses `backdrop-filter` which is supported in all modern browsers. In unsupported browsers, the surface will fall back to a solid semi-transparent background.
|
|
72
|
+
|
|
73
|
+
### Glass Utility Class
|
|
74
|
+
|
|
75
|
+
For simple use cases, apply the glass effect directly with a CSS class:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<div class="sublime-glassed">
|
|
79
|
+
Instant glass effect
|
|
80
|
+
</div>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This is the same glass styling as the Surface component, but without the additional padding, radius options, or interactive states. Use it when you need:
|
|
84
|
+
|
|
85
|
+
- Quick glass effect without component overhead
|
|
86
|
+
- Custom padding/radius via your own styles
|
|
87
|
+
- Glass effect on elements that aren't "surfaces" (e.g., overlays, backdrops)
|
|
88
|
+
|
|
89
|
+
Both `sublime-glassed` and `variant="glass"` respect dark mode automatically.
|
|
90
|
+
|
|
91
|
+
## Theming
|
|
92
|
+
|
|
93
|
+
For full theming support including dark mode, also import the tokens:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import '@sublimee/tokens/tokens.css';
|
|
97
|
+
import '@sublimee/surfaces/surface.css';
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The surface component uses these CSS custom properties:
|
|
101
|
+
|
|
102
|
+
- `--sublime-color-surface-*` for background colors
|
|
103
|
+
- `--sublime-shadow-*` for elevation shadows
|
|
104
|
+
- `--sublime-radius-*` for border radius
|
|
105
|
+
- `--sublime-space-*` for padding
|
|
106
|
+
- `--sublime-color-border-primary` for borders
|
|
107
|
+
|
|
108
|
+
## Polymorphic Usage
|
|
109
|
+
|
|
110
|
+
Render as different HTML elements for semantic markup:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<Surface as="article">Blog post content</Surface>
|
|
114
|
+
<Surface as="section">Section content</Surface>
|
|
115
|
+
<Surface as="aside">Sidebar content</Surface>
|
|
116
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** Available surface elevation variants */
|
|
4
|
+
type SurfaceVariant = 'base' | 'elevated' | 'higher' | 'inset' | 'extruded' | 'glass';
|
|
5
|
+
/** Available padding sizes */
|
|
6
|
+
type SurfacePadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/** Available border radius sizes */
|
|
8
|
+
type SurfaceRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
9
|
+
/** Valid HTML element names for polymorphic rendering */
|
|
10
|
+
type SurfaceElement = 'div' | 'article' | 'section' | 'aside' | 'main' | 'header' | 'footer' | 'nav';
|
|
11
|
+
/** Props for the Surface component */
|
|
12
|
+
interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/** Visual elevation variant. @default 'elevated' */
|
|
14
|
+
variant?: SurfaceVariant;
|
|
15
|
+
/** Internal padding. @default 'md' */
|
|
16
|
+
padding?: SurfacePadding;
|
|
17
|
+
/** Border radius. @default 'lg' */
|
|
18
|
+
radius?: SurfaceRadius;
|
|
19
|
+
/** Show border. @default false */
|
|
20
|
+
border?: boolean;
|
|
21
|
+
/** Enable interactive hover shadow lift. @default true */
|
|
22
|
+
interactive?: boolean;
|
|
23
|
+
/** HTML element to render. @default 'div' */
|
|
24
|
+
as?: SurfaceElement;
|
|
25
|
+
/** Child elements */
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Surface component - A semantic container that wraps content with
|
|
30
|
+
* elevation, padding, and visual boundaries.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Surface variant="elevated" padding="lg">
|
|
35
|
+
* <h2>Card Title</h2>
|
|
36
|
+
* <p>Card content</p>
|
|
37
|
+
* </Surface>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const Surface: React.ForwardRefExoticComponent<SurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
|
|
42
|
+
export { Surface, type SurfaceElement, type SurfacePadding, type SurfaceProps, type SurfaceRadius, type SurfaceVariant };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** Available surface elevation variants */
|
|
4
|
+
type SurfaceVariant = 'base' | 'elevated' | 'higher' | 'inset' | 'extruded' | 'glass';
|
|
5
|
+
/** Available padding sizes */
|
|
6
|
+
type SurfacePadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/** Available border radius sizes */
|
|
8
|
+
type SurfaceRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
9
|
+
/** Valid HTML element names for polymorphic rendering */
|
|
10
|
+
type SurfaceElement = 'div' | 'article' | 'section' | 'aside' | 'main' | 'header' | 'footer' | 'nav';
|
|
11
|
+
/** Props for the Surface component */
|
|
12
|
+
interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/** Visual elevation variant. @default 'elevated' */
|
|
14
|
+
variant?: SurfaceVariant;
|
|
15
|
+
/** Internal padding. @default 'md' */
|
|
16
|
+
padding?: SurfacePadding;
|
|
17
|
+
/** Border radius. @default 'lg' */
|
|
18
|
+
radius?: SurfaceRadius;
|
|
19
|
+
/** Show border. @default false */
|
|
20
|
+
border?: boolean;
|
|
21
|
+
/** Enable interactive hover shadow lift. @default true */
|
|
22
|
+
interactive?: boolean;
|
|
23
|
+
/** HTML element to render. @default 'div' */
|
|
24
|
+
as?: SurfaceElement;
|
|
25
|
+
/** Child elements */
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Surface component - A semantic container that wraps content with
|
|
30
|
+
* elevation, padding, and visual boundaries.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Surface variant="elevated" padding="lg">
|
|
35
|
+
* <h2>Card Title</h2>
|
|
36
|
+
* <p>Card content</p>
|
|
37
|
+
* </Surface>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const Surface: React.ForwardRefExoticComponent<SurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
|
|
42
|
+
export { Surface, type SurfaceElement, type SurfacePadding, type SurfaceProps, type SurfaceRadius, type SurfaceVariant };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
Surface: () => Surface
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/surface.tsx
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var paddingMap = {
|
|
41
|
+
none: "0",
|
|
42
|
+
sm: "var(--sublime-space-3)",
|
|
43
|
+
// 12px
|
|
44
|
+
md: "var(--sublime-space-card-padding)",
|
|
45
|
+
// 24px (space-6)
|
|
46
|
+
lg: "var(--sublime-space-8)",
|
|
47
|
+
// 32px
|
|
48
|
+
xl: "var(--sublime-space-10)"
|
|
49
|
+
// 40px
|
|
50
|
+
};
|
|
51
|
+
var radiusMap = {
|
|
52
|
+
none: "var(--sublime-radius-none)",
|
|
53
|
+
sm: "var(--sublime-radius-sm)",
|
|
54
|
+
md: "var(--sublime-radius-md)",
|
|
55
|
+
lg: "var(--sublime-radius-lg)",
|
|
56
|
+
xl: "var(--sublime-radius-xl)",
|
|
57
|
+
full: "var(--sublime-radius-full)"
|
|
58
|
+
};
|
|
59
|
+
var Surface = React.forwardRef((props, ref) => {
|
|
60
|
+
const {
|
|
61
|
+
variant = "elevated",
|
|
62
|
+
padding = "md",
|
|
63
|
+
radius = "lg",
|
|
64
|
+
border = false,
|
|
65
|
+
interactive = true,
|
|
66
|
+
as: Component = "div",
|
|
67
|
+
children,
|
|
68
|
+
className = "",
|
|
69
|
+
style,
|
|
70
|
+
...rest
|
|
71
|
+
} = props;
|
|
72
|
+
const classes = [
|
|
73
|
+
"sublime-surface",
|
|
74
|
+
`sublime-surface--${variant}`,
|
|
75
|
+
interactive ? "sublime-surface--interactive" : "",
|
|
76
|
+
border ? "sublime-surface--border" : "",
|
|
77
|
+
className
|
|
78
|
+
].filter(Boolean).join(" ");
|
|
79
|
+
const inlineStyles = {
|
|
80
|
+
padding: paddingMap[padding],
|
|
81
|
+
borderRadius: radiusMap[radius],
|
|
82
|
+
...style
|
|
83
|
+
};
|
|
84
|
+
return React.createElement(
|
|
85
|
+
Component,
|
|
86
|
+
{
|
|
87
|
+
ref,
|
|
88
|
+
className: classes,
|
|
89
|
+
style: inlineStyles,
|
|
90
|
+
...rest
|
|
91
|
+
},
|
|
92
|
+
children
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
Surface.displayName = "Surface";
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
Surface
|
|
99
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/surface.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
var paddingMap = {
|
|
6
|
+
none: "0",
|
|
7
|
+
sm: "var(--sublime-space-3)",
|
|
8
|
+
// 12px
|
|
9
|
+
md: "var(--sublime-space-card-padding)",
|
|
10
|
+
// 24px (space-6)
|
|
11
|
+
lg: "var(--sublime-space-8)",
|
|
12
|
+
// 32px
|
|
13
|
+
xl: "var(--sublime-space-10)"
|
|
14
|
+
// 40px
|
|
15
|
+
};
|
|
16
|
+
var radiusMap = {
|
|
17
|
+
none: "var(--sublime-radius-none)",
|
|
18
|
+
sm: "var(--sublime-radius-sm)",
|
|
19
|
+
md: "var(--sublime-radius-md)",
|
|
20
|
+
lg: "var(--sublime-radius-lg)",
|
|
21
|
+
xl: "var(--sublime-radius-xl)",
|
|
22
|
+
full: "var(--sublime-radius-full)"
|
|
23
|
+
};
|
|
24
|
+
var Surface = React.forwardRef((props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
variant = "elevated",
|
|
27
|
+
padding = "md",
|
|
28
|
+
radius = "lg",
|
|
29
|
+
border = false,
|
|
30
|
+
interactive = true,
|
|
31
|
+
as: Component = "div",
|
|
32
|
+
children,
|
|
33
|
+
className = "",
|
|
34
|
+
style,
|
|
35
|
+
...rest
|
|
36
|
+
} = props;
|
|
37
|
+
const classes = [
|
|
38
|
+
"sublime-surface",
|
|
39
|
+
`sublime-surface--${variant}`,
|
|
40
|
+
interactive ? "sublime-surface--interactive" : "",
|
|
41
|
+
border ? "sublime-surface--border" : "",
|
|
42
|
+
className
|
|
43
|
+
].filter(Boolean).join(" ");
|
|
44
|
+
const inlineStyles = {
|
|
45
|
+
padding: paddingMap[padding],
|
|
46
|
+
borderRadius: radiusMap[radius],
|
|
47
|
+
...style
|
|
48
|
+
};
|
|
49
|
+
return React.createElement(
|
|
50
|
+
Component,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: classes,
|
|
54
|
+
style: inlineStyles,
|
|
55
|
+
...rest
|
|
56
|
+
},
|
|
57
|
+
children
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
Surface.displayName = "Surface";
|
|
61
|
+
export {
|
|
62
|
+
Surface
|
|
63
|
+
};
|
package/dist/surface.css
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @sublimee/surfaces
|
|
3
|
+
* Runtime styles for Surface components
|
|
4
|
+
*
|
|
5
|
+
* These styles provide the visual foundation that works independently
|
|
6
|
+
* of the token system. For full theming (colors, shadows, dark mode),
|
|
7
|
+
* import `@sublimee/tokens/tokens.css` in your application.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* ============================================================================
|
|
11
|
+
BASE SURFACE STYLES
|
|
12
|
+
============================================================================ */
|
|
13
|
+
|
|
14
|
+
.sublime-surface {
|
|
15
|
+
/* Layout */
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
|
|
20
|
+
/* Default transition for interactive states */
|
|
21
|
+
transition:
|
|
22
|
+
box-shadow var(--sublime-duration-fast, 150ms) var(--sublime-ease-out, ease-out),
|
|
23
|
+
transform var(--sublime-duration-fast, 150ms) var(--sublime-ease-out, ease-out);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ============================================================================
|
|
27
|
+
VARIANT STYLES
|
|
28
|
+
============================================================================ */
|
|
29
|
+
|
|
30
|
+
/* Base - No elevation, page-level containers */
|
|
31
|
+
.sublime-surface--base {
|
|
32
|
+
background-color: var(--sublime-color-surface-0, #ffffff);
|
|
33
|
+
box-shadow: var(--sublime-shadow-none, 0 0 #0000);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Elevated - Cards, content blocks (default) */
|
|
37
|
+
.sublime-surface--elevated {
|
|
38
|
+
background-color: var(--sublime-color-surface-1, #ffffff);
|
|
39
|
+
box-shadow: var(--sublime-shadow-card, 0 1px 3px 0 rgb(0 0 0 / 0.1));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Higher - Modals, dropdowns, menus */
|
|
43
|
+
.sublime-surface--higher {
|
|
44
|
+
background-color: var(--sublime-color-surface-2, #f9fafb);
|
|
45
|
+
box-shadow: var(--sublime-shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Inset - Depressed surfaces, input wells */
|
|
49
|
+
.sublime-surface--inset {
|
|
50
|
+
background-color: var(--sublime-color-surface-inset, #f3f4f6);
|
|
51
|
+
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Extruded - 3D box effect with stacked shadows */
|
|
55
|
+
.sublime-surface--extruded {
|
|
56
|
+
/* Extrusion depth */
|
|
57
|
+
--sublime-surface-extrude-depth: 6px;
|
|
58
|
+
--sublime-surface-extrude-border-light: #E4E4E8;
|
|
59
|
+
--sublime-surface-extrude-shadow-1: #EBEBEF;
|
|
60
|
+
--sublime-surface-extrude-shadow-2: #E6E6EA;
|
|
61
|
+
--sublime-surface-extrude-shadow-3: #E0E0E6;
|
|
62
|
+
--sublime-surface-extrude-shadow-4: #DADAE0;
|
|
63
|
+
--sublime-surface-extrude-shadow-5: #D4D4DA;
|
|
64
|
+
--sublime-surface-extrude-shadow-6: #CECED4;
|
|
65
|
+
|
|
66
|
+
background-color: var(--sublime-color-surface-1, #ffffff);
|
|
67
|
+
|
|
68
|
+
/* Float up-left to create space for extrusion */
|
|
69
|
+
transform: translate(calc(-1 * var(--sublime-surface-extrude-depth)), calc(-1 * var(--sublime-surface-extrude-depth)));
|
|
70
|
+
|
|
71
|
+
/* Only top/left borders - bottom/right are defined by shadows */
|
|
72
|
+
border-top: 1px solid var(--sublime-surface-extrude-border-light);
|
|
73
|
+
border-left: 1px solid var(--sublime-surface-extrude-border-light);
|
|
74
|
+
border-right: none;
|
|
75
|
+
border-bottom: none;
|
|
76
|
+
|
|
77
|
+
/* Allow shadows to extend beyond surface */
|
|
78
|
+
overflow: visible;
|
|
79
|
+
|
|
80
|
+
/* Stacked shadows create 3D side faces */
|
|
81
|
+
box-shadow:
|
|
82
|
+
1px 1px 0 var(--sublime-surface-extrude-shadow-1),
|
|
83
|
+
2px 2px 0 var(--sublime-surface-extrude-shadow-2),
|
|
84
|
+
3px 3px 0 var(--sublime-surface-extrude-shadow-3),
|
|
85
|
+
4px 4px 0 var(--sublime-surface-extrude-shadow-4),
|
|
86
|
+
5px 5px 0 var(--sublime-surface-extrude-shadow-5),
|
|
87
|
+
var(--sublime-surface-extrude-depth) var(--sublime-surface-extrude-depth) 0 var(--sublime-surface-extrude-shadow-6);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Interactive extruded - press effect */
|
|
91
|
+
.sublime-surface--interactive.sublime-surface--extruded {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.sublime-surface--interactive.sublime-surface--extruded:hover {
|
|
96
|
+
transform: translate(calc(-1 * var(--sublime-surface-extrude-depth) + 1px), calc(-1 * var(--sublime-surface-extrude-depth) + 1px));
|
|
97
|
+
box-shadow:
|
|
98
|
+
1px 1px 0 var(--sublime-surface-extrude-shadow-1),
|
|
99
|
+
2px 2px 0 var(--sublime-surface-extrude-shadow-2),
|
|
100
|
+
3px 3px 0 var(--sublime-surface-extrude-shadow-3),
|
|
101
|
+
4px 4px 0 var(--sublime-surface-extrude-shadow-4),
|
|
102
|
+
5px 5px 0 var(--sublime-surface-extrude-shadow-5),
|
|
103
|
+
calc(var(--sublime-surface-extrude-depth) - 1px) calc(var(--sublime-surface-extrude-depth) - 1px) 0 var(--sublime-surface-extrude-shadow-6);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.sublime-surface--interactive.sublime-surface--extruded:active {
|
|
107
|
+
transform: translate(0, 0);
|
|
108
|
+
box-shadow: none;
|
|
109
|
+
border-top-color: var(--sublime-surface-extrude-border-light);
|
|
110
|
+
border-left-color: var(--sublime-surface-extrude-border-light);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ============================================================================
|
|
114
|
+
INTERACTIVE STATES
|
|
115
|
+
============================================================================ */
|
|
116
|
+
|
|
117
|
+
/* Interactive surfaces lift on hover */
|
|
118
|
+
.sublime-surface--interactive.sublime-surface--elevated:hover {
|
|
119
|
+
box-shadow: var(--sublime-shadow-card-hover, 0 4px 6px -1px rgb(0 0 0 / 0.1));
|
|
120
|
+
transform: translateY(-1px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.sublime-surface--interactive.sublime-surface--higher:hover {
|
|
124
|
+
box-shadow: var(--sublime-shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
|
|
125
|
+
transform: translateY(-1px);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* No hover effect for base and inset variants */
|
|
129
|
+
.sublime-surface--interactive.sublime-surface--base:hover,
|
|
130
|
+
.sublime-surface--interactive.sublime-surface--inset:hover {
|
|
131
|
+
transform: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ============================================================================
|
|
135
|
+
BORDER STYLES
|
|
136
|
+
============================================================================ */
|
|
137
|
+
|
|
138
|
+
.sublime-surface--border {
|
|
139
|
+
border: 1px solid var(--sublime-color-border-surface, #d1d5db);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ============================================================================
|
|
143
|
+
DARK MODE OVERRIDES - Non-glass variants
|
|
144
|
+
============================================================================ */
|
|
145
|
+
|
|
146
|
+
@media (prefers-color-scheme: dark) {
|
|
147
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--base {
|
|
148
|
+
background-color: var(--sublime-color-surface-0, #0f0f0f);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--elevated {
|
|
152
|
+
background-color: var(--sublime-color-surface-1, #171717);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--higher {
|
|
156
|
+
background-color: var(--sublime-color-surface-2, #262626);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--inset {
|
|
160
|
+
background-color: var(--sublime-color-surface-inset, #0a0a0a);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--border {
|
|
164
|
+
border-color: var(--sublime-color-border-primary, #404040);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Class-based dark mode */
|
|
169
|
+
.dark .sublime-surface--base,
|
|
170
|
+
[data-theme="dark"] .sublime-surface--base {
|
|
171
|
+
background-color: var(--sublime-color-surface-0, #0f0f0f);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.dark .sublime-surface--elevated,
|
|
175
|
+
[data-theme="dark"] .sublime-surface--elevated {
|
|
176
|
+
background-color: var(--sublime-color-surface-1, #171717);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.dark .sublime-surface--higher,
|
|
180
|
+
[data-theme="dark"] .sublime-surface--higher {
|
|
181
|
+
background-color: var(--sublime-color-surface-2, #262626);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.dark .sublime-surface--inset,
|
|
185
|
+
[data-theme="dark"] .sublime-surface--inset {
|
|
186
|
+
background-color: var(--sublime-color-surface-inset, #0a0a0a);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.dark .sublime-surface--border,
|
|
190
|
+
[data-theme="dark"] .sublime-surface--border {
|
|
191
|
+
border-color: var(--sublime-color-border-surface, #525252);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Dark mode - extruded variant */
|
|
195
|
+
.dark .sublime-surface--extruded,
|
|
196
|
+
[data-theme="dark"] .sublime-surface--extruded {
|
|
197
|
+
--sublime-surface-extrude-border-light: #E8E8F0;
|
|
198
|
+
--sublime-surface-extrude-shadow-1: #3A3A42;
|
|
199
|
+
--sublime-surface-extrude-shadow-2: #36363E;
|
|
200
|
+
--sublime-surface-extrude-shadow-3: #32323A;
|
|
201
|
+
--sublime-surface-extrude-shadow-4: #2E2E36;
|
|
202
|
+
--sublime-surface-extrude-shadow-5: #2A2A32;
|
|
203
|
+
--sublime-surface-extrude-shadow-6: #26262E;
|
|
204
|
+
background-color: var(--sublime-color-surface-1, #171717);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Media query dark mode for extruded */
|
|
208
|
+
@media (prefers-color-scheme: dark) {
|
|
209
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--extruded {
|
|
210
|
+
--sublime-surface-extrude-border-light: #E8E8F0;
|
|
211
|
+
--sublime-surface-extrude-shadow-1: #3A3A42;
|
|
212
|
+
--sublime-surface-extrude-shadow-2: #36363E;
|
|
213
|
+
--sublime-surface-extrude-shadow-3: #32323A;
|
|
214
|
+
--sublime-surface-extrude-shadow-4: #2E2E36;
|
|
215
|
+
--sublime-surface-extrude-shadow-5: #2A2A32;
|
|
216
|
+
--sublime-surface-extrude-shadow-6: #26262E;
|
|
217
|
+
background-color: var(--sublime-color-surface-1, #171717);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* ============================================================================
|
|
222
|
+
GLASS UTILITY - Standalone frosted glass effect
|
|
223
|
+
============================================================================ */
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* sublime-glassed - Utility class for instant glass effect on any element
|
|
227
|
+
*
|
|
228
|
+
* Usage: <div class="sublime-glassed">Content</div>
|
|
229
|
+
* Or with Surface: <Surface variant="glass">Content</Surface>
|
|
230
|
+
*
|
|
231
|
+
* Note: The Surface component applies additional padding, radius, and layout.
|
|
232
|
+
* This utility is the raw glass styling only.
|
|
233
|
+
*/
|
|
234
|
+
.sublime-glassed,
|
|
235
|
+
.sublime-surface--glass {
|
|
236
|
+
background: rgba(255, 255, 255, 0.11);
|
|
237
|
+
border-radius: 16px;
|
|
238
|
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
|
239
|
+
backdrop-filter: blur(8.6px);
|
|
240
|
+
-webkit-backdrop-filter: blur(8.6px);
|
|
241
|
+
border: 1px solid rgba(255, 255, 255, 0.11);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.dark .sublime-glassed,
|
|
245
|
+
[data-theme="dark"] .sublime-glassed,
|
|
246
|
+
.dark .sublime-surface--glass,
|
|
247
|
+
[data-theme="dark"] .sublime-surface--glass {
|
|
248
|
+
background: rgba(255, 255, 255, 0.1);
|
|
249
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
250
|
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* System preference dark mode */
|
|
254
|
+
@media (prefers-color-scheme: dark) {
|
|
255
|
+
:root:not([data-theme="light"]):not(.light) .sublime-glassed,
|
|
256
|
+
:root:not([data-theme="light"]):not(.light) .sublime-surface--glass {
|
|
257
|
+
background: rgba(255, 255, 255, 0.1);
|
|
258
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
259
|
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
|
|
260
|
+
}
|
|
261
|
+
}
|