tgui-core 5.9.0 → 5.11.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/common/ui.d.ts +1 -1
- package/dist/common/ui.js +1 -1
- package/dist/components/DraggableControl.d.ts +2 -0
- package/dist/components/DraggableControl.js +1 -1
- package/dist/components/Dropdown.d.ts +6 -0
- package/dist/components/Dropdown.js +1 -1
- package/dist/components/Floating.d.ts +13 -11
- package/dist/components/Floating.js +1 -1
- package/dist/components/Input.d.ts +2 -0
- package/dist/components/Input.js +1 -1
- package/dist/components/Slider.js +1 -1
- package/package.json +1 -1
- package/styles/all-atomic.scss +1 -0
- package/styles/atomic/helpers.scss +19 -0
- package/styles/base.scss +103 -20
- package/styles/colors.scss +107 -40
- package/styles/components/Button.scss +0 -1
- package/styles/components/Dialog.scss +2 -2
- package/styles/components/Dropdown.scss +36 -7
- package/styles/components/MenuBar.scss +4 -4
- package/styles/components/NoticeBox.scss +3 -3
- package/styles/components/NumberInput.scss +6 -6
- package/styles/components/ProgressBar.scss +0 -1
- package/styles/components/Section.scss +4 -4
- package/styles/components/Slider.scss +9 -2
- package/styles/components/Tooltip.scss +2 -2
- package/styles/functions.scss +22 -2
- package/styles/main.scss +2 -2
- package/styles/vars-components.scss +5 -0
- package/styles/vars-colors.scss +0 -114
- package/styles/vars-values.scss +0 -110
package/dist/common/ui.d.ts
CHANGED
|
@@ -118,6 +118,6 @@ type StyleMap = StringStyleMap & BooleanStyleMap;
|
|
|
118
118
|
/** Super light implementation of tailwind-like class names. */
|
|
119
119
|
export declare function computeTwClass(input: string | undefined): StyleMap;
|
|
120
120
|
/** Short list of accepted DOM event handlers */
|
|
121
|
-
export declare const eventHandlers: ["onClick", "onContextMenu", "onDoubleClick", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseMove", "onMouseOver", "onMouseUp", "onScroll", "onWheel", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop"];
|
|
121
|
+
export declare const eventHandlers: ["onClick", "onAuxClick", "onContextMenu", "onDoubleClick", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOver", "onMouseUp", "onScroll", "onWheel", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop"];
|
|
122
122
|
export type EventHandlers<TElement = HTMLDivElement> = Pick<DOMAttributes<TElement>, (typeof eventHandlers)[number]>;
|
|
123
123
|
export {};
|
package/dist/common/ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CSS_COLORS as t}from"./constants.js";import{classes as o}from"./react.js";let e=t=>"string"==typeof t?t.endsWith("px")?`${Number.parseFloat(t)/12}rem`:t:"number"==typeof t?`${t}rem`:void 0,n=t=>"string"==typeof t?e(t):"number"==typeof t?e(.5*t):void 0;function i(o){return"string"==typeof o&&t.includes(o)}let r=t=>(o,e)=>{("number"==typeof e||"string"==typeof e)&&(o[t]=e)},l=(t,o)=>(e,n)=>{("number"==typeof n||"string"==typeof n)&&(e[t]=o(n))},p=(t,o)=>(e,n)=>{n&&(e[t]=o)},a=(t,o,e)=>(n,i)=>{if("number"==typeof i||"string"==typeof i)for(let r=0;r<e.length;r++)n[t+e[r]]=o(i)},g=t=>(o,e)=>{i(e)||(o[t]=e)},f={align:r("textAlign"),backgroundColor:g("backgroundColor"),bottom:l("bottom",e),color:g("color"),fontFamily:r("fontFamily"),fontSize:l("fontSize",e),fontWeight:r("fontWeight"),g:l("gap",n),gc:l("columnGap",n),gr:l("rowGap",n),height:l("height",e),left:l("left",e),lineHeight:(t,o)=>{"number"==typeof o?t.lineHeight=o:"string"==typeof o&&(t.lineHeight=e(o))},m:a("margin",n,["Top","Bottom","Left","Right"]),maxHeight:l("maxHeight",e),maxWidth:l("maxWidth",e),mb:l("marginBottom",n),minHeight:l("minHeight",e),minWidth:l("minWidth",e),ml:l("marginLeft",n),mr:l("marginRight",n),mt:l("marginTop",n),mx:a("margin",n,["Left","Right"]),my:a("margin",n,["Top","Bottom"]),opacity:r("opacity"),overflow:r("overflow"),overflowX:r("overflowX"),overflowY:r("overflowY"),p:a("padding",n,["Top","Bottom","Left","Right"]),pb:l("paddingBottom",n),pl:l("paddingLeft",n),position:r("position"),pr:l("paddingRight",n),pt:l("paddingTop",n),px:a("padding",n,["Left","Right"]),py:a("padding",n,["Top","Bottom"]),right:l("right",e),textAlign:r("textAlign"),textColor:g("color"),top:l("top",e),verticalAlign:r("verticalAlign"),width:l("width",e)},m={bold:p("fontWeight","bold"),fillPositionedParent:(t,o)=>{o&&(t.position="absolute",t.top=0,t.bottom=0,t.left=0,t.right=0)},inline:p("display","inline-block"),italic:p("fontStyle","italic"),nowrap:p("whiteSpace","nowrap"),preserveWhitespace:p("whiteSpace","pre-wrap")};function s(t){let o={},e={};for(let n in t){if("style"===n)continue;let i=t[n],r=f[n]||m[n];r?r(e,i):o[n]=i}return o.style={...e,...t.style},o}function u(t){let e=t.textColor||t.color,{backgroundColor:n}=t;return o([i(e)&&`color-${e}`,i(n)&&`color-bg-${n}`])}function c(t){let o={};if(!t)return o;for(let e of t.split(" ")){let[t,n]=e.split("-");if(t)if(t in f){if(""===n)continue;let e=Number(n);!Number.isNaN(e)&&Number.isFinite(e)?o[t]=e:o[t]=n}else t in m?o[t]=!0:console.warn(`Unknown prop ${t}`)}return o}let h=["onClick","onContextMenu","onDoubleClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseMove","onMouseOver","onMouseUp","onScroll","onWheel","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"];export{m as booleanStyleMap,u as computeBoxClassName,s as computeBoxProps,c as computeTwClass,h as eventHandlers,n as halfUnit,f as stringStyleMap,e as unit};
|
|
1
|
+
import{CSS_COLORS as t}from"./constants.js";import{classes as o}from"./react.js";let e=t=>"string"==typeof t?t.endsWith("px")?`${Number.parseFloat(t)/12}rem`:t:"number"==typeof t?`${t}rem`:void 0,n=t=>"string"==typeof t?e(t):"number"==typeof t?e(.5*t):void 0;function i(o){return"string"==typeof o&&t.includes(o)}let r=t=>(o,e)=>{("number"==typeof e||"string"==typeof e)&&(o[t]=e)},l=(t,o)=>(e,n)=>{("number"==typeof n||"string"==typeof n)&&(e[t]=o(n))},p=(t,o)=>(e,n)=>{n&&(e[t]=o)},a=(t,o,e)=>(n,i)=>{if("number"==typeof i||"string"==typeof i)for(let r=0;r<e.length;r++)n[t+e[r]]=o(i)},g=t=>(o,e)=>{i(e)||(o[t]=e)},f={align:r("textAlign"),backgroundColor:g("backgroundColor"),bottom:l("bottom",e),color:g("color"),fontFamily:r("fontFamily"),fontSize:l("fontSize",e),fontWeight:r("fontWeight"),g:l("gap",n),gc:l("columnGap",n),gr:l("rowGap",n),height:l("height",e),left:l("left",e),lineHeight:(t,o)=>{"number"==typeof o?t.lineHeight=o:"string"==typeof o&&(t.lineHeight=e(o))},m:a("margin",n,["Top","Bottom","Left","Right"]),maxHeight:l("maxHeight",e),maxWidth:l("maxWidth",e),mb:l("marginBottom",n),minHeight:l("minHeight",e),minWidth:l("minWidth",e),ml:l("marginLeft",n),mr:l("marginRight",n),mt:l("marginTop",n),mx:a("margin",n,["Left","Right"]),my:a("margin",n,["Top","Bottom"]),opacity:r("opacity"),overflow:r("overflow"),overflowX:r("overflowX"),overflowY:r("overflowY"),p:a("padding",n,["Top","Bottom","Left","Right"]),pb:l("paddingBottom",n),pl:l("paddingLeft",n),position:r("position"),pr:l("paddingRight",n),pt:l("paddingTop",n),px:a("padding",n,["Left","Right"]),py:a("padding",n,["Top","Bottom"]),right:l("right",e),textAlign:r("textAlign"),textColor:g("color"),top:l("top",e),verticalAlign:r("verticalAlign"),width:l("width",e)},m={bold:p("fontWeight","bold"),fillPositionedParent:(t,o)=>{o&&(t.position="absolute",t.top=0,t.bottom=0,t.left=0,t.right=0)},inline:p("display","inline-block"),italic:p("fontStyle","italic"),nowrap:p("whiteSpace","nowrap"),preserveWhitespace:p("whiteSpace","pre-wrap")};function s(t){let o={},e={};for(let n in t){if("style"===n)continue;let i=t[n],r=f[n]||m[n];r?r(e,i):o[n]=i}return o.style={...e,...t.style},o}function u(t){let e=t.textColor||t.color,{backgroundColor:n}=t;return o([i(e)&&`color-${e}`,i(n)&&`color-bg-${n}`])}function c(t){let o={};if(!t)return o;for(let e of t.split(" ")){let[t,n]=e.split("-");if(t)if(t in f){if(""===n)continue;let e=Number(n);!Number.isNaN(e)&&Number.isFinite(e)?o[t]=e:o[t]=n}else t in m?o[t]=!0:console.warn(`Unknown prop ${t}`)}return o}let h=["onClick","onAuxClick","onContextMenu","onDoubleClick","onKeyDown","onKeyUp","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOver","onMouseUp","onScroll","onWheel","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"];export{m as booleanStyleMap,u as computeBoxClassName,s as computeBoxProps,c as computeTwClass,h as eventHandlers,n as halfUnit,f as stringStyleMap,e as unit};
|
|
@@ -21,6 +21,8 @@ type Props = {
|
|
|
21
21
|
} & Partial<{
|
|
22
22
|
/** Animates the value if it was changed externally. */
|
|
23
23
|
animated: boolean;
|
|
24
|
+
/** Disables the control. */
|
|
25
|
+
disabled: boolean;
|
|
24
26
|
/** The matrix to use for the drag. */
|
|
25
27
|
dragMatrix: [number, number];
|
|
26
28
|
/** onChange also fires when you drag the input. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{KEY as n,isEscape as u}from"../common/keys.js";import{clamp as o}from"../common/math.js";import{useEffect as l,useRef as c,useState as i}from"react";import{AnimatedNumber as a}from"./AnimatedNumber.js";function s(e,r){return e.screenX*r[0]+e.screenY*r[1]}function m(m){let{animated:f,
|
|
1
|
+
import{Fragment as e,jsx as r,jsxs as t}from"react/jsx-runtime";import{KEY as n,isEscape as u}from"../common/keys.js";import{clamp as o}from"../common/math.js";import{useEffect as l,useRef as c,useState as i}from"react";import{AnimatedNumber as a}from"./AnimatedNumber.js";function s(e,r){return e.screenX*r[0]+e.screenY*r[1]}function m(m){let{animated:f,disabled:v,children:p,dragMatrix:d=[1,0],tickWhileDragging:y,format:h,maxValue:g=1/0,minValue:E=-1/0,onChange:b,step:N=1,stepPixelSize:w,unclamped:T,unit:j,updateRate:x=400,fontSize:L,height:S,lineHeight:k}=m,[z,D]=i(m.value),[I,O]=i(!1),F=c(!1),M=c(m.value),$=c(0),_=c(0),A=c(null),B=c(null),C=c(null),H=c(null);function K(e){let r=_.current;if(null===r)throw Error("Origin is unset.");let t=s(e,d),n=A.current;if(null===n)throw Error("Final step pixel size has not been computed.");let u=$.current;if(null===u)throw Error("Original value is unset.");let l=o(Math.floor(u/N)*N+Math.trunc((t-r)/n)*N,E,g);M.current=l,D(l)}function P(e){document.body.style["pointer-events"]="auto",C.current&&clearInterval(C.current),_.current=null,A.current=null,$.current=null,document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",P),F.current&&(b?.(e,M.current),F.current=!1)}l(()=>{m.value!==M.current&&(M.current=m.value,D(m.value))},[m.value]);let U=m.value;F.current&&(U=M.current);let W=t(e,{children:[f&&!F.current?r(a,{format:h,value:U}):h?h(U):U,j?` ${j}`:""]}),X=r("input",{className:"NumberInput__input",onBlur:function(e){let r=Number.parseFloat(e.currentTarget.value);(T||(r=o(r,E,g)),Number.isNaN(r))?O(!1):(M.current=r,D(r),b?.(e.nativeEvent,r),I&&O(!1))},onKeyDown:function(e){(e.key===n.Enter||u(e.key))&&O(!1)},ref:B,readOnly:v,style:{display:I?void 0:"none",fontSize:L,height:S,lineHeight:k}});return p({displayElement:W,displayValue:U,dragging:F.current,editing:I,handleDragStart:function(e){if(!I&&!v){if("number"!=typeof w){let r=e.currentTarget.offsetWidth/((g-E)/N);if(void 0===w)A.current=r;else if("function"==typeof w)A.current=w(r);else throw Error(`Unsupported value for stepPixelSize of type ${typeof w}`)}else A.current=w;document.body.style["pointer-events"]="none",_.current=s(e.nativeEvent,d),$.current=m.value,F.current=!0,document.addEventListener("mouseup",P),H.current=setTimeout(()=>{var r=e.nativeEvent;if(F.current)document.addEventListener("mousemove",K),C.current=setInterval(()=>{F.current&&y&&b?.(r,M.current)},x);else if(O(!0),B.current){let e=B.current;e.value=M.current.toString(),setTimeout(()=>{e.focus(),e.select()},10)}H.current&&clearTimeout(H.current)},100)}},inputElement:X})}export{m as DraggableControl};
|
|
@@ -32,6 +32,10 @@ type Props = {
|
|
|
32
32
|
iconRotation: number;
|
|
33
33
|
/** Whether or not the icon should spin */
|
|
34
34
|
iconSpin: boolean;
|
|
35
|
+
/** Whether we want to make the search input styled like a regular dropdown button. */
|
|
36
|
+
styledInput: boolean;
|
|
37
|
+
/** Maximum number of items to display before having to scroll */
|
|
38
|
+
maxItems: number;
|
|
35
39
|
/** Width of the dropdown menu in box units. Default: 15 */
|
|
36
40
|
menuWidth: string | number;
|
|
37
41
|
/** Whether or not the arrow on the right hand side of the dropdown button is visible */
|
|
@@ -42,6 +46,8 @@ type Props = {
|
|
|
42
46
|
fluid: boolean;
|
|
43
47
|
/** Text to show when nothing has been selected. */
|
|
44
48
|
placeholder: string;
|
|
49
|
+
/** Turns the dropdown button into a search textbox. Incompatible with Tiny */
|
|
50
|
+
searchInput: boolean;
|
|
45
51
|
/** @deprecated If you want to allow dropdown breaks layout, set width 100% */
|
|
46
52
|
clipSelectedText: boolean;
|
|
47
53
|
/** Called when dropdown button is clicked */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as
|
|
1
|
+
import{Fragment as e,jsx as n,jsxs as o}from"react/jsx-runtime";import{KEY as t}from"../common/keys.js";import{classes as r}from"../common/react.js";import{unit as l}from"../common/ui.js";import{useRef as i,useState as d}from"react";import{Button as c}from"./Button.js";import{Floating as s}from"./Floating.js";import{Icon as a}from"./Icon.js";import{Input as u}from"./Input.js";let p=null;function m(e){return"string"==typeof e?e:e.value}function w(w){let{autoScroll:_=!0,buttons:h,className:f,color:y="default",disabled:D,displayText:v,icon:N,iconRotation:g,iconSpin:b,iconOnly:C,styledInput:x,maxItems:j,menuWidth:k,noChevron:S,onClick:B,onSelected:E,options:F=[],over:I,placeholder:M="Select...",searchInput:T,selected:K,fluid:O,width:$=15}=w,[A,L]=d(!1),[P,z]=d(""),U=i(null),V=i(!1),W=i(!1),q=i(null),G=F.findIndex(e=>m(e)===K)||0;function H(e){let n=e;n=e<G?e<2?0:e-2:e>F.length-3?F.length-1:e-2;let o=U.current,t=o?.children[n];o&&t&&(o.scrollTop=t.offsetTop)}function J(e){let n;if(F.length<1||D)return;let o=F.length-1;n=G<0?"next"===e?o:0:"next"===e?G===o?0:G+1:0===G?o:G-1,A&&_&&H(n),E?.(m(F[n]))}let Q=P?F.filter(e=>("string"==typeof e?e:e.displayText||m(e)).toString().toLowerCase().includes(P.toLowerCase())):F,R=I?"top":"bottom";C&&(R=`${R}-start`);let X=j?{"--dropdown-menu-max-height":l(Math.max(Math.min(j,25),3)*function(){if(null!==p)return p;let e=parseFloat(getComputedStyle(document.body).getPropertyValue("--font-size")),n=document.createElement("div");n.className="Dropdown__menu--entry",n.textContent="test",document.body.appendChild(n);let o=parseFloat(getComputedStyle(n).height);return document.body.removeChild(n),p=Number.isNaN(o)||0===o||Number.isNaN(e)||0===e?1.7:o/e}())}:void 0;return o("div",{className:r(["Dropdown",O&&"Dropdown--fluid",T&&x&&`Button--color--${y}`]),children:[n(s,{ref:q,allowedOutsideClasses:".Dropdown__button",closeAfterInteract:!0,content:n("div",{className:"Dropdown__menu",ref:U,style:X,children:0===Q.length?n("div",{className:"Dropdown__menu--entry",children:"No options"}):Q.map(e=>{let o=m(e);return n("div",{className:r(["Dropdown__menu--entry",K===o&&"selected"]),onClick:()=>{V.current=!0,E?.(o),z("")},onKeyDown:e=>{e.key===t.Enter&&(V.current=!0,E?.(o),z(""))},children:"string"==typeof e?e:e.displayText},o)})}),contentAutoWidth:!k,contentClasses:"Dropdown__menu--wrapper",contentStyles:{width:k?l(k):void 0},disabled:D,onMounted:()=>{A&&_&&-1!==G&&H(G)},onOpenChange:L,placement:R,children:T?o("div",{className:"Dropdown__input-wrapper",style:{width:l($)},children:[n(u,{className:r(["Dropdown__input",x&&"Dropdown__input--styled",f]),placeholder:v?.toString()||M,disabled:D,value:P,alwaysUpdate:!0,onKeyDown:e=>{" "===e.key&&e.stopPropagation()},onEnter:()=>{W.current=!0,q.current?.close()},onChange:z,onBlur:function(e){e&&W.current&&!V.current&&Q.length>0&&(V.current=!0,E?.(m(Q[0]))),V.current=!1,W.current=!1,z("")},fluid:!0}),!S&&n("div",{className:"Dropdown__input-chevron",children:n(a,{className:r(["Dropdown__icon","Dropdown__icon--arrow",A&&"open"]),name:"chevron-down"})})]}):o("div",{className:r(["Dropdown__control",`Button--color--${y}`,D&&"Button--disabled",C&&"Dropdown__control--icon-only",f]),onClick:e=>{(!D||A)&&B?.(e)},onKeyDown:e=>{e.key!==t.Enter||D||B?.(e)},style:{width:l($)},children:[N&&n(a,{className:"Dropdown__icon",name:N,rotation:g,spin:b}),!C&&o(e,{children:[n("span",{className:"Dropdown__selected-text",children:v||K&&m(K)||M}),!S&&n(a,{className:r(["Dropdown__icon","Dropdown__icon--arrow",I&&"over",A&&"open"]),name:"chevron-down"})]})]})}),h&&o(e,{children:[n(c,{className:"Dropdown__button",disabled:D,icon:"chevron-left",onClick:()=>{J("previous")}}),n(c,{className:"Dropdown__button",disabled:D,icon:"chevron-right",onClick:()=>{J("next")}})]})]})}new MutationObserver(()=>{p=null}).observe(document.documentElement,{attributes:!0,attributeFilter:["style"]});export{w as Dropdown};
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type BooleanLike } from '../common/react.ts';
|
|
2
2
|
import { type Placement } from '@floating-ui/react';
|
|
3
3
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
4
|
-
type
|
|
4
|
+
export type FloatingHandle = {
|
|
5
|
+
/** Imperatively close the floating element. */
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* ## Floating
|
|
10
|
+
*
|
|
11
|
+
* Floating lets you position elements so that they don't go out of the bounds of the window.
|
|
12
|
+
*
|
|
13
|
+
* - [Documentation](https://floating-ui.com/docs/react) for more information.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Floating: import("react").ForwardRefExoticComponent<{
|
|
5
16
|
/** Interacting with this element will open the floating element. */
|
|
6
17
|
children: ReactNode;
|
|
7
18
|
/** The content to display like floating. */
|
|
@@ -75,13 +86,4 @@ type Props = {
|
|
|
75
86
|
* Called when mounted
|
|
76
87
|
*/
|
|
77
88
|
onMounted: () => void;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* ## Floating
|
|
81
|
-
*
|
|
82
|
-
* Floating lets you position elements so that they don't go out of the bounds of the window.
|
|
83
|
-
*
|
|
84
|
-
* - [Documentation](https://floating-ui.com/docs/react) for more information.
|
|
85
|
-
*/
|
|
86
|
-
export declare function Floating(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
87
|
-
export {};
|
|
89
|
+
}> & import("react").RefAttributes<FloatingHandle>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{classes as o}from"../common/react.js";import{FloatingPortal as
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{classes as o}from"../common/react.js";import{FloatingPortal as a,autoUpdate as i,flip as r,offset as l,safePolygon as s,shift as c,size as d,useClick as m,useDismiss as p,useFloating as g,useHover as f,useInteractions as h,useTransitionStatus as u}from"@floating-ui/react";import{cloneElement as C,forwardRef as F,isValidElement as v,useEffect as w,useImperativeHandle as O,useState as b}from"react";let x=F(function(F,x){let y,{allowedOutsideClasses:R,animationDuration:j,children:k,closeAfterInteract:z,content:E,contentAutoWidth:M,contentClasses:P,contentOffset:S=6,contentStyles:q,disabled:I,hoverDelay:N,hoverOpen:$,hoverSafePolygon:_,handleOpen:A,onMounted:B,placement:D,preventPortal:G,stopChildPropagation:H,onOpenChange:J}=F,[K,L]=b(!1),{refs:Q,floatingStyles:T,context:U}=g({middleware:[l(S),r({padding:6}),c(),M&&d({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})],onOpenChange(e){L(e),J?.(e)},open:K,placement:D||"bottom",transform:!1,whileElementsMounted:(e,t,n)=>(void 0!==B&&B(),i(e,t,n,{ancestorResize:!1,ancestorScroll:!1,elementResize:!1}))});O(x,()=>({close:()=>U.onOpenChange(!1)}));let{isMounted:V,status:W}=u(U,{duration:j||200}),X=p(U,{ancestorScroll:!0,outsidePress:e=>!R||e.target instanceof Element&&!e.target.closest(R)}),Y=m(U,{enabled:!I}),Z=f(U,{enabled:!I,restMs:N||200,handleClose:_?s({requireIntent:!1}):null}),ee=void 0!==A,{getReferenceProps:et,getFloatingProps:en}=h(ee?[]:[X,$?Z:Y]),eo=et({ref:Q.setReference,...H&&{onClick:e=>e.stopPropagation()}}),ea=en({onClick:()=>{z&&U.onOpenChange(!1)},ref:Q.setFloating});w(()=>{ee&&U.onOpenChange(A)},[A]),y=v(k)?C(k,eo):t("div",{...eo,children:k});let ei=t("div",{className:o(["Floating",!j&&"Floating--animated",P]),"data-position":U.placement,"data-transition":W,style:{...T,...q},...ea,children:E});return n(e,{children:[y,V&&!!E&&(G?ei:t(a,{id:"tgui-root",children:ei}))]})});export{x as Floating};
|
|
@@ -24,6 +24,8 @@ export type BaseInputProps<TElement = HTMLInputElement, TInput = string> = Parti
|
|
|
24
24
|
fluid: boolean;
|
|
25
25
|
/** Mark this if you want to use a monospace font */
|
|
26
26
|
monospace: boolean;
|
|
27
|
+
/** Will force an update when value changes even if the input isn't currently highlighted */
|
|
28
|
+
alwaysUpdate: boolean;
|
|
27
29
|
/** Fires each time focus leaves the input, including if Esc or Enter are pressed */
|
|
28
30
|
onBlur: (value: TInput) => void;
|
|
29
31
|
/**
|
package/dist/components/Input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{KEY as t,isEscape as r}from"../common/keys.js";import{classes as n}from"../common/react.js";import{inputDebounce as u}from"../common/timer.js";import{computeBoxClassName as o,computeBoxProps as m}from"../common/ui.js";import{useEffect as c,useRef as l,useState as a}from"react";function p(p){let{autoFocus:i,autoSelect:f,className:s,disabled:d,expensive:g,fluid:v,maxLength:T,monospace:y,onBlur:b,onChange:j,onEnter:I,onEscape:h,onKeyDown:k,placeholder:x,ref:C,selfClear:D,spellcheck:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{KEY as t,isEscape as r}from"../common/keys.js";import{classes as n}from"../common/react.js";import{inputDebounce as u}from"../common/timer.js";import{computeBoxClassName as o,computeBoxProps as m}from"../common/ui.js";import{useEffect as c,useRef as l,useState as a}from"react";function p(p){let{autoFocus:i,autoSelect:f,className:s,disabled:d,expensive:g,fluid:v,maxLength:T,monospace:y,onBlur:b,onChange:j,onEnter:I,onEscape:h,onKeyDown:k,placeholder:x,ref:C,selfClear:D,alwaysUpdate:E,spellcheck:w=!1,value:B,...K}=p,L=l(null),N=C??L,[q,z]=a(B??"");c(()=>{let e;return(i||f)&&(e=setTimeout(()=>{N.current?.focus(),f&&N.current?.select()},1)),()=>clearTimeout(e)},[]),c(()=>{(N.current&&document.activeElement!==N.current&&B!==q||E)&&z(B??"")},[B]);let A=m(K),F=n(["Input",d&&"Input--disabled",v&&"Input--fluid",y&&"Input--monospace",o(K),s]);return e("input",{...A,autoComplete:"off",className:F,disabled:d,maxLength:T,onBlur:()=>b?.(q),onChange:function(e){let t=e.currentTarget.value;z(t),g?u("number"==typeof g?g:250)(()=>j?.(t,e)):j?.(t,e)},onKeyDown:function(e){if(k?.(e),e.key===t.Enter){e.preventDefault(),I?.(e.currentTarget.value,e),D&&z(""),e.currentTarget.blur();return}r(e.key)&&(e.preventDefault(),h?.(e.currentTarget.value,e),e.currentTarget.blur())},placeholder:x,ref:N,spellCheck:w,type:"text",value:q})}export{p as Input};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{clamp01 as i,keyOfMatchingRange as
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{clamp01 as i,keyOfMatchingRange as l,scale as s}from"../common/math.js";import{classes as a}from"../common/react.js";import{computeBoxClassName as o,computeBoxProps as t}from"../common/ui.js";import{DraggableControl as d}from"./DraggableControl.js";function m(m){let{animated:c,disabled:n,tickWhileDragging:_,format:f,maxValue:h,minValue:u,onChange:g,step:p,stepPixelSize:v,unit:B,value:N,className:P,fillValue:S,color:j,ranges:w={},children:x,...y}=m,M=void 0!==x;return r(d,{dragMatrix:[1,0],animated:c,disabled:n,tickWhileDragging:_,format:f,maxValue:h,minValue:u,onChange:g,step:p,stepPixelSize:v,unit:B,value:N,children:d=>{let{displayElement:m,displayValue:c,dragging:_,editing:f,handleDragStart:g,inputElement:p}=d,v=null!=S,B=i(s(S??c,u,h)),$=i(s(c,u,h)),b=j||l(S??N,w)||"default";return e("div",{className:a(["Slider",n&&"Slider--disabled",f&&"Slider--editing","ProgressBar",`ProgressBar--color--${b}`,P,o(y)]),...t(y),onMouseDown:g,children:[r("div",{className:a(["ProgressBar__fill",v&&!_&&"ProgressBar__fill--animated"]),style:{opacity:.4,width:`${100*Math.max(B,$)}%`}}),r("div",{className:a(["ProgressBar__fill",!_&&"ProgressBar__fill--animated"]),style:{width:`${100*Math.min(B,$)}%`}}),r("div",{className:"Slider__cursorOffset",style:{width:`${100*$}%`},children:r("div",{className:"Slider__cursor",children:_&&r("div",{className:"Slider__popupValue",children:m})})}),r("div",{className:"ProgressBar__content",children:M?x:m}),p]})}})}export{m as Slider};
|
package/package.json
CHANGED
package/styles/all-atomic.scss
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@include meta.load-css("./atomic/centered-image.scss");
|
|
6
6
|
@include meta.load-css("./atomic/color.scss");
|
|
7
7
|
@include meta.load-css("./atomic/debug-layout.scss");
|
|
8
|
+
@include meta.load-css("./atomic/helpers.scss");
|
|
8
9
|
@include meta.load-css("./atomic/fit-text.scss");
|
|
9
10
|
@include meta.load-css("./atomic/links.scss");
|
|
10
11
|
@include meta.load-css("./atomic/outline.scss");
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.dragging {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.moving {
|
|
6
|
+
cursor: var(--cursor-grab);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.resizing-x {
|
|
10
|
+
cursor: var(--cursor-e-resize);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.resizing-y {
|
|
14
|
+
cursor: var(--cursor-n-resize);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.resizing-both {
|
|
18
|
+
cursor: var(--cursor-se-resize);
|
|
19
|
+
}
|
package/styles/base.scss
CHANGED
|
@@ -1,29 +1,112 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TGUI
|
|
3
|
+
* Base variables
|
|
4
|
+
*
|
|
5
|
+
* This file contains all values, like spacings, sizes, etc.
|
|
6
|
+
* You won't find any colors here, just numbers and letters.
|
|
7
|
+
*
|
|
8
|
+
* Made with love by Aylong (https://github.com/AyIong)
|
|
3
9
|
*/
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
:root {
|
|
12
|
+
/* Font */
|
|
13
|
+
--font-size: 12px;
|
|
14
|
+
--font-family: Verdana, Geneva, sans-serif;
|
|
15
|
+
--font-family-mono: Consolas, monospace;
|
|
7
16
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
/* Border thickness */
|
|
18
|
+
--border-thickness-unit: 0.5em;
|
|
19
|
+
/* 1px | 0.085em */
|
|
20
|
+
--border-thickness-tiny: calc(var(--border-thickness-unit) * 0.5 * 0.34);
|
|
21
|
+
/* 2px | 0.17em */
|
|
22
|
+
--border-thickness-small: calc(var(--border-thickness-unit) * 0.34);
|
|
23
|
+
/* 3px | 0.25em */
|
|
24
|
+
--border-thickness-medium: calc(var(--border-thickness-unit) * 0.5);
|
|
25
|
+
/* 4px | 0.33em */
|
|
26
|
+
--border-thickness-large: calc(var(--border-thickness-unit) * 0.66);
|
|
27
|
+
/* 6px | 0.5em */
|
|
28
|
+
--border-thickness-larger: var(--border-thickness-unit);
|
|
14
29
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
30
|
+
/* Border radius */
|
|
31
|
+
--border-radius-unit: 1rem;
|
|
32
|
+
/* 2px | 0.17rem */
|
|
33
|
+
--border-radius-tiny: calc(var(--border-radius-unit) * 0.25 * 0.68);
|
|
34
|
+
/* 3px | 0.25rem */
|
|
35
|
+
--border-radius-small: calc(var(--border-radius-unit) * 0.25);
|
|
36
|
+
/* 4px | 0.33rem */
|
|
37
|
+
--border-radius-medium: calc(var(--border-radius-unit) * 0.33);
|
|
38
|
+
/* 6px | 0.5rem */
|
|
39
|
+
--border-radius-large: calc(var(--border-radius-unit) * 0.5);
|
|
40
|
+
/* 10px | 0.75rem */
|
|
41
|
+
--border-radius-larger: calc(var(--border-radius-unit) * 0.75);
|
|
42
|
+
/* 12px | 1rem*/
|
|
43
|
+
--border-radius-huge: var(--border-radius-unit);
|
|
44
|
+
/* 24px | 2rem*/
|
|
45
|
+
--border-radius-giant: calc(var(--border-radius-unit) * 2);
|
|
46
|
+
/* Maximum border radius. Makes perfect circles */
|
|
47
|
+
--border-radius-circular: 99999px;
|
|
18
48
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
49
|
+
/* Spacing */
|
|
50
|
+
--space-unit: 1em;
|
|
51
|
+
/* 1px | 0.085em */
|
|
52
|
+
--space-xxs: calc(var(--space-unit) * 0.25 * 0.34);
|
|
53
|
+
/* 2px | 0.17em */
|
|
54
|
+
--space-xs: calc(var(--space-unit) * 0.25 * 0.68);
|
|
55
|
+
/* 3px | 0.25em */
|
|
56
|
+
--space-s: calc(var(--space-unit) * 0.25);
|
|
57
|
+
/* 4px | 0.33em */
|
|
58
|
+
--space-sm: calc(var(--space-unit) * 0.33);
|
|
59
|
+
/* 6px | 0.5em */
|
|
60
|
+
--space-m: calc(var(--space-unit) * 0.5);
|
|
61
|
+
/* 8px | 0.66em */
|
|
62
|
+
--space-ml: calc(var(--space-unit) * 0.66);
|
|
63
|
+
/* 10px | 0.75em */
|
|
64
|
+
--space-l: calc(var(--space-unit) * 0.75);
|
|
65
|
+
/* 12px | 1em*/
|
|
66
|
+
--space-xl: var(--space-unit);
|
|
67
|
+
/* 24px | 2em*/
|
|
68
|
+
--space-xxl: calc(var(--space-unit) * 2);
|
|
22
69
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
70
|
+
/* Transition */
|
|
71
|
+
--transition-time-unit: 1s;
|
|
72
|
+
/* 0.1s | 100ms */
|
|
73
|
+
--transition-time-fast: calc(var(--transition-time-unit) * 0.1);
|
|
74
|
+
/* 0.2s | 200ms */
|
|
75
|
+
--transition-time-medium: calc(var(--transition-time-unit) * 0.2);
|
|
76
|
+
/* 0.5s | 500ms */
|
|
77
|
+
--transition-time-slow: calc(var(--transition-time-unit) * 0.5);
|
|
78
|
+
/* 1s | 1000ms */
|
|
79
|
+
--transition-time-slowest: var(--transition-time-unit);
|
|
80
|
+
|
|
81
|
+
/* Shadows */
|
|
82
|
+
--shadow-unit: 1rem;
|
|
83
|
+
/* 0 0 0.5rem */
|
|
84
|
+
--shadow-glow-small: 0 0 calc(var(--shadow-unit) * 0.5);
|
|
85
|
+
/* 0 0 1rem */
|
|
86
|
+
--shadow-glow-medium: 0 0 var(--shadow-unit);
|
|
87
|
+
/* 0 0 2rem */
|
|
88
|
+
--shadow-glow-large: 0 0 calc(var(--shadow-unit) * 2);
|
|
89
|
+
|
|
90
|
+
/* Blur */
|
|
91
|
+
--blur-small: blur(6px);
|
|
92
|
+
--blur-medium: blur(12px);
|
|
93
|
+
--blur-large: blur(24px);
|
|
94
|
+
|
|
95
|
+
/* Adjustments */
|
|
96
|
+
/* Color lightness multiplier. + for FG - for BG */
|
|
97
|
+
--adjust-color: 5;
|
|
98
|
+
/* Color lightness multiplier when hovered */
|
|
99
|
+
--adjust-hover: 10;
|
|
100
|
+
/* Color lightness multiplier when active (clicked) */
|
|
101
|
+
--adjust-active: 7.5;
|
|
26
102
|
|
|
27
|
-
|
|
28
|
-
|
|
103
|
+
/* Cursors */
|
|
104
|
+
--cursor-default: default;
|
|
105
|
+
--cursor-pointer: pointer;
|
|
106
|
+
--cursor-grab: grab;
|
|
107
|
+
--cursor-disabled: var(--cursor-default);
|
|
108
|
+
--cursor-n-resize: n-resize;
|
|
109
|
+
--cursor-s-resize: s-resize;
|
|
110
|
+
--cursor-se-resize: se-resize;
|
|
111
|
+
--cursor-e-resize: e-resize;
|
|
29
112
|
}
|
package/styles/colors.scss
CHANGED
|
@@ -1,40 +1,122 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* TGUI
|
|
3
|
+
* Main Colors
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* This file contains all the main colors that are
|
|
6
|
+
* used elsewhere and are mixed/modified to
|
|
7
|
+
* suit the needs of the components/ui's.
|
|
8
|
+
*
|
|
9
|
+
* The main goal is to standardize colors.
|
|
10
|
+
* When adding new independent colors, you should add them here.
|
|
11
|
+
*
|
|
12
|
+
* Overwriting these variables will have an extreme impact
|
|
13
|
+
* on the global appearance of the entire TGUI, as they are used everywhere.
|
|
14
|
+
* For finer customization of components, use vars-components.scss
|
|
6
15
|
*/
|
|
7
16
|
|
|
8
17
|
@use "sass:color";
|
|
9
18
|
@use "sass:map";
|
|
10
19
|
@use "sass:meta";
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
:root {
|
|
22
|
+
/* Background colors */
|
|
23
|
+
--color-base: hsl(0, 0%, 15%);
|
|
24
|
+
--color-section: hsla(0, 0%, 0%, 0.33);
|
|
25
|
+
--color-secondary: hsl(
|
|
26
|
+
from var(--color-base) var(--secondary-hue) var(--secondary-saturation)
|
|
27
|
+
calc(l + var(--secondary-lightness-adjustment))
|
|
28
|
+
);
|
|
29
|
+
--secondary-hue: h;
|
|
30
|
+
--secondary-saturation: s;
|
|
31
|
+
--secondary-lightness-adjustment: 7.5;
|
|
32
|
+
--base-gradient-spread: 2;
|
|
33
|
+
--color-base-start: hsl(
|
|
34
|
+
from var(--color-base) h s calc(l + var(--base-gradient-spread))
|
|
35
|
+
);
|
|
36
|
+
--color-base-end: hsl(
|
|
37
|
+
from var(--color-base) h s calc(l - var(--base-gradient-spread))
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
/* Scrollbar */
|
|
41
|
+
--color-scrollbar-base: var(--color-section);
|
|
42
|
+
--color-scrollbar-thumb: hsl(from var(--color-base) h s calc(l + 9.25));
|
|
43
|
+
|
|
44
|
+
/* Candystripe */
|
|
45
|
+
--candystripe-odd: hsla(0, 0%, 0%, 0.25);
|
|
46
|
+
--candystripe-even: transparent;
|
|
47
|
+
|
|
48
|
+
/* Base colors */
|
|
49
|
+
--color-red: hsl(0, 70%, 50%);
|
|
50
|
+
--color-orange: hsl(25, 90%, 50%);
|
|
51
|
+
--color-yellow: hsl(50, 97.5%, 50%);
|
|
52
|
+
--color-olive: hsl(70, 75%, 45%);
|
|
53
|
+
--color-green: hsl(140, 70%, 40%);
|
|
54
|
+
--color-teal: hsl(180, 100%, 35%);
|
|
55
|
+
--color-blue: hsl(210, 65%, 47.5%);
|
|
56
|
+
--color-violet: hsl(260, 60%, 50%);
|
|
57
|
+
--color-purple: hsl(290, 60%, 50%);
|
|
58
|
+
--color-pink: hsl(325, 70%, 50%);
|
|
59
|
+
--color-brown: hsl(25, 47.5%, 45%);
|
|
60
|
+
|
|
61
|
+
/* Additional colors */
|
|
62
|
+
--color-gold: hsl(40, 90%, 50%);
|
|
63
|
+
|
|
64
|
+
/* Grayscale colors */
|
|
65
|
+
--color-black: hsl(0, 0%, 0%);
|
|
66
|
+
--color-white: hsl(0, 0%, 100%);
|
|
67
|
+
--color-grey: hsl(0, 0%, 50%);
|
|
68
|
+
--color-light-grey: hsl(0, 0%, 66.6%);
|
|
69
|
+
--color-gray: var(--color-grey);
|
|
70
|
+
--color-light-gray: var(--color-light-grey);
|
|
71
|
+
|
|
72
|
+
/* Action colors */
|
|
73
|
+
--color-action: hsl(0, 0%, 50%);
|
|
74
|
+
--color-hover: hsl(from var(--color-action) h s l / 0.25);
|
|
75
|
+
--color-active: hsl(from var(--color-action) h s l / 0.3);
|
|
76
|
+
--color-selected: hsl(from var(--color-action) h s l / 0.4);
|
|
77
|
+
|
|
78
|
+
/* Semantic colors */
|
|
79
|
+
--primary-hue: 210;
|
|
80
|
+
--primary-saturation: 37.5%;
|
|
81
|
+
--primary-lightness: 45%;
|
|
82
|
+
--color-primary: hsl(
|
|
83
|
+
var(--primary-hue),
|
|
84
|
+
var(--primary-saturation),
|
|
85
|
+
var(--primary-lightness)
|
|
86
|
+
);
|
|
87
|
+
--color-good: hsl(95, 62.5%, 40%);
|
|
88
|
+
--color-average: hsl(32.5, 90%, 50%);
|
|
89
|
+
--color-bad: hsl(0, 72.5%, 50%);
|
|
90
|
+
--color-label: hsl(from var(--color-primary) h 17.5 57.5);
|
|
28
91
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
92
|
+
/* Text colors */
|
|
93
|
+
--color-text: var(--color-white);
|
|
94
|
+
--color-text-translucent: hsl(from var(--color-text) h s l / 0.5);
|
|
95
|
+
--color-text-translucent-light: hsl(from var(--color-text) h s l / 0.75);
|
|
96
|
+
--color-text-fixed-white: var(--color-white);
|
|
97
|
+
--color-text-fixed-black: var(--color-black);
|
|
98
|
+
|
|
99
|
+
/* Link colors */
|
|
100
|
+
--color-hyperlink: hsl(220, 100%, 70%);
|
|
101
|
+
--color-hyperlink-visited: hsl(260, 100%, 70%);
|
|
102
|
+
--color-hyperlink-new: hsl(0, 100%, 70%);
|
|
103
|
+
--color-hyperlink-new-visited: hsl(15, 100%, 70%);
|
|
104
|
+
|
|
105
|
+
/* Border */
|
|
106
|
+
--color-border: hsla(0, 0%, 100%, 0.1);
|
|
107
|
+
--color-border-dark: hsla(0, 0%, 0%, 0.33);
|
|
108
|
+
--border-primary-saturation: 100;
|
|
109
|
+
--border-primary-lightness: 75;
|
|
110
|
+
--border-primary-alpha: 0.75;
|
|
111
|
+
--color-border-primary: hsl(
|
|
112
|
+
from var(--color-primary) h var(--border-primary-saturation)
|
|
113
|
+
var(--border-primary-lightness) / var(--border-primary-alpha)
|
|
114
|
+
);
|
|
115
|
+
--color-border-secondary: hsl(from var(--color-border-primary) h s l / 1);
|
|
116
|
+
}
|
|
34
117
|
|
|
35
118
|
// Mappings of color names
|
|
36
119
|
$color-map: ();
|
|
37
|
-
|
|
38
120
|
$_gen_map: (
|
|
39
121
|
/* Base colors */ "red": var(--color-red),
|
|
40
122
|
"orange": var(--color-orange),
|
|
@@ -72,18 +154,3 @@ $color-map-keys: map.keys($_gen_map) !default;
|
|
|
72
154
|
)
|
|
73
155
|
);
|
|
74
156
|
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Background and foreground color lightness ratios
|
|
78
|
-
* @deprecated
|
|
79
|
-
*/
|
|
80
|
-
$bg-lightness: -15% !default;
|
|
81
|
-
$fg-lightness: 10% !default;
|
|
82
|
-
|
|
83
|
-
@function bg($color) {
|
|
84
|
-
@return hsl(from $color h s calc(l - var(--adjust-color)));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@function fg($color) {
|
|
88
|
-
@return hsl(from $color h s calc(l + var(--adjust-color)));
|
|
89
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
|
|
3
3
|
.Dialog {
|
|
4
4
|
position: fixed;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
font-family: var(--font-family-mono);
|
|
16
|
-
font-size:
|
|
16
|
+
font-size: fn.em(14px);
|
|
17
17
|
background-color: var(--color-base);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "../base";
|
|
2
|
+
@use "../functions" as fn;
|
|
2
3
|
@use "./Button" as button;
|
|
3
4
|
|
|
4
5
|
.Dropdown {
|
|
@@ -24,18 +25,33 @@
|
|
|
24
25
|
width: 100%;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
&__input,
|
|
27
29
|
&__control {
|
|
28
30
|
display: flex;
|
|
29
31
|
overflow: hidden;
|
|
30
32
|
flex: 1;
|
|
31
33
|
font-family: var(--font-family);
|
|
32
|
-
font-size:
|
|
33
|
-
line-height:
|
|
34
|
-
height:
|
|
34
|
+
font-size: fn.em(12px);
|
|
35
|
+
line-height: fn.em(16px);
|
|
36
|
+
height: fn.em(22px);
|
|
35
37
|
border-radius: var(--button-border-radius);
|
|
36
38
|
@include button.button-color();
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
&__input-wrapper {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__input-chevron {
|
|
48
|
+
position: absolute;
|
|
49
|
+
right: 4px;
|
|
50
|
+
top: 50%;
|
|
51
|
+
transform: translateY(-50%);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
&__selected-text {
|
|
40
56
|
flex: 1;
|
|
41
57
|
display: inline-block;
|
|
@@ -53,7 +69,7 @@
|
|
|
53
69
|
align-content: center;
|
|
54
70
|
text-align: center;
|
|
55
71
|
height: 100%;
|
|
56
|
-
width:
|
|
72
|
+
width: fn.em(22px);
|
|
57
73
|
transition: transform var(--dropdown-transition);
|
|
58
74
|
|
|
59
75
|
&--arrow {
|
|
@@ -73,7 +89,7 @@
|
|
|
73
89
|
overflow-y: auto;
|
|
74
90
|
scrollbar-width: thin;
|
|
75
91
|
scrollbar-color: var(--color-scrollbar-thumb) transparent;
|
|
76
|
-
max-height:
|
|
92
|
+
max-height: var(--dropdown-menu-max-height);
|
|
77
93
|
padding: var(--space-sm);
|
|
78
94
|
|
|
79
95
|
&--wrapper {
|
|
@@ -91,8 +107,8 @@
|
|
|
91
107
|
white-space: nowrap;
|
|
92
108
|
text-overflow: ellipsis;
|
|
93
109
|
font-family: var(--font-family);
|
|
94
|
-
font-size:
|
|
95
|
-
line-height:
|
|
110
|
+
font-size: fn.em(12px);
|
|
111
|
+
line-height: var(--dropdown-entry-line-height);
|
|
96
112
|
padding: var(--space-xs) var(--space-m);
|
|
97
113
|
border-radius: var(--dropdown-entry-border-radius);
|
|
98
114
|
transition: background-color var(--dropdown-entry-transition);
|
|
@@ -125,3 +141,16 @@
|
|
|
125
141
|
justify-content: center;
|
|
126
142
|
max-width: 2rem;
|
|
127
143
|
}
|
|
144
|
+
|
|
145
|
+
.Dropdown__input--styled {
|
|
146
|
+
--input-background: var(--button-background);
|
|
147
|
+
--input-border-color: var(--color-border-dark);
|
|
148
|
+
--input-border-color-focus: var(--color-border-dark);
|
|
149
|
+
--input-border-disabled: var(--color-border-dark);
|
|
150
|
+
--input-color: var(--button-color);
|
|
151
|
+
--input-color-placeholder: var(--button-color);
|
|
152
|
+
|
|
153
|
+
&.Input::placeholder {
|
|
154
|
+
font-style: normal;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
|
|
3
3
|
.MenuBar {
|
|
4
4
|
display: flex;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
.MenuBar__font {
|
|
8
8
|
font-family: var(--menu-bar-font-family);
|
|
9
|
-
font-size:
|
|
10
|
-
line-height:
|
|
9
|
+
font-size: fn.em(12px);
|
|
10
|
+
line-height: fn.em(17px);
|
|
11
11
|
|
|
12
12
|
&.MenuBar__disabled {
|
|
13
13
|
color: hsl(from currentColor h s l / 0.2);
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.MenuBar__MenuBarButton-text {
|
|
76
76
|
text-overflow: clip;
|
|
77
77
|
white-space: nowrap;
|
|
78
|
-
height:
|
|
78
|
+
height: fn.em(17px);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.MenuBar__Separator {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
@use "../colors";
|
|
3
3
|
|
|
4
4
|
.NoticeBox {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
);
|
|
13
13
|
background-image: repeating-linear-gradient(
|
|
14
14
|
-45deg,
|
|
15
|
-
transparent 0
|
|
16
|
-
var(--notice-box-stripes)
|
|
15
|
+
transparent 0 fn.em(10px),
|
|
16
|
+
var(--notice-box-stripes) fn.em(10px) fn.em(20px)
|
|
17
17
|
);
|
|
18
18
|
color: var(--notice-box-color);
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
|
|
3
3
|
.NumberInput {
|
|
4
4
|
cursor: var(--cursor-n-resize);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-block;
|
|
8
8
|
text-align: right;
|
|
9
|
-
line-height:
|
|
9
|
+
line-height: fn.em(17px);
|
|
10
10
|
padding: 0 var(--space-sm);
|
|
11
11
|
margin-right: var(--space-xs);
|
|
12
12
|
background-color: var(--number-input-background);
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
position: absolute;
|
|
40
40
|
bottom: 0;
|
|
41
41
|
left: 0;
|
|
42
|
-
width:
|
|
42
|
+
width: fn.em(3px);
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
border-bottom: var(--border-thickness-tiny) solid
|
|
45
45
|
var(--number-input-border-color-active);
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
border: 0;
|
|
55
55
|
outline: 0;
|
|
56
56
|
width: 100%;
|
|
57
|
-
font-size:
|
|
58
|
-
line-height:
|
|
59
|
-
height:
|
|
57
|
+
font-size: fn.em(12px);
|
|
58
|
+
line-height: fn.em(17px);
|
|
59
|
+
height: fn.em(17px);
|
|
60
60
|
margin: 0;
|
|
61
61
|
padding: 0 var(--space-m);
|
|
62
62
|
font-family: var(--font-family);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
|
|
3
3
|
.Section {
|
|
4
4
|
position: relative;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.Section__titleText {
|
|
24
|
-
font-size:
|
|
24
|
+
font-size: fn.em(14px);
|
|
25
25
|
font-weight: bold;
|
|
26
26
|
color: var(--section-title-color);
|
|
27
27
|
}
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
|
|
108
108
|
// Level 2 section title
|
|
109
109
|
.Section .Section .Section__titleText {
|
|
110
|
-
font-size:
|
|
110
|
+
font-size: fn.em(13px);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// Level 3 section title
|
|
114
114
|
.Section .Section .Section .Section__titleText {
|
|
115
|
-
font-size:
|
|
115
|
+
font-size: fn.em(12px);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.Section--flex {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@use "../base";
|
|
2
|
-
|
|
3
1
|
.Slider {
|
|
4
2
|
cursor: e-resize;
|
|
5
3
|
user-select: none;
|
|
@@ -10,6 +8,15 @@
|
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
10
|
|
|
11
|
+
&--disabled {
|
|
12
|
+
cursor: default;
|
|
13
|
+
opacity: var(--slider-disabled-opacity);
|
|
14
|
+
|
|
15
|
+
.Slider__cursor:before {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
&__cursor {
|
|
14
21
|
position: absolute;
|
|
15
22
|
inset: 0 calc(-1 * var(--space-xxs));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../
|
|
1
|
+
@use "../functions" as fn;
|
|
2
2
|
|
|
3
3
|
.Tooltip {
|
|
4
4
|
backdrop-filter: var(--tooltip-blur);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
border-radius: var(--tooltip-border-radius);
|
|
7
7
|
box-shadow: 0.1em 0.1em 1.25em -0.1em hsla(0, 0%, 0%, 0.5);
|
|
8
8
|
color: var(--tooltip-color);
|
|
9
|
-
max-width:
|
|
9
|
+
max-width: fn.em(250px);
|
|
10
10
|
padding: var(--space-m) var(--space-l);
|
|
11
11
|
pointer-events: none;
|
|
12
12
|
text-align: left;
|
package/styles/functions.scss
CHANGED
|
@@ -12,12 +12,32 @@
|
|
|
12
12
|
@return math.div($value, $value * 0 + 1);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/* Darken color, to make it more readable if used as a background */
|
|
16
|
+
@function bg($color) {
|
|
17
|
+
@return hsl(from $color h s calc(l - var(--adjust-color)));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Lighten color, to make it more readable if used as a text */
|
|
21
|
+
@function fg($color) {
|
|
22
|
+
@return hsl(from $color h s calc(l + var(--adjust-color)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Increases perceptual color lightness. */
|
|
16
26
|
@function lighten($color, $amount) {
|
|
17
27
|
@return color.adjust($color, $lightness: $amount * 1%, $space: hsl);
|
|
18
28
|
}
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
/* Decreases perceptual color lightness. */
|
|
21
31
|
@function darken($color, $amount) {
|
|
22
32
|
@return color.adjust($color, $lightness: -$amount * 1%, $space: hsl);
|
|
23
33
|
}
|
|
34
|
+
|
|
35
|
+
/* Converts px to em. Relies on the font-size variable. */
|
|
36
|
+
@function em($px) {
|
|
37
|
+
@return calc($px / var(--font-size) * 1em);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Converts px to rem. Relies on the font-size variable. */
|
|
41
|
+
@function rem($px) {
|
|
42
|
+
@return calc($px / var(--font-size) * 1rem);
|
|
43
|
+
}
|
package/styles/main.scss
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Made with love by Aylong (https://github.com/AyIong)
|
|
20
20
|
*/
|
|
21
|
+
@use "./base";
|
|
22
|
+
@use "./functions" as fn;
|
|
21
23
|
|
|
22
24
|
:root {
|
|
23
25
|
/* BlockQuote */
|
|
@@ -54,6 +56,8 @@
|
|
|
54
56
|
--divider-border: var(--border-thickness-small) solid var(--divider-color);
|
|
55
57
|
|
|
56
58
|
/* Dropdown */
|
|
59
|
+
--dropdown-menu-max-height: #{fn.em(200px)};
|
|
60
|
+
--dropdown-entry-line-height: #{fn.em(16px)};
|
|
57
61
|
--dropdown-transition: var(--transition-time-medium);
|
|
58
62
|
--dropdown-menu-color: var(--color-text);
|
|
59
63
|
--dropdown-menu-background: hsl(
|
|
@@ -165,6 +169,7 @@
|
|
|
165
169
|
--slider-popup-color: var(--tooltip-color);
|
|
166
170
|
--slider-popup-border-radius: var(--tooltip-border-radius);
|
|
167
171
|
--slider-popup-blur: var(--tooltip-blur);
|
|
172
|
+
--slider-disabled-opacity: 0.5;
|
|
168
173
|
|
|
169
174
|
/* Tooltip */
|
|
170
175
|
--tooltip-color: var(--color-text);
|
package/styles/vars-colors.scss
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TGUI
|
|
3
|
-
* Main Colors
|
|
4
|
-
*
|
|
5
|
-
* This file contains all the main colors that are
|
|
6
|
-
* used elsewhere and are mixed/modified to
|
|
7
|
-
* suit the needs of the components/ui's.
|
|
8
|
-
*
|
|
9
|
-
* The main goal is to standardize colors.
|
|
10
|
-
* When adding new independent colors, you should add them here.
|
|
11
|
-
*
|
|
12
|
-
* Overwriting these variables will have an extreme impact
|
|
13
|
-
* on the global appearance of the entire TGUI, as they are used everywhere.
|
|
14
|
-
* For finer customization of components, use vars-components.scss
|
|
15
|
-
*
|
|
16
|
-
* Made with love by Aylong (https://github.com/AyIong)
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
:root {
|
|
20
|
-
/* Background colors */
|
|
21
|
-
--color-base: hsl(0, 0%, 15%);
|
|
22
|
-
--color-section: hsla(0, 0%, 0%, 0.33);
|
|
23
|
-
--color-secondary: hsl(
|
|
24
|
-
from var(--color-base) var(--secondary-hue) var(--secondary-saturation)
|
|
25
|
-
calc(l + var(--secondary-lightness-adjustment))
|
|
26
|
-
);
|
|
27
|
-
--secondary-hue: h;
|
|
28
|
-
--secondary-saturation: s;
|
|
29
|
-
--secondary-lightness-adjustment: 7.5;
|
|
30
|
-
--base-gradient-spread: 2;
|
|
31
|
-
--color-base-start: hsl(
|
|
32
|
-
from var(--color-base) h s calc(l + var(--base-gradient-spread))
|
|
33
|
-
);
|
|
34
|
-
--color-base-end: hsl(
|
|
35
|
-
from var(--color-base) h s calc(l - var(--base-gradient-spread))
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
/* Scrollbar */
|
|
39
|
-
--color-scrollbar-base: var(--color-section);
|
|
40
|
-
--color-scrollbar-thumb: hsl(from var(--color-base) h s calc(l + 9.25));
|
|
41
|
-
|
|
42
|
-
/* Candystripe */
|
|
43
|
-
--candystripe-odd: hsla(0, 0%, 0%, 0.25);
|
|
44
|
-
--candystripe-even: transparent;
|
|
45
|
-
|
|
46
|
-
/* Base colors */
|
|
47
|
-
--color-red: hsl(0, 70%, 50%);
|
|
48
|
-
--color-orange: hsl(25, 90%, 50%);
|
|
49
|
-
--color-yellow: hsl(50, 97.5%, 50%);
|
|
50
|
-
--color-olive: hsl(70, 75%, 45%);
|
|
51
|
-
--color-green: hsl(140, 70%, 40%);
|
|
52
|
-
--color-teal: hsl(180, 100%, 35%);
|
|
53
|
-
--color-blue: hsl(210, 65%, 47.5%);
|
|
54
|
-
--color-violet: hsl(260, 60%, 50%);
|
|
55
|
-
--color-purple: hsl(290, 60%, 50%);
|
|
56
|
-
--color-pink: hsl(325, 70%, 50%);
|
|
57
|
-
--color-brown: hsl(25, 47.5%, 45%);
|
|
58
|
-
|
|
59
|
-
/* Additional colors */
|
|
60
|
-
--color-gold: hsl(40, 90%, 50%);
|
|
61
|
-
|
|
62
|
-
/* Grayscale colors */
|
|
63
|
-
--color-black: hsl(0, 0%, 0%);
|
|
64
|
-
--color-white: hsl(0, 0%, 100%);
|
|
65
|
-
--color-grey: hsl(0, 0%, 50%);
|
|
66
|
-
--color-light-grey: hsl(0, 0%, 66.6%);
|
|
67
|
-
--color-gray: var(--color-grey);
|
|
68
|
-
--color-light-gray: var(--color-light-grey);
|
|
69
|
-
|
|
70
|
-
/* Action colors */
|
|
71
|
-
--color-action: hsl(0, 0%, 50%);
|
|
72
|
-
--color-hover: hsl(from var(--color-action) h s l / 0.25);
|
|
73
|
-
--color-active: hsl(from var(--color-action) h s l / 0.3);
|
|
74
|
-
--color-selected: hsl(from var(--color-action) h s l / 0.4);
|
|
75
|
-
|
|
76
|
-
/* Semantic colors */
|
|
77
|
-
--primary-hue: 210;
|
|
78
|
-
--primary-saturation: 37.5%;
|
|
79
|
-
--primary-lightness: 45%;
|
|
80
|
-
--color-primary: hsl(
|
|
81
|
-
var(--primary-hue),
|
|
82
|
-
var(--primary-saturation),
|
|
83
|
-
var(--primary-lightness)
|
|
84
|
-
);
|
|
85
|
-
--color-good: hsl(95, 62.5%, 40%);
|
|
86
|
-
--color-average: hsl(32.5, 90%, 50%);
|
|
87
|
-
--color-bad: hsl(0, 72.5%, 50%);
|
|
88
|
-
--color-label: hsl(from var(--color-primary) h 17.5 57.5);
|
|
89
|
-
|
|
90
|
-
/* Text colors */
|
|
91
|
-
--color-text: var(--color-white);
|
|
92
|
-
--color-text-translucent: hsl(from var(--color-text) h s l / 0.5);
|
|
93
|
-
--color-text-translucent-light: hsl(from var(--color-text) h s l / 0.75);
|
|
94
|
-
--color-text-fixed-white: var(--color-white);
|
|
95
|
-
--color-text-fixed-black: var(--color-black);
|
|
96
|
-
|
|
97
|
-
/* Link colors */
|
|
98
|
-
--color-hyperlink: hsl(220, 100%, 70%);
|
|
99
|
-
--color-hyperlink-visited: hsl(260, 100%, 70%);
|
|
100
|
-
--color-hyperlink-new: hsl(0, 100%, 70%);
|
|
101
|
-
--color-hyperlink-new-visited: hsl(15, 100%, 70%);
|
|
102
|
-
|
|
103
|
-
/* Border */
|
|
104
|
-
--color-border: hsla(0, 0%, 100%, 0.1);
|
|
105
|
-
--color-border-dark: hsla(0, 0%, 0%, 0.33);
|
|
106
|
-
--border-primary-saturation: 100;
|
|
107
|
-
--border-primary-lightness: 75;
|
|
108
|
-
--border-primary-alpha: 0.75;
|
|
109
|
-
--color-border-primary: hsl(
|
|
110
|
-
from var(--color-primary) h var(--border-primary-saturation)
|
|
111
|
-
var(--border-primary-lightness) / var(--border-primary-alpha)
|
|
112
|
-
);
|
|
113
|
-
--color-border-secondary: hsl(from var(--color-border-primary) h s l / 1);
|
|
114
|
-
}
|
package/styles/vars-values.scss
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TGUI
|
|
3
|
-
* Values Variables
|
|
4
|
-
*
|
|
5
|
-
* This file contains all values, like spacings, sizes, etc.
|
|
6
|
-
* You won't find any colors here, just numbers and letters.
|
|
7
|
-
*
|
|
8
|
-
* Made with love by Aylong (https://github.com/AyIong)
|
|
9
|
-
*/
|
|
10
|
-
:root {
|
|
11
|
-
/* Font */
|
|
12
|
-
--font-size: 12px;
|
|
13
|
-
--font-family: Verdana, Geneva, sans-serif;
|
|
14
|
-
--font-family-mono: Consolas, monospace;
|
|
15
|
-
|
|
16
|
-
/* Border thickness */
|
|
17
|
-
--border-thickness-unit: 0.5em;
|
|
18
|
-
/* 1px | 0.085em */
|
|
19
|
-
--border-thickness-tiny: calc(var(--border-thickness-unit) * 0.5 * 0.34);
|
|
20
|
-
/* 2px | 0.17em */
|
|
21
|
-
--border-thickness-small: calc(var(--border-thickness-unit) * 0.34);
|
|
22
|
-
/* 3px | 0.25em */
|
|
23
|
-
--border-thickness-medium: calc(var(--border-thickness-unit) * 0.5);
|
|
24
|
-
/* 4px | 0.33em */
|
|
25
|
-
--border-thickness-large: calc(var(--border-thickness-unit) * 0.66);
|
|
26
|
-
/* 6px | 0.5em */
|
|
27
|
-
--border-thickness-larger: var(--border-thickness-unit);
|
|
28
|
-
|
|
29
|
-
/* Border radius */
|
|
30
|
-
--border-radius-unit: 1rem;
|
|
31
|
-
/* 2px | 0.17rem */
|
|
32
|
-
--border-radius-tiny: calc(var(--border-radius-unit) * 0.25 * 0.68);
|
|
33
|
-
/* 3px | 0.25rem */
|
|
34
|
-
--border-radius-small: calc(var(--border-radius-unit) * 0.25);
|
|
35
|
-
/* 4px | 0.33rem */
|
|
36
|
-
--border-radius-medium: calc(var(--border-radius-unit) * 0.33);
|
|
37
|
-
/* 6px | 0.5rem */
|
|
38
|
-
--border-radius-large: calc(var(--border-radius-unit) * 0.5);
|
|
39
|
-
/* 10px | 0.75rem */
|
|
40
|
-
--border-radius-larger: calc(var(--border-radius-unit) * 0.75);
|
|
41
|
-
/* 12px | 1rem*/
|
|
42
|
-
--border-radius-huge: var(--border-radius-unit);
|
|
43
|
-
/* 24px | 2rem*/
|
|
44
|
-
--border-radius-giant: calc(var(--border-radius-unit) * 2);
|
|
45
|
-
/* Maximum border radius. Makes perfect circles */
|
|
46
|
-
--border-radius-circular: 99999px;
|
|
47
|
-
|
|
48
|
-
/* Spacing */
|
|
49
|
-
--space-unit: 1em;
|
|
50
|
-
/* 1px | 0.085em */
|
|
51
|
-
--space-xxs: calc(var(--space-unit) * 0.25 * 0.34);
|
|
52
|
-
/* 2px | 0.17em */
|
|
53
|
-
--space-xs: calc(var(--space-unit) * 0.25 * 0.68);
|
|
54
|
-
/* 3px | 0.25em */
|
|
55
|
-
--space-s: calc(var(--space-unit) * 0.25);
|
|
56
|
-
/* 4px | 0.33em */
|
|
57
|
-
--space-sm: calc(var(--space-unit) * 0.33);
|
|
58
|
-
/* 6px | 0.5em */
|
|
59
|
-
--space-m: calc(var(--space-unit) * 0.5);
|
|
60
|
-
/* 8px | 0.66em */
|
|
61
|
-
--space-ml: calc(var(--space-unit) * 0.66);
|
|
62
|
-
/* 10px | 0.75em */
|
|
63
|
-
--space-l: calc(var(--space-unit) * 0.75);
|
|
64
|
-
/* 12px | 1em*/
|
|
65
|
-
--space-xl: var(--space-unit);
|
|
66
|
-
/* 24px | 2em*/
|
|
67
|
-
--space-xxl: calc(var(--space-unit) * 2);
|
|
68
|
-
|
|
69
|
-
/* Transition */
|
|
70
|
-
--transition-time-unit: 1s;
|
|
71
|
-
/* 0.1s | 100ms */
|
|
72
|
-
--transition-time-fast: calc(var(--transition-time-unit) * 0.1);
|
|
73
|
-
/* 0.2s | 200ms */
|
|
74
|
-
--transition-time-medium: calc(var(--transition-time-unit) * 0.2);
|
|
75
|
-
/* 0.5s | 500ms */
|
|
76
|
-
--transition-time-slow: calc(var(--transition-time-unit) * 0.5);
|
|
77
|
-
/* 1s | 1000ms */
|
|
78
|
-
--transition-time-slowest: var(--transition-time-unit);
|
|
79
|
-
|
|
80
|
-
/* Shadows */
|
|
81
|
-
--shadow-unit: 1rem;
|
|
82
|
-
/* 0 0 0.5rem */
|
|
83
|
-
--shadow-glow-small: 0 0 calc(var(--shadow-unit) * 0.5);
|
|
84
|
-
/* 0 0 1rem */
|
|
85
|
-
--shadow-glow-medium: 0 0 var(--shadow-unit);
|
|
86
|
-
/* 0 0 2rem */
|
|
87
|
-
--shadow-glow-large: 0 0 calc(var(--shadow-unit) * 2);
|
|
88
|
-
|
|
89
|
-
/* Blur */
|
|
90
|
-
--blur-small: blur(6px);
|
|
91
|
-
--blur-medium: blur(12px);
|
|
92
|
-
--blur-large: blur(24px);
|
|
93
|
-
|
|
94
|
-
/* Adjustments */
|
|
95
|
-
/* Color lightness multiplier. + for FG - for BG */
|
|
96
|
-
--adjust-color: 5;
|
|
97
|
-
/* Color lightness multiplier wneh hovered */
|
|
98
|
-
--adjust-hover: 10;
|
|
99
|
-
/* Color lightness multiplier when active (clicked) */
|
|
100
|
-
--adjust-active: 7.5;
|
|
101
|
-
|
|
102
|
-
/* Cursors */
|
|
103
|
-
--cursor-default: default;
|
|
104
|
-
--cursor-pointer: pointer;
|
|
105
|
-
--cursor-disabled: var(--cursor-default);
|
|
106
|
-
--cursor-n-resize: n-resize;
|
|
107
|
-
--cursor-s-resize: s-resize;
|
|
108
|
-
--cursor-se-resize: se-resize;
|
|
109
|
-
--cursor-e-resize: e-resize;
|
|
110
|
-
}
|