diff --git a/packages/console/src/components/CopyToClipboard/index.module.scss b/packages/console/src/components/CopyToClipboard/index.module.scss index 45da06853..b843c3962 100644 --- a/packages/console/src/components/CopyToClipboard/index.module.scss +++ b/packages/console/src/components/CopyToClipboard/index.module.scss @@ -2,7 +2,7 @@ .container { display: inline-block; - padding: _.unit(3); + padding: _.unit(2) _.unit(3); border-radius: _.unit(2); background: var(--color-inverse-on-surface); color: var(--color-on-secondary-container); diff --git a/packages/console/src/components/ImagePlaceholder/index.tsx b/packages/console/src/components/ImagePlaceholder/index.tsx index e3fa68b05..875a51e80 100644 --- a/packages/console/src/components/ImagePlaceholder/index.tsx +++ b/packages/console/src/components/ImagePlaceholder/index.tsx @@ -10,12 +10,16 @@ type Props = { borderRadius?: number; }; -const ImagePlaceholder = ({ size = 50, borderRadius = 8 }: Props) => { +const ImagePlaceholder = ({ size = 40, borderRadius = 8 }: Props) => { const { t } = useTranslation(); return (
- {t('general.placeholder')} + {t('general.placeholder')}
); }; diff --git a/packages/console/src/components/ItemPreview/index.module.scss b/packages/console/src/components/ItemPreview/index.module.scss index 20b553220..6af1cb9a1 100644 --- a/packages/console/src/components/ItemPreview/index.module.scss +++ b/packages/console/src/components/ItemPreview/index.module.scss @@ -23,4 +23,15 @@ font: var(--font-body-small); color: var(--color-outline); } + + &.compact { + .content { + display: flex; + align-items: baseline; + + .title { + margin-right: _.unit(1); + } + } + } } diff --git a/packages/console/src/components/ItemPreview/index.tsx b/packages/console/src/components/ItemPreview/index.tsx index 28a53ad70..5ce1f0712 100644 --- a/packages/console/src/components/ItemPreview/index.tsx +++ b/packages/console/src/components/ItemPreview/index.tsx @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import React, { ReactNode } from 'react'; import { Link, To } from 'react-router-dom'; @@ -8,13 +9,14 @@ type Props = { subtitle?: string; icon?: ReactNode; to?: To; + size?: 'default' | 'compact'; }; -const ItemPreview = ({ title, subtitle, icon, to }: Props) => { +const ItemPreview = ({ title, subtitle, icon, to, size = 'default' }: Props) => { return ( -
+
{icon &&
{icon}
} -
+
{to && ( div.loading { display: flex; background: none; - height: 50px; + height: 40px; border-radius: unset; .avatar { - width: 50px; - height: 50px; + width: 40px; + height: 40px; border-radius: _.unit(2); margin-right: _.unit(4); background: var(--color-neutral-95); @@ -20,14 +20,15 @@ td > div.loading { .title { background: var(--color-neutral-95); border-radius: _.unit(2); - height: 16px; - margin: _.unit(2) 0; + height: 14px; + margin: _.unit(1) 0; } .subTitle { background: var(--color-neutral-95); border-radius: _.unit(2); height: 12px; + margin-top: _.unit(2); } } } diff --git a/packages/console/src/pages/ApiResources/index.module.scss b/packages/console/src/pages/ApiResources/index.module.scss index 4ce7f6326..1122ae523 100644 --- a/packages/console/src/pages/ApiResources/index.module.scss +++ b/packages/console/src/pages/ApiResources/index.module.scss @@ -1,5 +1,9 @@ @use '@/scss/underscore' as _; +.card { + @include _.flex-column; +} + .headline { display: flex; justify-content: space-between; @@ -7,18 +11,7 @@ .table { margin-top: _.unit(4); - - tbody { - max-height: calc(100vh - _.unit(64)); - - tr.clickable { - cursor: pointer; - - &:hover { - background: var(--color-table-row-selected); - } - } - } + flex: 1; } .apiResourceName { diff --git a/packages/console/src/pages/ApiResources/index.tsx b/packages/console/src/pages/ApiResources/index.tsx index 2b99a6132..c5c5e5e28 100644 --- a/packages/console/src/pages/ApiResources/index.tsx +++ b/packages/console/src/pages/ApiResources/index.tsx @@ -1,5 +1,6 @@ import { Resource } from '@logto/schemas'; import { conditional } from '@silverhand/essentials/lib/utilities/conditional.js'; +import classNames from 'classnames'; import React, { useState } from 'react'; import { toast } from 'react-hot-toast'; import { useTranslation } from 'react-i18next'; @@ -18,6 +19,7 @@ import TableError from '@/components/Table/TableError'; import TableLoading from '@/components/Table/TableLoading'; import { RequestError } from '@/hooks/use-api'; import * as modalStyles from '@/scss/modal.module.scss'; +import * as tableStyles from '@/scss/table.module.scss'; import CreateForm from './components/CreateForm'; import * as styles from './index.module.scss'; @@ -32,7 +34,7 @@ const ApiResources = () => { const navigate = useNavigate(); return ( - +
- - - - - - - - - - - - - {error && ( - mutate(undefined, true)} - /> - )} - {isLoading && } - {data?.length === 0 && ( - - { - navigate(buildDetailsLink(id)); - }} - > - - +
+
{t('api_resources.api_name')}{t('api_resources.api_identifier')}
- } to={buildDetailsLink(id)} /> - - -
+ + + + + + + + - ))} - -
{t('api_resources.api_name')}{t('api_resources.api_identifier')}
+ + + {error && ( + mutate(undefined, true)} + /> + )} + {isLoading && } + {data?.length === 0 && ( + +
); }; diff --git a/packages/console/src/pages/Applications/index.module.scss b/packages/console/src/pages/Applications/index.module.scss index 97ea6d9e4..e1e6c4560 100644 --- a/packages/console/src/pages/Applications/index.module.scss +++ b/packages/console/src/pages/Applications/index.module.scss @@ -1,5 +1,9 @@ @use '@/scss/underscore' as _; +.card { + @include _.flex-column; +} + .headline { display: flex; justify-content: space-between; @@ -7,18 +11,7 @@ .table { margin-top: _.unit(4); - - tbody { - max-height: calc(100vh - _.unit(64)); - - tr.clickable { - cursor: pointer; - - &:hover { - background: var(--color-table-row-selected); - } - } - } + flex: 1; } .applicationName { diff --git a/packages/console/src/pages/Applications/index.tsx b/packages/console/src/pages/Applications/index.tsx index f359a57ba..47a0c9938 100644 --- a/packages/console/src/pages/Applications/index.tsx +++ b/packages/console/src/pages/Applications/index.tsx @@ -1,5 +1,6 @@ import { Application } from '@logto/schemas'; import { conditional } from '@silverhand/essentials/lib/utilities/conditional.js'; +import classNames from 'classnames'; import React, { useState } from 'react'; import { toast } from 'react-hot-toast'; import { useTranslation } from 'react-i18next'; @@ -18,6 +19,7 @@ import TableError from '@/components/Table/TableError'; import TableLoading from '@/components/Table/TableLoading'; import { RequestError } from '@/hooks/use-api'; import * as modalStyles from '@/scss/modal.module.scss'; +import * as tableStyles from '@/scss/table.module.scss'; import { applicationTypeI18nKey } from '@/types/applications'; import CreateForm from './components/CreateForm'; @@ -31,7 +33,7 @@ const Applications = () => { const navigate = useNavigate(); return ( - +
- - - - - - - - - - - - - {error && ( - mutate(undefined, true)} - /> - )} - {isLoading && } - {data?.length === 0 && ( - - { - navigate(`/applications/${id}`); - }} - > - - +
+
{t('applications.application_name')}{t('applications.client_id')}
- } - to={`/applications/${id}`} - /> - - -
+ + + + + + + + - ))} - -
{t('applications.application_name')}{t('applications.client_id')}
+ + + {error && ( + mutate(undefined, true)} + /> + )} + {isLoading && } + {data?.length === 0 && ( + +
); }; diff --git a/packages/console/src/pages/Connectors/index.module.scss b/packages/console/src/pages/Connectors/index.module.scss index 784d4443b..29af73133 100644 --- a/packages/console/src/pages/Connectors/index.module.scss +++ b/packages/console/src/pages/Connectors/index.module.scss @@ -1,5 +1,9 @@ @use '@/scss/underscore' as _; +.card { + @include _.flex-column; +} + .headline { display: flex; justify-content: space-between; @@ -11,18 +15,7 @@ .table { margin-top: _.unit(4); - - tbody { - max-height: calc(100vh - _.unit(74)); - - tr.clickable { - cursor: pointer; - - &:hover { - background: var(--color-table-row-selected); - } - } - } + flex: 1; } .connectorName { diff --git a/packages/console/src/pages/Connectors/index.tsx b/packages/console/src/pages/Connectors/index.tsx index 2c8fcdc68..d2efd4f1a 100644 --- a/packages/console/src/pages/Connectors/index.tsx +++ b/packages/console/src/pages/Connectors/index.tsx @@ -1,4 +1,5 @@ import { ConnectorDTO, ConnectorType } from '@logto/schemas'; +import classNames from 'classnames'; import React, { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; @@ -12,6 +13,7 @@ import TableEmpty from '@/components/Table/TableEmpty'; import TableError from '@/components/Table/TableError'; import TableLoading from '@/components/Table/TableLoading'; import { RequestError } from '@/hooks/use-api'; +import * as tableStyles from '@/scss/table.module.scss'; import ConnectorRow from './components/ConnectorRow'; import SetupModal from './components/SetupModal'; @@ -49,7 +51,7 @@ const Connectors = () => { return ( <> - +
{isSocial && ( @@ -66,54 +68,60 @@ const Connectors = () => { {t('connectors.tab_email_sms')} {t('connectors.tab_social')} - - - - - - - - - - - - - - - {error && ( - mutate(undefined, true)} - /> - )} - {isLoading && } - {socialConnectors?.length === 0 && ( - - -
{t('connectors.connector_name')}{t('connectors.connector_type')}{t('connectors.connector_status')}
+
+ + + + + + + + + + + + + + + {error && ( + mutate(undefined, true)} + /> + )} + {isLoading && } + {socialConnectors?.length === 0 && ( + + +
{t('connectors.connector_name')}{t('connectors.connector_type')}{t('connectors.connector_status')}
+
{data && ( { {users?.map(({ id, name, username }) => ( { navigate(`/users/${id}`); }} @@ -116,8 +116,9 @@ const Users = () => { } + icon={} to={`/users/${id}`} + size="compact" /> Application diff --git a/packages/console/src/scss/_colors.scss b/packages/console/src/scss/_colors.scss index dad4541b3..42d47111a 100644 --- a/packages/console/src/scss/_colors.scss +++ b/packages/console/src/scss/_colors.scss @@ -83,6 +83,7 @@ --color-code-comment: #66bb6a; --color-surface-3: #e3dff5; --color-surface-5: #dfd9f5; + --shadow-light-s1: 0 2px 8px rgba(0, 0, 0, 8%); --shadow-light-s2: 0 4px 12px rgba(0, 0, 0, 12%); } diff --git a/packages/console/src/scss/_underscore.scss b/packages/console/src/scss/_underscore.scss index 56476b8df..514929398 100644 --- a/packages/console/src/scss/_underscore.scss +++ b/packages/console/src/scss/_underscore.scss @@ -7,8 +7,8 @@ @mixin flex-column { display: flex; flex-direction: column; - align-items: center; justify-content: center; + height: 100%; } @mixin text-ellipsis { diff --git a/packages/console/src/scss/normalized.scss b/packages/console/src/scss/normalized.scss index eca34e64e..a7daac33f 100644 --- a/packages/console/src/scss/normalized.scss +++ b/packages/console/src/scss/normalized.scss @@ -30,30 +30,27 @@ table { th { font: var(--font-subhead-2); color: var(--color-component-caption); - padding: _.unit(3) _.unit(4); + padding: _.unit(2); border-bottom: 1px solid var(--color-neutral-90); text-align: left; + &:first-child, + &:last-child { + padding: _.unit(2) _.unit(8); + } + } + } + + tbody { + td { + font: var(--font-body-medium); + border-bottom: 1px solid var(--color-neutral-90); + padding: _.unit(3) _.unit(2); + &:first-child, &:last-child { padding: _.unit(3) _.unit(8); } } } - - tbody { - td { - border-bottom: 1px solid var(--color-neutral-90); - padding: _.unit(5) _.unit(4); - - &:first-child, - &:last-child { - padding: _.unit(5) _.unit(8); - } - } - } - - tr:last-child td { - border-bottom: none; - } } diff --git a/packages/console/src/scss/table.module.scss b/packages/console/src/scss/table.module.scss index 5f0975641..cf9dd2e32 100644 --- a/packages/console/src/scss/table.module.scss +++ b/packages/console/src/scss/table.module.scss @@ -1,13 +1,26 @@ @use '@/scss/underscore' as _; +.base { + box-shadow: var(--shadow-light-s1); +} + +tr.clickable { + cursor: pointer; + + &:hover { + background: var(--color-table-row-selected); + } +} + .scrollable { - margin-top: _.unit(4); overflow-y: auto; border: 1px solid var(--color-neutral-90); border-radius: _.unit(2); + box-shadow: var(--shadow-light-s1); table { border: none; + box-shadow: none; thead tr { position: sticky;